/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Smooth scrolling for all devices */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    /* Color Palette - Modern Light Theme with Purple Accents */
    --primary-bg: #f8f9fa;
    --secondary-bg: #ffffff;
    --tertiary-bg: #f3f4f6;
    --accent-purple: #667eea;
    --accent-pink: #f093fb;
    --accent-blue: #4facfe;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    --success-green: #10b981;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

/* ===== Sidebar Styles ===== */
.sidebar {
    width: 280px;
    background: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    padding: 2px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.new-chat-btn:active {
    transform: translateY(0);
}

.chat-history {
    margin-top: 24px;
}

.history-section {
    margin-bottom: 24px;
}

.history-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    transition: background 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
    position: relative;
}

.history-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.history-item.active {
    background: var(--tertiary-bg);
    color: var(--text-primary);
}

.history-item svg {
    flex-shrink: 0;
}

.history-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delete-conversation-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.history-item:hover .delete-conversation-btn {
    opacity: 1;
}

.delete-conversation-btn:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ef4444;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover {
    background: var(--hover-bg);
    transform: translateX(4px);
}

.user-profile:active {
    transform: scale(0.98);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-purple);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-status {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success-green);
    border-radius: 50%;
    display: inline-block;
}

/* ===== Main Content Styles ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
}

.chat-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--secondary-bg);
}

.header-left {
    flex: 1;
}

.chat-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chat-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-purple);
}

/* ===== Chat Container ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
}

/* ===== Welcome Screen ===== */
.welcome-screen {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.welcome-icon {
    margin-bottom: 24px;
}

.welcome-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    object-fit: contain;
    padding: 8px;
    background: var(--secondary-bg);
}

.welcome-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.feature-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-purple);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.suggestions {
    margin-top: 48px;
}

.suggestions-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.suggestion-chip {
    padding: 10px 20px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

/* ===== Chat Messages ===== */
.chat-messages {
    max-width: 800px;
    margin: 0 auto;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--secondary-bg);
    transition: all 0.2s;
}

.message:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-sm);
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: var(--secondary-bg);
}

.message.user .message-avatar {
    border-color: var(--accent-purple);
}

.message.ai .message-avatar {
    border-color: var(--accent-blue);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.message-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
}

.message-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.message.ai .message-text {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
}

/* Formatted text styles */
.message-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-text em {
    font-style: italic;
    color: var(--text-secondary);
}

.message-text code {
    background: var(--tertiary-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: var(--accent-purple);
    border: 1px solid var(--border-color);
}

.message-text br {
    display: block;
    content: "";
    margin: 8px 0;
}

.message-text ul,
.message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 4px 0;
}

/* File Attachment Styles */
.file-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    transition: all 0.2s;
}

.file-attachment:hover {
    background: var(--hover-bg);
    border-color: var(--accent-purple);
}

.file-icon {
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.file-type {
    font-size: 12px;
    color: var(--text-muted);
}

.file-download-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.file-download-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.file-download-btn:active {
    transform: scale(0.95);
}

/* ===== Input Container ===== */
.input-container {
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-bg);
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 12px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-purple);
}

.attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.attach-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 8px;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.send-btn:active {
    transform: scale(0.95);
}

