:root {
    --primary-gradient: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    --primary-color: #2563EB;
    --secondary-color: #1E40AF;
    --accent-cyan: #0EA5E9;
    --accent-amber: #F59E0B;
    --bg-light: #F8FAFC;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --success: #36D399;
    --warning: #FBBD23;
    --danger: #F87272;
    --info: #0EA5E9;
    --purple-tag: #8B5CF6;
    --card-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    --card-shadow-hover: 0 8px 30px rgba(37, 99, 235, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

html {
    scroll-behavior: smooth;
}

.navbar {
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.05);
}

.nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.1);
}

.hero {
    background: var(--primary-gradient);
    color: white;
    padding-top: 120px;
    padding-bottom: 100px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.hero .display-3 {
    font-weight: 800;
    margin-bottom: 1.5rem;
    animation: slideUp 0.8s ease-out;
}

.hero .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: slideUp 1s ease-out;
}

.hero .btn {
    animation: slideUp 1.2s ease-out;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.hero .btn-light {
    background: white;
    color: var(--primary-color);
}

.hero .btn-light:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
}

.hero .btn-outline-light {
    border-color: white;
}

.hero .btn-outline-light:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

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

.calculator-section {
    background: var(--bg-light);
}

.calculator-section .card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.calculator-section .card:hover {
    box-shadow: var(--card-shadow-hover);
}

.calculator-section .card-body {
    padding: 2rem;
}

.calculator-section h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.calculator-section .form-control:focus,
.calculator-section .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calculator-section .btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.calculator-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
}

.calculator-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--card-shadow);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.result-box {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #E2E8F0;
    transition: all 0.3s ease;
}

.result-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.result-unit {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.ai-input-section {
    background: white;
}

.ai-input-section .card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.ai-input-section .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid #E2E8F0;
    padding: 1rem 1.5rem;
}

.ai-input-section .badge {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.ai-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-light);
}

.ai-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.ai-message.ai-assistant .message-avatar {
    background: var(--primary-gradient);
    color: white;
}

.ai-message.user .message-avatar {
    background: #E2E8F0;
    color: var(--text-dark);
}

.message-content {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 80%;
    line-height: 1.6;
}

.ai-message.user .message-content {
    background: var(--primary-gradient);
    color: white;
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quick-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 2px solid #E2E8F0;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.ai-form {
    display: flex;
    gap: 0.75rem;
}

.ai-form .form-control {
    border: 2px solid #E2E8F0;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.ai-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ai-form .btn-primary {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-form .btn-primary:hover {
    transform: scale(1.1);
}

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

