/* CSS Variables for Color Palette */
:root {
    --primary-color: #00ADB5;
    --secondary-color: #393E46;
    --dark-color: #222831;
    --light-color: #EEEEEE;
    --accent-color: #FFD369;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --primary-color: #00ADB5;
    --secondary-color: #393E46;
    --dark-color: #222831;
    --light-color: #EEEEEE;
    --accent-color: #FFD369;
    --text-dark: #EEEEEE;
    --text-light: #adb5bd;
    --border-color: #495057;
}

/* Typography-Driven Design */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
   
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-color);
    transition: all 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.5;
}

/* Custom Bootstrap Overrides */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Subtle pulse to draw attention (used after desbloquear comparação) */
.btn-pulse {
    animation: pulseGlow 1s ease-in-out 3;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #008a91;
    border-color: #008a91;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-warning {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--dark-color);
}

.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: none;
    padding: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 173, 181, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Header Styles */
.navbar {
    background-color: var(--primary-color) !important;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    gap: 0.5rem;
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    background-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 576px) {
    .brand-logo {
        width: 32px;
        height: 32px;
    }
}

.navbar-brand:hover .brand-logo {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .brand-logo {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.hero-section .display-4 {
    color: white;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Simulator Section */
.simulator-section .card-header {
    background-color: var(--primary-color) !important;
}

/* Color-coded card headers */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-success {
    background-color: #28a745 !important;
}

.bg-warning {
    background-color: var(--accent-color) !important;
    color: var(--dark-color) !important;
}

.bg-info {
    background-color: #17a2b8 !important;
}

 

/* Saved Simulations */
.simulation-card {
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.simulation-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.simulation-meta {
    font-size: 0.9rem;
    color: var(--text-light);
}

.cost-highlight {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Improve saved simulations readability */
.simulation-card h6 {
    font-weight: 600;
    color: var(--text-dark);
}

.simulation-card small,
.simulation-card .text-muted {
    color: #6c757d !important;
}

/* Dark mode adjustments for simulation cards */
[data-bs-theme="dark"] .simulation-card {
    background-color: var(--secondary-color);
    border-color: #495057;
    color: var(--light-color);
}

[data-bs-theme="dark"] .simulation-card h6 {
    color: var(--light-color);
}

[data-bs-theme="dark"] .simulation-card .text-muted,
[data-bs-theme="dark"] .simulation-card small {
    color: #ced4da !important;
}

[data-bs-theme="dark"] .cost-highlight {
    color: #7ee5eb;
}

/* Comparison Table */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(0, 173, 181, 0.12);
}

footer.bg-dark {
    background: linear-gradient(180deg, #1e1e1e 0%, #111 100%) !important;
}

footer .text-light {
    color: #e9ecef !important;
}

footer small {
    opacity: 0.9;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 173, 181, 0.05);
}

/* Offcanvas Customization */
.offcanvas {
    border: none;
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    top: 10vh;
}

.offcanvas-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
}

.offcanvas-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.offcanvas-body {
    padding: 0.75rem;
    max-height: 80vh;
    overflow-y: auto;
}

/* Ensure offcanvas is above ads */
#sideMenu {
    z-index: 1055;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.list-group-item:hover {
    background-color: rgba(0, 173, 181, 0.1);
    transform: translateX(5px);
}

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.list-group-item small {
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Compact buttons in offcanvas */
.offcanvas .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Modal Customization */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: none;
    border-radius: 1rem 1rem 0 0;
}

.modal-footer {
    border-top: none;
    border-radius: 0 0 1rem 1rem;
}

/* Result Modal Specific Styling */
#resultModal .modal-dialog {
    max-height: 75vh;
    margin: 1rem auto;
}

#resultModal .modal-content {
    max-height: 75vh;
    display: flex;
    flex-direction: column;
}

#resultModal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

#resultModal .modal-footer {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Ensure modal is above ads */
#resultModal {
    z-index: 1060;
}

/* Compact breakdown items */
.cost-breakdown .breakdown-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cost-breakdown .breakdown-item:last-child {
    border-bottom: none;
}

/* Compact alert */
.alert.py-2 {
    padding: 0.5rem 0.75rem !important;
    margin-bottom: 0;
}

/* Share button states */
#shareResult:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#shareResult:disabled .bi-hourglass-split {
    animation: spin 1s linear infinite;
}

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

/* Result Display */
.result-summary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.25rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.result-summary h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.result-summary .total-cost {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.total-cost {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cost-breakdown {
    background-color: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.breakdown-label {
    flex: 1;
}

.breakdown-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Tips and FAQ */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);

}

.accordion-item {
    border: none;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.accordion-button {
    background-color: #f8f9fa;
    border: none;
    font-weight: 500;
    padding: 1.25rem;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
}

.accordion-body {
    padding: 1.5rem;
    background-color: white;
}

/* Dark Mode Styles */
[data-bs-theme="dark"] body {
    background-color: var(--dark-color);
    color: var(--light-color);
}

[data-bs-theme="dark"] .card {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--dark-color);
    border-color: #495057;
    color: var(--light-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--dark-color);
    border-color: var(--primary-color);
    color: var(--light-color);
}

[data-bs-theme="dark"] .table {
    color: var(--light-color);
}

[data-bs-theme="dark"] .table td {
    border-color: #495057;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: var(--secondary-color);
    color: var(--light-color);
    border-color: #495057;
}

[data-bs-theme="dark"] .accordion-button {
    background-color: var(--secondary-color);
    color: var(--light-color);
}

[data-bs-theme="dark"] .accordion-body {
    background-color: var(--dark-color);
    color: var(--light-color);
}

[data-bs-theme="dark"] .cost-breakdown {
    background-color: var(--dark-color);
}

/* Form Switch (Dark Mode Toggle) */
.form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    .total-cost {
        font-size: 2rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-section .display-4 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

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

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

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none;
    }
}

/* 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 Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--text-dark);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

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