.input-disclaimer {
    max-width: 800px;
    margin: 12px auto 0;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-title {
        font-size: 18px;
    }
    
    .chat-subtitle {
        font-size: 13px;
    }
    
    .welcome-title {
        font-size: 28px;
    }
    
    .welcome-subtitle {
        font-size: 15px;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .suggestion-chips {
        flex-direction: column;
        gap: 10px;
    }
    
    .suggestion-chip {
        width: 100%;
        text-align: left;
    }
    
    .message {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
    }
    
    .message-author {
        font-size: 13px;
    }
    
    .message-time {
        font-size: 11px;
    }
    
    .message-text {
        font-size: 14px;
    }
    
    .input-container {
        padding: 12px 16px;
    }
    
    .message-input {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Landscape & Small Tablet (481px - 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 56px; /* Height of mobile header */
    }
    
    /* Show mobile header on tablet portrait */
    .mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        background: var(--secondary-bg);
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .mobile-header-title {
        flex: 1;
        text-align: center;
        padding: 0 12px;
    }
    
    .mobile-user-name {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .mobile-header .user-profile {
        padding: 0;
        cursor: pointer;
        border-radius: 50%;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 40px;
        height: 40px;
    }
    
    .mobile-header .user-profile:active {
        transform: scale(0.95);
    }
    
    .mobile-header .user-avatar {
        width: 40px;
        height: 40px;
        border: 2px solid var(--accent-purple);
        border-radius: 50%;
        object-fit: cover;
    }
    
    .mobile-header .mobile-menu-btn {
        position: static;
        margin: 0;
        background: var(--accent-purple);
        color: white;
        border: none;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-sm);
        transition: all 0.3s;
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    .chat-header {
        display: none; /* Hide original header on tablet portrait */
    }
    
    .chat-container {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        padding-top: 20px; /* Extra space from header */
        padding-bottom: 200px; /* More space for input area on tablet */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .chat-subtitle {
        font-size: 12px;
        display: none; /* Hide subtitle on very small screens */
    }
    
    /* Input area for tablet */
    .input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        background: var(--secondary-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
        z-index: 50;
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
    }
    
    .input-wrapper {
        gap: 10px;
        max-width: 100%;
    }
    
    .message-input {
        padding: 10px 14px;
        font-size: 15px;
        border-radius: 20px;
        flex: 1;
        min-height: 40px;
    }
    
    .message-input::placeholder {
        font-size: 14px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .input-disclaimer {
        font-size: 11px;
        margin-top: 6px;
    }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    body {
        overflow-x: hidden;
    }
    
    .sidebar {
        width: 85%;
        max-width: 320px;
        left: -100%;
        height: 100vh;
        position: fixed;
        top: 0;
        z-index: 1000;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    /* Mobile header with user profile */
    .mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        background: var(--secondary-bg);
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .mobile-header-title {
        flex: 1;
        text-align: center;
        padding: 0 12px;
    }
    
    .mobile-user-name {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .mobile-header .user-profile {
        padding: 0;
        cursor: pointer;
        border-radius: 50%;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 40px;
        height: 40px;
    }
    
    .mobile-header .user-profile:active {
        transform: scale(0.95);
    }
    
    .mobile-header .user-avatar {
        width: 40px;
        height: 40px;
        border: 2px solid var(--accent-purple);
        border-radius: 50%;
        object-fit: cover;
    }
    
    .user-avatar-fallback {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--accent-purple);
    }
    
    .user-avatar-fallback span {
        color: white;
        font-size: 18px;
        font-weight: 600;
    }
    
    .mobile-header .mobile-menu-btn {
        position: static;
        margin: 0;
        background: var(--accent-purple);
        color: white;
        border: none;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-sm);
        transition: all 0.3s;
    }
    
    .mobile-header .mobile-menu-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* Main content adjustments */
    .main-content {
        margin-left: 0;
        padding-top: 56px; /* Height of mobile header */
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .chat-header {
        display: none; /* Hide original header on mobile */
    }
    
    .chat-container {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        padding-top: 20px; /* Extra space from header */
        padding-bottom: 90px; /* Adjusted for smaller input area */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .chat-subtitle {
        font-size: 12px;
        display: none; /* Hide subtitle on very small screens */
    }
    
    /* Welcome screen */
    .welcome-screen {
        padding: 60px 16px 20px 16px;
        max-width: 100%;
    }
    
    .welcome-icon {
        margin-bottom: 24px;
        margin-top: 20px;
    }
    
    .welcome-logo {
        width: 90px;
        height: 90px;
        margin-bottom: 20px;
    }
    
    .welcome-title {
        font-size: 26px;
        margin-bottom: 8px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .feature-card {
        padding: 16px;
        text-align: left;
    }
    
    .feature-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 8px;
    }
    
    .feature-title {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .feature-description {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .suggestions {
        margin-top: 24px;
    }
    
    .suggestions-label {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .suggestion-chips {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .suggestion-chip {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        text-align: left;
        border-radius: 10px;
    }
    
    /* Chat messages */
    .chat-messages {
        padding: 0;
        padding-bottom: 90px; /* Adjusted for smaller input */
        max-width: 100%;
    }
    
    .message {
        padding: 12px;
        gap: 12px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .message:first-child {
        margin-top: 8px; /* Space from top */
    }
    
    .message:last-child {
        margin-bottom: 20px; /* Extra space at bottom */
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .message-content {
        flex: 1;
        min-width: 0;
    }
    
    .message-header {
        margin-bottom: 6px;
    }
    
    .message-author {
        font-size: 14px;
        font-weight: 600;
    }
    
    .message-time {
        font-size: 12px;
    }
    
    .message-text {
        font-size: 14px;
        line-height: 1.5;
        word-wrap: break-word;
    }
    
    .message.user {
        background: var(--tertiary-bg);
    }
    
    .message.ai {
        background: var(--secondary-bg);
    }
    
    /* Input area - fixed at bottom */
    .input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        background: var(--secondary-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
        z-index: 50;
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.95);
    }
    
    .input-wrapper {
        gap: 10px;
        max-width: 100%;
    }
    
    .message-input {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 20px;
        flex: 1;
        min-height: 40px;
        max-height: 40px;
    }
    
    .message-input::placeholder {
        font-size: 13px;
        color: #999;
    }
    
    .message-input:focus {
        font-size: 14px;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .send-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .send-btn:active {
        transform: scale(0.95);
    }
    
    .input-disclaimer {
        font-size: 10px;
        margin-top: 6px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }
    
    .new-chat-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .history-item {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .user-profile {
        padding: 6px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-status {
        font-size: 11px;
    }
    
    /* Modal - full screen on mobile */
    .modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: var(--secondary-bg);
        z-index: 10;
        border-bottom: 1px solid var(--border-color);
    }
    
    .modal-header h2 {
        font-size: 18px;
        font-weight: 600;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
    }
    
    .modal-body {
        padding: 16px;
        overflow-y: auto;
        height: calc(100vh - 60px);
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
    
    .profile-info {
        text-align: center;
    }
    
    .profile-info h3 {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .profile-info p {
        font-size: 14px;
    }
    
    .profile-section {
        margin-bottom: 20px;
    }
    
    .profile-section h4 {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .profile-item {
        padding: 10px;
    }
    
    .profile-item strong {
        font-size: 13px;
    }
    
    .profile-item span {
        font-size: 14px;
    }
    
    .profile-tags {
        gap: 8px;
    }
    
    .profile-tag {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Mobile header - hidden by default */
.mobile-header {
    display: none;
}

@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none;
    }
    
    .mobile-overlay {
        display: none;
    }
    
    .mobile-header {
        display: none;
    }
}

/* ===== Leave Request Badge ===== */
.leave-request-badge {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leave-request-badge.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.badge-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 8px;
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.badge-text {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.badge-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ===== User Profile Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--secondary-bg);
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-purple);
}

.profile-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.profile-job {
    font-size: 14px;
    color: var(--accent-purple);
    font-weight: 600;
}

.profile-section {
    margin-bottom: 28px;
}

.profile-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.profile-tag {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    font-size: 13px;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
}

.profile-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
}

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

.feature-card,
.suggestion-chip,
.message {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Loading Animation ===== */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.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);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}
