/* Container and Layout */
.area-converter-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.area-converter-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 12px 12px 0 0;
}

/* Header */
.converter-header {
    text-align: center;
    margin-bottom: 30px;
}

.converter-header h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.converter-header p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* Form Layout */
.converter-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* State Selection */
.state-selection {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.state-selection label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Input Section */
.input-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.input-section label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Conversion Row */
.conversion-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: end;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.unit-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unit-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Swap Button */
.swap-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.swap-button {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.swap-button:hover {
    background: #545b62;
    transform: rotate(180deg) scale(1.1);
}

/* Form Inputs */
.value-input,
.unit-dropdown,
.state-dropdown {
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.value-input:focus,
.unit-dropdown:focus,
.state-dropdown:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 4px rgba(0, 124, 186, 0.1);
}

/* Button Section */
.button-section {
    text-align: center;
}

.convert-button {
    background: linear-gradient(135deg, #007cba 0%, #00a0d2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.convert-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #007cba 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.convert-button:active {
    transform: translateY(0);
}

/* Results Section */
.result-section {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.main-result {
    margin-bottom: 25px;
}

.main-result h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.result-display {
    font-size: 28px;
    color: #007cba;
    margin: 15px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 6px solid #007cba;
    font-weight: 700;
}

.result-value {
    color: #007cba;
}

.state-note {
    font-style: italic;
    color: #6c757d;
    font-size: 13px;
    margin-top: 10px;
    display: block;
}

/* Quick Conversions */
.quick-conversions h5,
.conversion-formula h5 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    font-weight: 600;
}

.quick-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.quick-item {
    padding: 12px 16px;
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
}

.quick-item:hover {
    background: linear-gradient(135deg, #007cba 0%, #00a0d2 100%);
    color: white;
    transform: translateY(-2px);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.2);
}

/* Formula Display */
.formula-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.formula-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #e83e8c;
    font-size: 14px;
    background: transparent;
    padding: 0;
    border: none;
}

/* Loading and Error States */
.loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #dc3545;
    font-weight: 600;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .area-converter-container {
        margin: 15px;
        padding: 20px;
    }
    
    .conversion-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .swap-button-container {
        order: -1;
        margin-bottom: 10px;
    }
    
    .converter-header h3 {
        font-size: 24px;
    }
    
    .result-display {
        font-size: 22px;
    }
    
    .quick-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .area-converter-container {
        padding: 15px;
        margin: 10px;
    }
    
    .convert-button {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .result-display {
        font-size: 20px;
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .convert-button, 
    .swap-button {
        display: none;
    }
    
    .area-converter-container {
        box-shadow: none;
        border: 2px solid #000;
        background: white;
    }
    
    .result-section {
        border: 1px solid #000;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .area-converter-container {
        border: 3px solid #000;
    }
    
    .convert-button {
        background: #000;
        border: 2px solid #000;
    }
    
    .result-display {
        border-left: 8px solid #000;
        color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .swap-button:hover {
        transform: none;
    }
}
