/* Design Tokens */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #ffffff;
    --bg-secondary: #f1f5f9; /* Increased contrast from #f9fafb */
    --text-primary: #0f172a; /* Darker navy */
    --text-secondary: #334155; /* Darker slate */
    --border-color: #cbd5e1; /* More defined border */
    --chat-bg: #e2e8f0;
    --radius: 12px;
}

/* Base Styles */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Navbar Styles */
.navbar {
    position: sticky;
    top: 1rem;
    z-index: 1030;
    width: min(1120px, calc(100% - 2rem));
    margin: 1rem auto 0;
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 999px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.navbar .container {
    gap: 1rem;
}

.navbar-collapse {
    flex-grow: 0;
}

.navbar-toggler {
    border-radius: 999px;
}

.navbar-brand {
    font-weight: 800; /* Extra bold */
    font-size: 1.35rem;
    color: var(--primary) !important; /* Primary color for brand */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .navbar {
        width: calc(100% - 1rem);
        padding: 0.85rem 1rem;
        border-radius: 28px;
    }

    .navbar-collapse {
        margin-top: 0.75rem;
        width: 100%;
    }

    .navbar-nav {
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Hero & Header Sections */
.hero-section, .header-section {
    background-color: var(--bg-secondary);
    padding: 6rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.header-section {
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-title, .main-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

.main-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.hero-subtitle, .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    font-size: 1.125rem;
    margin-bottom: 0;
}

.hero-btn {
    background: var(--primary);
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    color: white;
    text-decoration: none;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Card Styles */
.feature-card {
    background: var(--bg-main);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
    height: 100%;
    padding: 2.5rem;
    text-align: center;
}

.faq-card .feature-card {
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feature-card:hover {
    border-color: var(--primary);
    background: #f8fafc; /* Subtle background change on hover */
}

.card-header {
    background: var(--bg-secondary); /* Contrast header */
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Feature Specifics (Index) */
.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.625;
    font-size: 1rem;
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: var(--bg-main);
}

.about-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.about-icon-wrapper {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

/* FAQ Styles */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

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

.faq-item:hover {
    background: var(--bg-secondary);
}

.faq-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 1.25rem 1.5rem;
    display: block;
}

.faq-link strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.faq-link small {
    color: var(--text-secondary);
}

.faq-link:hover {
    color: var(--primary);
}

/* Chat Styles */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1.5rem;
}

.message {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.message-bubble {
    max-width: 85%;
    padding: 0.875rem 1.125rem;
    border-radius: 14px;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.user-message {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background: var(--chat-bg);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

.chat-input {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.send-btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    background: var(--primary);
    border: none;
    color: white;
}

.send-btn:hover {
    background: var(--primary-hover);
}

.clear-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fecaca;
}

/* PDF Upload Styles */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: var(--bg-secondary);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* Results Styles */
.alert-light {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 1rem;
}

/* Footer */
.footer {
    background: #0f172a; /* Dark footer for strong contrast */
    padding: 3rem 0;
    margin-top: auto;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.75rem;
    }
    .hero-section {
        padding: 4rem 0;
    }
    .main-title { font-size: 2rem; }
    .chat-container { height: 400px; }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
