/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #F6DFEB 0%, #E4C1F9 25%, #D0F4DE 50%, #FCF6BD 75%, #FFB7C5 100%);
    min-height: 100vh;
}

/* Custom Navbar */
.custom-navbar {
    background: linear-gradient(135deg, #E4C1F9, #F6DFEB);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.navbar-brand:hover {
    color: #f8f9fa !important;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Calculator Card */
.calculator-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.calculator-card .card-header {
    background: linear-gradient(135deg, #E4C1F9, #D0F4DE);
    border-bottom: none;
    padding: 2rem;
    color: #333;
}

.calculator-card .card-body {
    padding: 2.5rem;
}

/* Form Styling */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #E4C1F9;
    box-shadow: 0 0 0 0.2rem rgba(228, 193, 249, 0.25);
    transform: translateY(-1px);
}

.input-group-text {
    background: linear-gradient(135deg, #F6DFEB, #E4C1F9);
    border: 2px solid #e9ecef;
    border-right: none;
    font-weight: 600;
    color: #495057;
}

/* Simulation Toggle */
.simulation-toggle {
    background: linear-gradient(135deg, #D0F4DE, #FCF6BD);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #E4C1F9, #F6DFEB);
    color: #333;
    box-shadow: 0 4px 15px rgba(228, 193, 249, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #F6DFEB, #E4C1F9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(228, 193, 249, 0.6);
    color: #333;
}

.btn-success {
    background: linear-gradient(135deg, #D0F4DE, #FCF6BD);
    color: #333;
    box-shadow: 0 4px 15px rgba(208, 244, 222, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #FCF6BD, #D0F4DE);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(208, 244, 222, 0.6);
    color: #333;
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: #fff;
    transform: translateY(-1px);
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #FCF6BD, #FFB7C5);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header h4 {
    color: #333;
    font-weight: 700;
}

.result-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #E4C1F9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.result-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

/* Alert Styling */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alert-danger {
    background: linear-gradient(135deg, #FFB7C5, #F6DFEB);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #FCF6BD, #FFB7C5);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #D0F4DE, #E4C1F9);
    color: #0c5460;
}

/* FAQ Section */
.faq-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.accordion-button {
    background: linear-gradient(135deg, #F6DFEB, #E4C1F9);
    border: none;
    font-weight: 600;
    color: #333;
    padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #E4C1F9, #D0F4DE);
    color: #333;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-body {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    line-height: 1.6;
}

/* Modal Styling */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    background: linear-gradient(135deg, #E4C1F9, #F6DFEB);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 2rem;
}

.modal-title {
    font-weight: 700;
    color: #333;
}

.modal-body {
    padding: 2rem;
    line-height: 1.6;
}

.modal-footer {
    border-top: none;
    padding: 1rem 2rem 1.5rem;
}

/* Offcanvas Styling */
.offcanvas {
    background: linear-gradient(180deg, #F6DFEB, #E4C1F9);
    border: none;
}

.offcanvas-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.offcanvas-title {
    font-weight: 700;
    color: #333;
}

.offcanvas-body {
    padding: 1.5rem;
}

/* History Items */
.history-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
}

.history-date {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
}

.history-values {
    margin-top: 0.5rem;
}

.history-value {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

.history-actions {
    margin-top: 0.75rem;
    text-align: right;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Ad Banner */
.ad-banner {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #E4C1F9, #F6DFEB);
    padding: 2rem 0;
    margin-top: auto;
}

.footer p {
    color: #333;
    margin-bottom: 0;
}

.footer a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: #495057;
    text-decoration: underline;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-card .card-header {
        padding: 1.5rem;
    }
    
    .calculator-card .card-body {
        padding: 1.5rem;
    }
    
    .results-section {
        padding: 1.5rem;
    }
    
    .faq-section {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .calculator-card .card-header {
        padding: 1rem;
    }
    
    .calculator-card .card-body {
        padding: 1rem;
    }
    
    .simulation-toggle {
        padding: 1rem;
    }
    
    .results-section {
        padding: 1rem;
    }
    
    .faq-section {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
}

/* Form Validation */
.was-validated .form-control:valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 2.94 2.94-2.94 2.94-.94-.94L4.23 8.77z'/%3e%3c/svg%3e");
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.2.4.8.4-.8M6 8.5v.5'/%3e%3c/svg%3e");
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #E4C1F9;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .calculator-card {
        border: 2px solid #000;
    }
    
    .form-control {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .ad-banner,
    .btn {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .calculator-card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}
