/* Dashboard Styles - Perplexity-inspired Merge */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fbf8;
    min-height: 100vh;
    color: #0f2929;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

body.chat-fullscreen {
    overflow: hidden;
}

/* Enable text selection where needed */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

/* Prevent input zoom on iOS */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-size: 16px !important;
}

button {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    cursor: pointer;
    /* Minimum touch target size (44px x 44px) */
    min-height: 44px;
    min-width: 44px;
}

/* CSS Variables */
:root {
    --light-bg: #f8f9fa;
    --gray-gradient: linear-gradient(to right, #f8f9fa, #e9ecef);
    --accent: #00bcd4;
    --primary: #00bcd4;
}

/* Login Gate Styles */
.login-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.login-modal {
    background: linear-gradient(145deg, #2d3748, #1a202c);
    padding: 2rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

.login-modal h2 {
    margin-bottom: 1rem;
    color: #4fd1c7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.login-modal p {
    margin-bottom: 2rem;
    color: #cbd5e0;
    font-size: 1.1rem;
}

.modal-input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #4a5568;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-input:focus {
    outline: none;
    border-color: #4fd1c7;
    background: rgba(255, 255, 255, 0.15);
}

.modal-input::placeholder {
    color: #a0aec0;
}

.modal-login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4fd1c7, #36b9cc);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 209, 199, 0.3);
}

.error-message {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(220, 38, 38, 0.3);
    display: none;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Top Navigation */
.top-nav {
    background: #fff;
    border-bottom: 1px solid rgba(15, 41, 41, 0.04);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(15, 41, 41, 0.04);
}

.nav-left .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #163c3c;
}

.nav-left .logo i {
    font-size: 2rem;
    color: #163c3c;
}

.top-menu {
    display: flex;
    gap: 0.75rem;
}

.top-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: #5f6f6f;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.top-menu-btn span {
    display: inline;
    font-size: 0.9rem;
    color: #5f6f6f;
}

.top-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Lamb Animation */
.lamb-animation-container {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.lamb-icon {
    font-size: 2rem;
    color: #ffd700;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: lambBounce 2s infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.lamb-icon:hover {
    transform: scale(1.2);
    animation: lambExcited 0.5s ease-in-out;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

@keyframes lambBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes lambExcited {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1.2); }
}

/* Login Section */
.login-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.login-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-input {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    width: 100px;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #4fd1c7, #36b9cc);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 209, 199, 0.3);
}

.user-info {
    display: none;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #228b88;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #163c3c;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Main Content Layout */
.main-content {
    display: flex;
    min-height: calc(100vh - 80px);
    position: relative;
    margin-left: 90px;
}

/* Sidebar */
.sidebar {
    width: 90px;
    background: #f1f5f3;
    border-right: 1px solid rgba(15, 41, 41, 0.03);
    padding: 8px 6px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    overflow-y: auto;
    box-shadow: none;
    z-index: 100;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
}

.sidebar-header {
    padding: 0;
    border-bottom: none;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #163c3c;
    margin-bottom: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-subtitle {
    display: block;
    font-size: 0.6rem;
    color: #2d3e3e;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
    max-width: 75px;
    padding: 2px 0;
}

.sidebar-toggle {
    display: none;
}

.nav-menu {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 4px 0;
    width: 70px;
    height: auto;
    min-height: 60px;
    color: #0f2929;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    background: transparent;
    border: none;
    font-size: 1.1rem;
}

.nav-item span {
    display: block;
    font-size: 0.65rem;
    color: #2d3e3e;
    font-weight: 600;
    text-align: center;
    line-height: 1;
    word-break: break-word;
    max-width: 65px;
}

.nav-item:hover {
    background: rgba(15, 41, 41, 0.06);
    color: #163c3c;
    transform: none;
}

.nav-item.active {
    background: rgba(34, 139, 136, 0.1);
    color: #228b88;
    box-shadow: none;
}

.nav-item i {
    width: 24px;
    font-size: 1.2rem;
    display: inline-block;
    flex-shrink: 0;
}

/* Middle Content */
.middle-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fbf8;
    width: 100%;
}

.dashboard-panel {
    flex: 1;
    padding: 20px 20px 20px 0;
    overflow-y: auto;
    background: #f8fbf8;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    position: relative;
}

.dashboard-panel.chat-active {
    padding: 0;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* Welcome Screen */
.welcome-screen {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex: 0;
}

.welcome-screen.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.welcome-screen h1 {
    font-size: 72px;
    margin-bottom: 0;
    color: #163c3c;
    font-weight: 700;
    letter-spacing: -2px;
    text-align: center;
    font-family: "Avenir Next", "Inter", Arial, sans-serif;
}

.welcome-screen > p {
    font-size: 1.1rem;
    margin-bottom: 0;
    color: #5f6f6f;
    text-align: center;
    line-height: 1.6;
}

/* Integrated Chat Panel */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: linear-gradient(145deg, rgba(45, 55, 72, 0.8), rgba(26, 32, 44, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 209, 199, 0.1), transparent);
    transition: left 0.5s ease;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(79, 209, 199, 0.2);
    border-color: rgba(79, 209, 199, 0.3);
}

.feature-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #4fd1c7, #36b9cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.feature-card p {
    color: #a0aec0;
    line-height: 1.6;
}