.distance-section,
.converter-section {
    background: var(--bg-light);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.distance-section::before,
.converter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.distance-section::after,
.converter-section::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.distance-tabs,
.converter-tabs {
    background: white;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: var(--card-shadow);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.distance-tabs .nav-link,
.converter-tabs .nav-link {
    color: var(--text-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.distance-tabs .nav-link:hover,
.converter-tabs .nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.distance-tabs .nav-link.active,
.converter-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.distance-content .card,
.converter-content .card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.distance-content .card:hover,
.converter-content .card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.distance-content .card-body,
.converter-content .card-body {
    padding: 2rem;
}

.distance-content .form-label,
.converter-content .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.distance-content .form-control,
.distance-content .form-select,
.converter-content .form-control,
.converter-content .form-select {
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.distance-content .form-control:focus,
.distance-content .form-select:focus,
.converter-content .form-control:focus,
.converter-content .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.converter-content .form-control-lg {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem 1.25rem;
    color: var(--primary-color);
}

.converter-content .bi-arrow-left-right {
    color: var(--primary-color);
    font-size: 2rem;
}

.converter-content .bg-light {
    background: var(--bg-light) !important;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.converter-content .alert-info {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border: 1px solid #93C5FD;
    border-radius: 12px;
    color: #1E40AF;
}

.bulb-comparison-section {
    background: var(--bg-light);
}

.comparison-table {
    border-radius: 12px;
    overflow: hidden;
}

.comparison-table thead th {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.comparison-table tbody tr {
    transition: all 0.3s ease;
}

.comparison-table tbody tr:hover {
    background: #F1F5F9;
    transform: scale(1.01);
}

.comparison-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #E2E8F0;
    vertical-align: middle;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.led-row {
    border-left: 4px solid var(--success);
}

.cfl-row {
    border-left: 4px solid var(--info);
}

.halogen-row {
    border-left: 4px solid var(--warning);
}

.incandescent-row {
    border-left: 4px solid var(--danger);
}

.summary-item {
    transition: all 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-4px);
}

.summary-item i {
    font-size: 2.5rem;
}

.qa-section {
    background: white;
}

.feedback-section {
    background: var(--bg-light);
}

.feedback-section .card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.feedback-section .card:hover {
    box-shadow: var(--card-shadow-hover);
}

.feedback-section .card-body {
    padding: 2rem;
}

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

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

.feedback-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.feedback-section .btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.feedback-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.25);
}

.feedback-section .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.qa-section {
    background: white;
}

.accordion {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.accordion-item {
    border: none;
    border-bottom: 1px solid #E2E8F0;
}

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

.accordion-button {
    background: white;
    color: var(--text-dark);
    font-weight: 600;
    padding: 1.25rem;
    border: none;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background: var(--bg-light);
    color: var(--primary-color);
    box-shadow: none;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232563EB'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 1.25rem;
    color: var(--text-muted);
    background: var(--bg-light);
}

.footer {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer .text-secondary {
    color: #94A3B8 !important;
}

.footer a {
    color: #94A3B8;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: white;
    transform: translateX(4px);
}

.footer hr {
    border-color: #334155;
}

.form-select-sm {
    border-radius: 8px;
}

.progress {
    height: 1.5rem;
    border-radius: 8px;
    background-color: #E2E8F0;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    transition: width 0.6s ease;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 12px;
    max-width: 80px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94A3B8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

.layout-preview {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px dashed #F59E0B;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fixture-point {
    width: 24px;
    height: 24px;
    background: #FBBF24;
    border-radius: 50%;
    display: inline-block;
    margin: 0.5rem;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 25px rgba(251, 191, 36, 1);
    }
}

.uniformity-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.uniformity-bar {
    flex: 1;
    height: 8px;
    background: #E2E8F0;
    border-radius: 4px;
    overflow: hidden;
}

.uniformity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--warning) 50%, var(--danger) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.cost-box {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #E2E8F0;
    transition: all 0.3s ease;
}

.cost-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.cost-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

@media (max-width: 992px) {
    .hero {
        padding-top: 100px;
        padding-bottom: 80px;
    }

    .hero .display-3 {
        font-size: 2.5rem;
    }

    .calculator-section .card-body,
    .distance-content .card-body,
    .converter-content .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .hero {
        padding-top: 80px;
        padding-bottom: 60px;
    }

    .hero .display-3 {
        font-size: 2rem;
    }

    .hero .lead {
        font-size: 1rem;
    }

    .hero .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }

    .result-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .distance-tabs,
    .converter-tabs {
        width: 100%;
        justify-content: center;
    }

    .distance-tabs .nav-link,
    .converter-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .converter-content .form-control-lg {
        font-size: 1.25rem;
        padding: 0.875rem 1rem;
    }

    .quick-questions {
        gap: 0.25rem;
    }

    .quick-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .hero .display-3 {
        font-size: 1.75rem;
    }

    .result-box {
        padding: 1rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .calculator-section .card-body,
    .distance-content .card-body,
    .converter-content .card-body {
        padding: 1rem;
    }

    .ai-messages {
        height: 300px;
        padding: 1rem;
    }

    .message-content {
        padding: 0.75rem 1rem;
        max-width: 90%;
    }
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --primary-color: #3B82F6;
    --secondary-color: #2563EB;
    --bg-light: #1E293B;
    --text-dark: #E2E8F0;
    --text-muted: #94A3B8;
    --card-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
    --card-shadow-hover: 0 8px 30px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .nav-link {
    color: #E2E8F0 !important;
}

[data-theme="dark"] .nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .calculator-section,
[data-theme="dark"] .converter-section,
[data-theme="dark"] .qa-section {
    background: #0f172a;
}

[data-theme="dark"] .calculator-section .card,
[data-theme="dark"] .converter-content .card,
[data-theme="dark"] .qa-section .accordion {
    background: #1E293B;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .calculator-section h5,
[data-theme="dark"] .converter-content h5,
[data-theme="dark"] .qa-section h5 {
    color: var(--primary-color);
}

[data-theme="dark"] .calculator-section .form-label,
[data-theme="dark"] .converter-content .form-label {
    color: #E2E8F0;
}

[data-theme="dark"] .calculator-section .form-control,
[data-theme="dark"] .calculator-section .form-select,
[data-theme="dark"] .converter-content .form-control,
[data-theme="dark"] .converter-content .form-select {
    background: #0F172A;
    border-color: rgba(51, 65, 85, 0.8);
    color: #E2E8F0;
}

[data-theme="dark"] .calculator-section .form-control:focus,
[data-theme="dark"] .calculator-section .form-select:focus,
[data-theme="dark"] .converter-content .form-control:focus,
[data-theme="dark"] .converter-content .form-select:focus {
    background: #1E293B;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .calculator-section .btn-primary,
[data-theme="dark"] .converter-content .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

[data-theme="dark"] .calculator-section .btn-primary:hover,
[data-theme="dark"] .converter-content .btn-primary:hover {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .ai-messages,
[data-theme="dark"] .message-content {
    background: #1e293b;
}

[data-theme="dark"] .quick-btn {
    background: #1E293B;
    border-color: rgba(51, 65, 85, 0.8);
    color: #E2E8F0;
}

[data-theme="dark"] .quick-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] .accordion-button {
    background: #1E293B;
    color: #E2E8F0;
}

[data-theme="dark"] .accordion-body {
    background: #0F172A;
    color: #94A3B8;
}

[data-theme="dark"] .footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

[data-theme="dark"] .typing-indicator {
    background: #1e293b;
}

/* BAC Calculator Specific Styles */
.bac-display {
    background: var(--primary-gradient);
    color: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.25);
}

.bac-value {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    margin: 1rem 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bac-status {
    margin-top: 1rem;
}

.bac-status .badge {
    font-size: 1.25rem;
    padding: 0.75rem 1.5rem;
}

.bac-legal {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.drink-list-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

#drink-list {
    margin-bottom: 0;
}

#drink-list td {
    vertical-align: middle;
}

#drink-list tr.align-middle td {
    vertical-align: middle;
}

#drink-list .col-name {
    min-width: 140px;
    max-width: 200px;
    padding-right: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#drink-list .col-volume {
    width: 120px;
}

#drink-list .col-abv {
    width: 100px;
}

#drink-list .col-action {
    width: 60px;
}

.drink-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drink-input {
    width: 85px;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    text-align: right;
}

#drink-list .col-volume .drink-input {
    width: 80px;
}

#drink-list .col-abv .drink-input {
    width: 80px;
}

.input-unit {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 30px;
}

.drink-delete-btn {
    padding: 0.35rem 0.6rem;
    transition: all 0.2s ease;
}

.drink-delete-btn:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

[data-theme="dark"] .drink-input {
    background-color: #1E293B;
    border-color: rgba(51, 65, 85, 0.8);
    color: #F8FAFC;
}

[data-theme="dark"] .drink-input:focus {
    background-color: #1E293B;
    border-color: var(--primary-color);
    color: #F8FAFC;
}

[data-theme="dark"] .input-unit {
    color: #94a3b8;
}

.region-selector {
    min-width: 200px;
}

.calculator-tabs {
    flex-wrap: wrap;
}

.calculator-tabs .nav-link {
    margin-bottom: 0;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

.calculator-tabs .nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.calculator-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .drink-list-container {
    background: #1E293B;
    border-color: rgba(51, 65, 85, 0.5);
}

.time-to-zero-result .display-4,
.reverse-result .display-4 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.converter-content .alert-info {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border: 1px solid #93C5FD;
    border-radius: 12px;
    color: #1E40AF;
}

[data-theme="dark"] .converter-content .alert-info {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #3b82f6;
    color: #e2e8f0;
}

.qa-section .accordion-button {
    width: 100%;
    text-align: left;
}

.qa-section .accordion-button::after {
    margin-left: auto;
}

.qa-section .accordion-body {
    line-height: 1.8;
}

/* Education Section Styles */
.education-section {
    background: white;
}

.formula-tabs {
    background: white;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: var(--card-shadow);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
}

.formula-tabs .nav-link {
    color: var(--text-dark);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.formula-tabs .nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.formula-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.formula-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.formula-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.formula-card .card-header {
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem 1.5rem;
    border: none;
}

.formula-card .card-body {
    padding: 2rem;
}

.formula-expression {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--primary-color);
    overflow-x: auto;
}

.formula-expression code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    color: var(--primary-color);
    word-break: break-all;
}

.formula-section {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: 12px;
    border: 2px solid #E2E8F0;
    transition: all 0.3s ease;
}

.formula-section:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.formula-section h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.formula-section ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.formula-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.formula-section code {
    display: block;
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin: 0.5rem 0;
    word-break: break-all;
}

.formula-section.pros {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.formula-section.pros h5 {
    color: var(--success);
}

.formula-section.cons {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.formula-section.cons h5 {
    color: var(--warning);
}

.formula-section.use-cases {
    border-color: rgba(79, 70, 229, 0.3);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.1) 100%);
}

.formula-section.use-cases h5 {
    color: var(--primary-color);
}

.education-section .card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.education-section .card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.education-section .card h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.education-section .card .display-5 {
    color: var(--primary-color);
    opacity: 0.7;
}

.education-section .table {
    margin-bottom: 0;
}

.education-section .badge {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Dark Mode for Education Section */
[data-theme="dark"] .education-section {
    background: #0f172a;
}

[data-theme="dark"] .formula-tabs {
    background: #1E293B;
    border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .formula-tabs .nav-link {
    color: #E2E8F0;
}

[data-theme="dark"] .formula-tabs .nav-link:hover {
    background: rgba(51, 65, 85, 0.5);
    color: var(--primary-color);
}

[data-theme="dark"] .calculator-tabs .nav-link {
    color: #E2E8F0;
}

[data-theme="dark"] .calculator-tabs .nav-link:hover {
    background: rgba(51, 65, 85, 0.5);
    color: var(--primary-color);
}

[data-theme="dark"] .calculator-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .formula-card {
    background: #1E293B;
    border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .formula-expression {
    background: #0F172A;
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .formula-expression code {
    color: var(--primary-color);
}

[data-theme="dark"] .formula-section {
    background: #0F172A;
    border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .formula-section:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] .formula-section h5 {
    color: #E2E8F0;
}

[data-theme="dark"] .formula-section li {
    color: #94A3B8;
}

[data-theme="dark"] .formula-section code {
    background: #1E293B;
    color: var(--primary-color);
}

[data-theme="dark"] .formula-section.pros {
    border-color: rgba(52, 211, 153, 0.3);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08) 0%, rgba(52, 211, 153, 0.12) 100%);
}

[data-theme="dark"] .formula-section.cons {
    border-color: rgba(251, 189, 35, 0.3);
    background: linear-gradient(135deg, rgba(251, 189, 35, 0.08) 0%, rgba(251, 189, 35, 0.12) 100%);
}

[data-theme="dark"] .formula-section.use-cases {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.12) 100%);
}

[data-theme="dark"] .education-section .card {
    background: #1E293B;
    border-color: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .education-section .card h5 {
    color: var(--primary-color);
}

[data-theme="dark"] .education-section .card .display-5 {
    color: var(--primary-color);
    opacity: 0.7;
}

/* Responsive Styles for Formula Tabs */
@media (max-width: 768px) {
    .formula-tabs {
        width: 100%;
        justify-content: center;
    }

    .formula-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        flex: 1 1 auto;
        justify-content: center;
    }

    .formula-tabs .nav-link i {
        display: none;
    }

    .formula-card .card-body {
        padding: 1.5rem 1rem;
    }

    .formula-expression {
        padding: 1rem;
    }

    .formula-expression code {
        font-size: 0.9rem;
    }

    .formula-section {
        padding: 1rem;
    }

    .formula-section h5 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .formula-tabs .nav-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}
