/* ========================================
   Modern Naseh UI Framework
   Professional, Premium, Government Identity
   ======================================== */

:root {
    --primary: #006C35;
    --primary-hover: #00562a;
    --primary-light: #e6f3ec;
    --secondary: #D4AF37;
    --secondary-hover: #b8962d;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --font-primary: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --transition-base: 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* === BASE STYLES === */
/* === BASE STYLES & SCROLLING === */
body {
    font-family: var(--font-primary);
    background-color: white;
    color: var(--gray-700);
    line-height: 1.6;
    min-height: 100vh;
    overflow-y: auto !important;
    /* Force body scroll */
    margin: 0;
    display: block;
    /* Remove flex body to allow natural scroll */
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    transition: all var(--transition-base);
    text-decoration: none;
}

.brand-logo {
    height: 50px;
    margin-left: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* === CHAT WORKSPACE (BODY SCROLL) === */
.gpt-workspace {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: #f0fdf4;
    padding-right: 280px;
    /* Space for Fixed Sidebar */
    transition: padding-right 0.3s ease;
}

/* Sidebar Open/Close Logic (Applied via JS class on parent) */
.chat-layout-container.sidebar-closed .gpt-workspace {
    padding-right: 0;
}

/* Background Decoration */
.gpt-workspace::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(0, 108, 53, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Faint Background Logo in Chat Mode */
.gpt-workspace.is-chat::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background-image: url('/images/BOG_Logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
    position: fixed;
    /* Fix logo so it doesn't scroll away */
}

/* Scroll Area is now just a flow container */
.gpt-scroll-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 0 160px 0;
    /* Bottom padding for fixed input */
    width: 100%;
    overflow: visible;
    /* Ensure content flows in body */
}

/* Centered Immersive Column */
.gpt-message-container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .gpt-message-container {
        padding: 0 0.4rem;
        max-width: 100%;
    }
}

/* Centered Hero State */
.gpt-workspace.is-hero .gpt-scroll-area {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Flow from top */
    padding-top: 10vh;
    /* Push slightly higher */
}

.gpt-workspace.is-hero .gpt-hero {
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeIn 0.8s ease;
}

.gpt-workspace.is-hero .gpt-hero img {
    height: 140px;
    /* Slightly larger as requested */
    margin-bottom: 1rem;
}

/* ChatGPT Thin Scrollbar */
.gpt-scroll-area::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.gpt-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.gpt-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    /* Slightly more visible for 'glued' feel */
    border-radius: 0;
    /* Squared for edge-to-edge feel */
}

/* Messages Layout - Edge to Edge in the container */
.gpt-message {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    /* Force span full container width */
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 1.25rem;
}

/* User Message - Right side in RTL */
.gpt-message-user {
    flex-direction: row;
    /* Avatar(R) Bubble(L) */
}

/* AI Message - Left side in RTL */
.gpt-message-ai {
    flex-direction: row-reverse;
    /* Avatar(L) Bubble(R) */
}

/* Bubbles */
.gpt-bubble {
    padding: 1.1rem 1.75rem;
    font-size: 1.1rem;
    line-height: 1.7;
    position: relative;
    border-radius: 1.6rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* User Bubble - Right side with specific cornering */
.gpt-message-user .gpt-bubble {
    background-color: var(--primary);
    color: white;
    border-radius: 1.5rem 0.25rem 1.5rem 1.5rem;
    /* Distinctive corner for user on right */
    box-shadow: 0 4px 0px var(--secondary);
}

/* AI Bubble - Left side with Green Accent Bar on the LEFT */
.gpt-message-ai .gpt-bubble {
    background-color: white;
    color: var(--gray-800);
    border: 1px solid #edf2f7;
    border-left: 6px solid #48bb78;
    /* Accent on LEFT side of bubble */
    border-radius: 0.25rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* Avatars - Dark Circles */
.gpt-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #2d3436;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
}

.gpt-avatar-user {
    color: white;
}

.gpt-avatar-ai {
    color: #48bb78;
}

/* Input Wrapper - Fixed at Bottom */
.gpt-input-wrapper {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem;
    z-index: 100;
}

.gpt-workspace.is-hero .gpt-input-wrapper {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.gpt-workspace.is-chat .gpt-input-wrapper {
    position: fixed;
    /* Fixed to viewport bottom */
    bottom: 0;
    left: 0;
    right: 280px;
    /* Offset for sidebar */
    margin-right: auto;
    /* Push to center of remaining space */
    background: linear-gradient(to top, #f0fdf4 80%, transparent);
    transition: right 0.3s ease;
}

.chat-layout-container.sidebar-closed .gpt-workspace.is-chat .gpt-input-wrapper {
    right: 0;
}

.gpt-input-box {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1.5rem;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 108, 53, 0.05);
}

.gpt-input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(0, 108, 53, 0.1);
}

.gpt-input-box textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    resize: none;
    max-height: 15rem;
    font-size: 1.1rem;
    outline: none;
    color: var(--gray-900);
    line-height: 1.5;
}

.gpt-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-500);
    transition: all 0.2s;
}

.gpt-action-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.gpt-send-btn {
    background-color: var(--gray-900);
    color: white;
}

.gpt-send-btn:hover {
    background-color: var(--primary);
    color: white;
}

/* === SIDEBAR PREMIUM === */
.chat-app-wrapper {
    display: flex;
    height: 100vh;
}