/* Integrated Chat Panel */
.integrated-chat-panel {
    background: #fff;
    border: 1px solid rgba(15, 41, 41, 0.04);
    border-radius: 16px;
    padding: 0;
    width: calc(100% - 40px);
    margin: 0 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    flex: 1;
    max-height: 600px;
}

.integrated-chat-panel.active {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    max-height: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
}

.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15, 41, 41, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.chat-header i {
    color: #228b88;
    font-size: 1.2rem;
}

.chat-header h3 {
    color: #163c3c;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-messages {
    height: auto;
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.message {
    max-width: 100%;
    animation: messageSlideIn 0.3s ease-out;
    width: 100%;
}

.message.user {
    align-self: flex-end;
    padding-right: 0;
}

.message.assistant {
    align-self: flex-start;
    padding-left: 0;
}

.message-content {
    padding: 8px 12px;
    border-radius: 12px;
    line-height: 1.4;
    word-wrap: break-word;
    background: #f5f7fa;
    color: #163c3c;
}

.message.user .message-content {
    background: #228b88;
    color: white;
    border-bottom-right-radius: 2px;
}

.message.assistant .message-content {
    background: #f5f7fa;
    color: #2d3e3e;
    border: none;
    border-bottom-left-radius: 2px;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid rgba(15, 41, 41, 0.04);
    background: transparent;
    margin-bottom: 0;
    flex-shrink: 0;
    margin-top: auto;
}

/* Quick Action Buttons */
.chat-quick-actions {
    display: flex;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    background: rgba(79, 209, 199, 0.08);
    border-top: 1px solid rgba(79, 209, 199, 0.2);
    flex-wrap: wrap;
    justify-content: center;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: linear-gradient(135deg, rgba(79, 209, 199, 0.2), rgba(79, 209, 199, 0.15));
    color: #4fd1c7;
    border: 1px solid #4fd1c7;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, rgba(79, 209, 199, 0.4), rgba(79, 209, 199, 0.3));
    box-shadow: 0 4px 15px rgba(79, 209, 199, 0.3);
    transform: translateY(-2px);
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-btn i {
    font-size: 1.1rem;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    position: relative;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(15, 41, 41, 0.06);
    border-radius: 12px;
    background: #fafcfb;
    color: #163c3c;
    font-size: 1rem;
    resize: none;
    min-height: 42px;
    max-height: 100px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.chat-input:hover {
    border-color: rgba(15, 41, 41, 0.12);
    background: #fff;
}

.chat-input:focus {
    outline: none;
    border-color: #228b88;
    background: #fff;
    box-shadow: 0 0 20px rgba(34, 139, 136, 0.1);
}

.chat-input::placeholder {
    color: #8aa09f;
}

.send-btn {
    padding: 8px;
    background: #1f7d7b;
    color: white;
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(79, 209, 199, 0.2);
}

.send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 209, 199, 0.4);
}

.send-btn:active {
    transform: translateY(0) scale(0.98);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 209, 199, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced Chat Styles */
.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #4fd1c7, #36b9cc);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0.25rem 0.25rem 0.25rem 0;
    white-space: nowrap;
}

.chat-action-btn:hover {
    background: linear-gradient(135deg, #36b9cc, #2a9fd7);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(79, 209, 199, 0.3);
}

.chat-action-btn i {
    font-size: 0.9rem;
}

.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.loading-chat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4fd1c7;
    font-style: italic;
    opacity: 0.8;
}

.loading-chat i {
    color: #4fd1c7;
}

/* Enhanced message content styling */
.message-content strong {
    color: #163c3c;
    font-weight: 600;
}

.message-content br + br {
    line-height: 0;
}

.message.assistant .message-content {
    line-height: 1.6;
}

.message.assistant .message-content ul,
.message.assistant .message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message.assistant .message-content li {
    margin: 0.25rem 0;
}

/* Chat button responsive design */
@media (max-width: 768px) {
    .chat-actions {
        flex-direction: column;
    }
    
    .chat-action-btn {
        width: 100%;
        justify-content: center;
        margin: 0.25rem 0;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #4fd1c7;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(79, 209, 199, 0.1);
    transform: scale(1.1);
}

/* Sidebar Toggle */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: #4fd1c7;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-left: auto;
}

.sidebar-toggle:hover {
    background: rgba(79, 209, 199, 0.1);
    transform: scale(1.1);
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

.sidebar.active .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10001; /* Above chat panel and all other elements */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* Don't block interactions when hidden */
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Allow interactions when active */
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(145deg, #2d3748, #1a202c);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    max-width: 90vw; /* Ensure it doesn't overflow on small screens */
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-header .logo {
    font-size: 1.2rem;
    font-weight: 600;
}

.mobile-menu-header .logo i {
    color: #4fd1c7;
    margin-right: 0.5rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #cbd5e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(203, 213, 224, 0.1);
    color: #ffffff;
}

.mobile-menu-items {
    padding: 1rem 0;
}

.mobile-menu-section {
    margin-bottom: 2rem;
}

.mobile-menu-section h3 {
    color: #4fd1c7;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 1rem 0;
    padding: 0 1.5rem;
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mobile-menu-btn:hover {
    background: rgba(79, 209, 199, 0.1);
    color: #4fd1c7;
    transform: translateX(5px);
}

.mobile-menu-btn i {
    width: 20px;
    text-align: center;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mobile-nav-item:hover {
    background: rgba(79, 209, 199, 0.1);
    color: #4fd1c7;
    transform: translateX(5px);
}

.mobile-nav-item.active {
    background: rgba(79, 209, 199, 0.2);
    color: #4fd1c7;
    border-left: 3px solid #4fd1c7;
}

.mobile-nav-item i {
    width: 20px;
    text-align: center;
}

.gray-gradient-bg {
    background: var(--gray-gradient);
}

.icon-size {
    font-size: 0.9rem;
}

.accent-badge {
    background: #e6f0fd;
    color: var(--accent);
}

.logo-size {
    width: 24px;
    height: 24px;
}

.microsoft-logo {
    height: 32px;
}

.google-logo {
    height: 32px;
}

.cisco-logo {
    height: 32px;
}

.openai-logo {
    height: 32px;
}

.meta-logo {
    height: 32px;
}

.aws-logo {
    height: 32px;
}

.footer-section {
    background: linear-gradient(135deg, rgba(26,35,50,0.05), rgba(0,188,212,0.05));
    border-top: 1px solid rgba(0,188,212,0.1);
}

.section-title-custom {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.purple-header {
    background: #6c63ff;
    color: white;
}

.purple-dark-header {
    background: #5f27cd;
    color: white;
}

.teal-header {
    background: #00d4aa;
    color: white;
}

.orange-header {
    background: #ff9f43;
    color: white;
}

.clients-bg {
    background-color: #f0f4f8;
}

.client-logo {
    height: 24px;
    margin-right: 10px;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ======================================== */

/* Extra Small Devices (320px - 480px) - iPhone SE, Small Android phones */
@media (max-width: 480px) {
    /* Root font sizing for small screens */
    html {
        font-size: 14px;
    }

    body {
        font-size: 14px;
    }

    /* Login Modal */
    .login-gate {
        padding: 1rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .login-modal {
        padding: 1.5rem;
        max-width: 100%;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 15px;
    }

    .login-modal h2 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .login-modal p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .modal-input {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }

    .modal-login-btn {
        padding: 0.8rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .error-message {
        font-size: 0.85rem;
        padding: 0.6rem;
        margin-bottom: 1rem;
    }

    /* Top Navigation - Vertical stacking */
    .top-nav {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-left {
        order: 1;
        width: 100%;
        display: flex;
        align-items: center;
    }

    .nav-left .logo {
        font-size: 1.1rem;
    }

    .nav-left .logo i {
        font-size: 1.3rem;
    }

    .nav-left .title {
        display: none; /* Hide title on very small screens */
    }

    .login-section {
        order: 3;
        margin-left: auto;
        font-size: 0.85rem;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        order: 2;
        font-size: 1.2rem;
        padding: 0.4rem;
        margin-left: 0.5rem;
    }

    .top-menu {
        display: none;
    }

    /* Sidebar - Completely hidden on small screens, shown as overlay */
    .sidebar {
        position: fixed;
        width: 100%;
        height: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        border-radius: 0;
        margin: 0;
        left: 0;
        top: 60px;
        z-index: 999;
    }

    .sidebar.active {
        height: auto;
        max-height: 60vh;
        overflow-y: auto;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem;
        cursor: pointer;
    }

    .sidebar-toggle {
        display: block;
        font-size: 1rem;
        padding: 0.3rem;
    }

    /* Navigation Menu */
    .nav-menu {
        display: flex;
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.3rem;
        background: rgba(45, 55, 72, 0.95);
    }

    .nav-item {
        width: 100%;
        min-width: unset;
        margin-bottom: 0;
        padding: 0.8rem;
        font-size: 0.9rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        min-height: 44px; /* Touch target size */
        display: flex;
        align-items: center;
    }

    .nav-item i {
        margin-right: 0.75rem;
        font-size: 0.95rem;
    }

    .nav-item span {
        display: inline;
    }

    /* Main Content Area */
    .main-content {
        margin-left: 0;
        padding: 0.75rem;
    }

    /* Dashboard Panels */
    .dashboard-panel {
        padding: 1rem;
        margin: 0.5rem 0;
        border-radius: 12px;
        font-size: 0.95rem;
    }

    /* Welcome Screen */
    .welcome-screen {
        text-align: center;
    }

    .welcome-screen h1 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .welcome-screen > p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .feature-card {
        padding: 1rem;
        border-radius: 10px;
    }

    /* Chat Panel */
    .integrated-chat-panel {
        margin: 0.5rem 0;
        border-radius: 12px;
        max-height: 60vh;
    }

    .chat-messages {
        height: 300px;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .message {
        max-width: 90%;
        padding: 0.6rem 0.8rem;
        margin: 0.4rem 0;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .chat-input-container {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .chat-input-container input {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Touch target */
    }

    .chat-input-container button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Login Form */
    .login-form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .login-input {
        width: 100%;
        max-width: 100%;
        padding: 0.8rem;
        font-size: 16px; /* Prevents zoom */
    }

    .login-btn {
        width: 100%;
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    /* Mobile Menu */
    .mobile-menu-content {
        width: 90vw;
        max-width: 300px;
    }

    .mobile-menu-btn,
    .mobile-nav-item {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .mobile-menu-section h3 {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }

    /* Ensure horizontal scrolling doesn't occur */
    .top-nav {
        overflow: hidden;
    }

    body {
        overflow-x: hidden;
    }

    /* Hide unnecessary elements on small screens */
    .title {
        display: none;
    }
}

/* Small Devices (481px - 768px) - Larger phones, small tablets */
@media (max-width: 768px) and (min-width: 481px) {
    html {
        font-size: 15px;
    }

    .login-modal {
        padding: 2rem;
        max-width: 350px;
        width: 90%;
    }

    .login-modal h2 {
        font-size: 1.4rem;
    }

    .modal-input {
        padding: 0.9rem;
        margin-bottom: 1rem;
        font-size: 16px;
    }

    .modal-login-btn {
        padding: 0.9rem;
        font-size: 1rem;
    }

    .top-nav {
        padding: 0.9rem;
    }

    .nav-left .logo {
        font-size: 1.2rem;
    }

    .mobile-menu-toggle {
        display: block;
        order: 2;
        font-size: 1.3rem;
        padding: 0.5rem;
    }

    .top-menu {
        display: none;
    }

    .sidebar {
        width: 100%;
        height: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        border-radius: 0;
        margin: 0;
    }

    .sidebar.active {
        height: auto;
        max-height: 400px;
        overflow-y: auto;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        cursor: pointer;
    }

    .sidebar-toggle {
        display: block;
        font-size: 1.1rem;
        padding: 0.4rem;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        background: rgba(45, 55, 72, 0.9);
    }

    .nav-item {
        width: 100%;
        min-width: unset;
        margin-bottom: 0;
        padding: 1rem;
        border-radius: 10px;
        transition: all 0.3s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-item i {
        margin-right: 1rem;
    }

    .nav-item span {
        display: inline;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .dashboard-panel {
        padding: 1rem;
        margin: 1rem;
        border-radius: 15px;
    }

    .welcome-screen h1 {
        font-size: 2rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .integrated-chat-panel {
        margin: 1rem;
        border-radius: 15px;
        max-height: 60vh;
    }

    .chat-messages {
        height: 400px;
        padding: 1rem;
    }

    .message {
        max-width: 85%;
        padding: 0.7rem 1rem;
    }

    .chat-input-container {
        padding: 1rem;
    }

    .chat-input-container input {
        font-size: 16px; /* Prevents zoom */
        min-height: 44px;
    }

    .login-input {
        width: 100%;
        max-width: 100%;
        padding: 0.9rem;
        font-size: 16px;
    }

    .mobile-menu-content {
        width: 280px;
    }

    .mobile-menu-btn,
    .mobile-nav-item {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    body {
        overflow-x: hidden;
    }
}

/* Medium Devices (769px - 1024px) - Tablets, large phones */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
    }

    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .welcome-screen h1 {
        font-size: 2.3rem;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .top-menu {
        display: none;
    }

    .sidebar-toggle {
        display: none;
    }

    .chat-messages {
        height: 450px;
    }

    .login-modal {
        max-width: 400px;
    }

    .dashboard-panel {
        padding: 1.25rem;
        margin: 1.25rem;
    }
}

/* Large Devices (1025px+) - Desktops and large monitors */
@media (min-width: 1025px) {
    /* Sidebar stays at 82px - no override */
    
    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .welcome-screen h1 {
        font-size: 3rem;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .sidebar-toggle {
        display: none;
    }

    .top-menu {
        display: flex;
    }

    .chat-messages {
        height: 500px;
    }

    .login-modal {
        max-width: 450px;
    }

    .dashboard-panel {
        padding: 1.5rem;
        margin: 1.5rem;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4fd1c7;
    animation: spin 1s ease-in-out infinite;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4fd1c7, #36b9cc);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 1rem;
}

.p-2 {
    padding: 2rem;
}

.ai-agents {
    color: #00bcd4;
    text-shadow: 0 0 20px rgba(0, 188, 212, 0.5);
}

.ai-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.robot-icon {
    font-size: 0.8rem;
}

.online-icon {
    font-size: 0.5rem;
}

.card-body-custom {
    height: 400px;
    overflow-y: auto;
}

.light-bg-section {
    background-color: var(--light-bg);
}

.icon-circle {
    width: 80px;
    height: 80px;
}

.gradient-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gradient-card-red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.blue-gradient-card {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

/* Document Comparison Analysis Styles */
.analysis-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-left: 4px solid #00bcd4;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.analysis-box strong {
    display: block;
    margin-bottom: 6px;
    color: #00d4ff;
}

.analysis-box br {
    content: '';
    display: block;
    height: 4px;
}

/* Chat Suggestions */
.chat-suggestions {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    border-left: 3px solid #00bcd4;
}

.chat-suggestions strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9rem;
}

.suggestion-btn {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    margin: 4px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #00d4ff 0%, #00838f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.4);
}

/* Document Selector in Chat */
#selectedDocsList {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    max-height: 150px;
    overflow-y: auto;
}

.doc-select-item {
    display: flex;
    align-items: center;
    padding: 6px;
    margin: 4px 0;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.doc-select-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.doc-select-item label {
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
}

.compare-mode-indicator {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 5px;
}

/* Loading animation for analysis */
.loading {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00bcd4;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================================
   RESPONSE FORMAT STYLING
   ============================================ */

/* Code Block Format */
.response-format-code {
    background: #1a1a1a;
    border-left: 4px solid #4fd1c7;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.response-format-code pre {
    margin: 0;
    color: #163c3c;
}

.response-format-code code {
    background: transparent;
    color: #163c3c;
    padding: 0;
}

.code-label {
    font-size: 0.75rem;
    color: #163c3c;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Report Format */
.response-format-report {
    background: linear-gradient(135deg, rgba(79, 209, 199, 0.1) 0%, rgba(54, 185, 204, 0.05) 100%);
    border: 1px solid rgba(79, 209, 199, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

.report-header {
    border-bottom: 2px solid #163c3c;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.report-header h4 {
    color: #163c3c;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.report-section {
    margin-bottom: 12px;
}

.report-section h5 {
    color: #163c3c;
    font-size: 0.95rem;
    margin-bottom: 6px;
    font-weight: 600;
}

.report-content {
    color: #2d3e3e;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Table Format */
.response-format-table {
    margin: 12px 0;
    overflow-x: auto;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
}

.response-format-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.response-format-table th {
    background: rgba(79, 209, 199, 0.2);
    color: #163c3c;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid rgba(79, 209, 199, 0.4);
}

.response-format-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(79, 209, 199, 0.1);
    color: #163c3c;
}

.response-format-table tr:hover {
    background: rgba(79, 209, 199, 0.05);
}

/* List Format */
.response-format-list {
    margin: 12px 0;
    padding-left: 24px;
}

.response-format-list ul,
.response-format-list ol {
    list-style-position: inside;
    color: #163c3c;
    line-height: 1.8;
}

.response-format-list li {
    margin-bottom: 6px;
}

.response-format-list li strong {
    color: #163c3c;
}

/* JSON Format */
.response-format-json {
    background: #1a1a1a;
    border-left: 4px solid #36b9cc;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre;
    color: #163c3c;
}

/* Markdown Format */
.response-format-markdown {
    margin: 12px 0;
    color: #1a1a1a;
    line-height: 1.7;
}

.response-format-markdown h1,
.response-format-markdown h2,
.response-format-markdown h3 {
    color: #163c3c;
    margin: 12px 0 6px 0;
    font-weight: 600;
}

.response-format-markdown h1 { font-size: 1.3rem; }
.response-format-markdown h2 { font-size: 1.15rem; }
.response-format-markdown h3 { font-size: 1rem; }

.response-format-markdown p {
    margin-bottom: 10px;
}

.response-format-markdown code {
    background: rgba(15, 41, 41, 0.08);
    color: #163c3c;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.response-format-markdown pre {
    background: #1a1a1a;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
    border-left: 3px solid #4fd1c7;
}

/* Card Format */
.response-format-card {
    background: linear-gradient(135deg, rgba(79, 209, 199, 0.1), rgba(54, 185, 204, 0.05));
    border: 1px solid rgba(79, 209, 199, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
}

.card-title {
    color: #163c3c;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-content {
    color: #163c3c;
    font-size: 0.9rem;
}

/* Metric Format */
.response-format-metric {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.metric-item {
    background: rgba(79, 209, 199, 0.1);
    border: 1px solid rgba(79, 209, 199, 0.2);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.metric-label {
    color: #2d3e3e;
    font-size: 0.8rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    color: #163c3c;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Timeline Format */
.response-format-timeline {
    margin: 12px 0;
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    margin-bottom: 16px;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -34px;
    top: 0;
    width: 16px;
    height: 16px;
    background: #163c3c;
    border: 2px solid #1e3c72;
    border-radius: 50%;
}

.timeline-content {
    border-left: 2px solid rgba(79, 209, 199, 0.3);
    padding-left: 16px;
}

.timeline-title {
    color: #163c3c;
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-description {
    color: #2d3e3e;
    font-size: 0.9rem;
}

/* Alert/Info Format */
.response-format-alert {
    border-left: 4px solid #4fd1c7;
    background: rgba(79, 209, 199, 0.1);
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0;
    color: #163c3c;
}

.response-format-alert.success {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.response-format-alert.warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.response-format-alert.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.response-format-alert strong {
    color: #4fd1c7;
}

.response-format-alert.warning strong {
    color: #f59e0b;
}

.response-format-alert.error strong {
    color: #ef4444;
}

