/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1a202c;
    line-height: 1.6;
    min-height: 100vh;
}

/* Container and layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0;
    letter-spacing: 0.025em;
}

/* Grid layout */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Calculator tools container */
.calculator-tools {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tool cards */
.tool-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 40px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95);
}

.tool-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* Form elements */
.form-group {
    margin-bottom: 1.25rem;
}

/* Form grid for compact layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .form-group {
    margin-bottom: 1rem;
}

/* Full width elements */
.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.025em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: rgba(255, 255, 255, 0.95);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #94a3b8;
    background-color: rgba(255, 255, 255, 0.9);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    font-style: normal;
    letter-spacing: 0.025em;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

/* Estimate output */
.estimate-output {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.08) 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.estimate-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.4rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.estimate-value {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
}

/* Status messages */
.status-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    opacity: 1;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .header {
        margin-bottom: 1.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .calculator-tools {
        gap: 15px;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .button-group {
        flex-direction: column;
        margin-top: 1rem;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .tool-card {
        padding: 1.25rem;
        border-radius: 8px;
    }
    
    .tools-grid {
        gap: 10px;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeIn 0.5s ease-out;
}

.tool-card:nth-child(1) {
    animation-delay: 0.1s;
}

.tool-card:nth-child(2) {
    animation-delay: 0.2s;
}

.tool-card:nth-child(3) {
    animation-delay: 0.3s;
}