.chat-sidebar {
    width: 280px;
    /* Fixed width */
    background-color: #f7fafc;
    border-left: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    position: fixed;
    /* Fix to viewport */
    top: 0;
    bottom: 0;
    right: 0;
    /* Align to right (RTL) */
}

.chat-layout-container.sidebar-closed .chat-sidebar {
    transform: translateX(100%);
    /* Slide out completely to the right */
    box-shadow: none;
}

.sidebar-new-chat {
    margin: 1rem;
    padding: 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--gray-800);
}

.history-group-label {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: #a0aec0;
    text-transform: uppercase;
}

.history-item {
    padding: 0.6rem 1.25rem;
    margin: 0.1rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    color: #4a5568;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.history-item:hover {
    background-color: #edf2f7;
}

.history-item.active {
    background-color: #e2e8f0;
    font-weight: 600;
    color: var(--primary);
}

/* === VOICE POPUP === */
.voice-permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.voice-permission-card {
    background: white;
    width: 90%;
    max-width: 450px;
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary-light);
}

.voice-permission-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary), #48bb78);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem auto;
    font-size: 2.5rem;
    box-shadow: 0 10px 20px rgba(0, 108, 53, 0.2);
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.voice-permission-btn {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    border: none;
    width: 100%;
    margin-top: 2rem;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.2s;
}

/* === LANDING PAGE === */
.landing-hero {
    padding: 120px 0 80px 0;
    text-align: center;
    background: radial-gradient(circle at top, var(--primary-light) 0%, white 70%);
}

.hero-logo {
    height: 160px;
    filter: drop-shadow(0 4px 20px rgba(0, 108, 53, 0.15));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.service-card {
    background: white;
    border-radius: 2rem;
    padding: 40px;
    border: 1px solid var(--gray-100);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.06);
    border-color: var(--primary-light);
}

.featured-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--secondary);
    /* Golden color */
    color: white;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    /* Square with slight rounded corners */
    z-index: 10;
}

/* Ensure all AI accents are Green */
.gpt-message-ai .gpt-bubble {
    border-right: 6px solid #48bb78;
    /* Always green accent bar */
}

.gpt-avatar-ai {
    color: #48bb78;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==================== MODERN NAVBAR ====================*/
.navbar-modern {
    background: white;
    box-shadow: 0 2px 20px rgba(0, 108, 53, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-modern .navbar {
    padding: 0.5rem 0;
}

.navbar-brand-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand-modern:hover {
    transform: translateY(-2px);
}

.brand-logo-modern {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 108, 53, 0.15));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.brand-tagline {
    font-size: 0.75rem;
    color: #7a8d7a;
    font-weight: 500;
}

.navbar-toggler-modern {
    border: none;
    background: transparent;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 991px) {
    .navbar-toggler-modern {
        display: block; /* Show only on mobile */
    }
}

.navbar-toggler-modern span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    position: absolute;
}

.navbar-toggler-modern span:nth-child(1) {
    top: 0;
}

.navbar-toggler-modern span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.navbar-toggler-modern span:nth-child(3) {
    bottom: 0;
}

.navbar-nav-modern {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-item-modern {
    list-style: none;
}

.nav-link-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: #4a5d4a;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link-modern::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link-modern:hover {
    color: var(--primary);
    background: rgba(0, 108, 53, 0.05);
}

.nav-link-modern:hover::before {
    width: 80%;
}

.nav-link-modern i {
    font-size: 1.1rem;
}

/* Dropdown Styles */
.nav-item-modern.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.dropdown-menu-modern {
    background: white;
    border: 1px solid #e8f5ee;
    border-radius: 15px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 108, 53, 0.15);
    margin-top: 0.5rem;
    min-width: 250px;
}

/* Show dropdown on hover (desktop only) */
@media (min-width: 992px) {
    .nav-item-modern.dropdown:hover .dropdown-menu-modern {
        display: block;
    }
}

.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #1a2e1a;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.dropdown-item-modern i {
    font-size: 1.1rem;
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.dropdown-item-modern:hover {
    background: rgba(0, 108, 53, 0.08);
    color: var(--primary);
    transform: translateX(-5px);
}

/* ==================== MODERN FOOTER ==================== */
.footer-modern {
    background: linear-gradient(135deg, #1a2e1a 0%, #0d1f13 100%);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
}

.footer-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-brand {
    margin-bottom: 2rem;
}

.footer-logo-img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    margin-bottom: 1rem;
}

.footer-brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.footer-brand-desc {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    font-size: 0.95rem;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary);
    border-radius: 3px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
    transform: translateX(-5px);
}

.footer-links a i {
    font-size: 0.75rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 108, 53, 0.3);
}

.footer-bottom {
    margin-top: 3rem;
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.footer-copyright {
    text-align: center;
}

.footer-copyright p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* OLD FOOTER - Keep for backward compatibility */
.footer {
    background: #1a1a1a;
    color: white;
    padding: 3rem 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    /* Navbar Mobile */
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 15px;
        margin-top: 1rem;
        box-shadow: 0 10px 30px rgba(0, 108, 53, 0.1);
    }

    .navbar-nav-modern {
        margin-top: 0;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .nav-item-modern {
        width: 100%;
    }

    .nav-link-modern {
        width: 100%;
        padding: 1rem;
    }

    /* Dropdown Mobile */
    .dropdown-menu-modern {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
        margin-top: 0.5rem;
    }

    .dropdown-item-modern {
        padding: 0.75rem 1.5rem;
        margin-bottom: 0.25rem;
    }

    .footer-modern {
        padding: 3rem 0 1.5rem;
    }
}