@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    /* Premium Color Palette (Dark Theme / Glassmorphism focus) */
    --primary: #4d7cfe;
    --primary-glow: rgba(77, 124, 254, 0.4);
    --secondary: #8cd9f5;
    --accent: #00e5ff;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Dark Mode Defaults */
    --bg-app: #050a14;
    --bg-surface: rgba(10, 18, 32, 0.7);
    --bg-card: rgba(17, 24, 39, 0.5);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #050a14;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-glass: 16px;
}

html.light-mode {
    /* Premium Light Palette */
    --bg-app: #f4f7fe;
    --bg-surface: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(230, 240, 255, 0.6);
    --border-glass: rgba(77, 124, 254, 0.1);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --shadow-premium: 0 8px 32px 0 rgba(77, 124, 254, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(77, 124, 254, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(140, 217, 245, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Header UI */
.app-header {
    background: #1F264F;
    backdrop-filter: blur(var(--blur-glass));
    -webkit-backdrop-filter: blur(var(--blur-glass));
    border-bottom: 1px solid var(--border-glass);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-premium);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-logo img {
    height: 35px;
    width: auto;
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Navigation UI (Unified Bottom Navigation) */
.app-nav {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--blur-glass));
    -webkit-backdrop-filter: blur(var(--blur-glass));
    border-top: 1px solid var(--border-glass);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: var(--shadow-premium);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 4px;
    width: 16.66%;
    height: 100%;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 1.35rem;
    transition: transform 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-4px) scale(1.15);
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Base Wrapper for Content */
.main-wrapper {
    flex: 1;
    padding: 20px;
    padding-bottom: 90px; /* offset bottom nav */
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Glass Cards & Containers */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--blur-glass));
    -webkit-backdrop-filter: blur(var(--blur-glass));
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-premium);
    margin-bottom: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Forms Styling */
.form-title {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.premium-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.premium-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

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

.premium-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.premium-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Table */
.premium-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(17, 24, 39, 0.2);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.premium-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 18px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
}

.premium-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-main);
}

.premium-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Alerts / Notifications */
.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Page Specific: Chat Elements */
.chat-container {
    max-width: 700px;
    margin: 0 auto;
    height: calc(100vh - 170px);
    display: flex;
    flex-direction: column;
    background: rgba(17, 24, 39, 0.4);
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    font-size: 0.95rem;
    animation: bubbleSlideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

.bot-bubble {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    border-top-left-radius: 4px;
}

.user-bubble {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.chat-inputs-bar {
    padding: 15px;
    background: rgba(17, 24, 39, 0.6);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-inputs-bar input {
    flex: 1;
}

/* Floating Actions in Chat */
.chat-action-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-action-circle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.08);
}

/* Force dark black chat area in light mode */
html.light-mode .chat-container {
    background: #000000 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.light-mode .chat-container .bot-bubble {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f3f4f6 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.light-mode .chat-container .chat-inputs-bar {
    background: rgba(255, 255, 255, 0.03) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

html.light-mode .chat-container .chat-action-circle {
    color: #f3f4f6 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

html.light-mode .chat-container .form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html.light-mode .chat-container .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Modals */
.premium-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.premium-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 25px;
    box-shadow: var(--shadow-premium);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

/* Grid & Layout Utilities */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.06));
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.accent::before {
    background: var(--accent);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-val {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
}

/* Top menu consistency header link styling */
.nav-link-header {
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}
.nav-link-header:hover {
    color: var(--primary);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .main-wrapper {
        padding: 12px;
        padding-bottom: 85px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .glass-card {
        padding: 18px;
    }
}

/* Custom select option colors for dark and light modes */
select option {
    background-color: #111827;
    color: #f3f4f6;
}

html.light-mode select option {
    background-color: #ffffff;
    color: #0f172a;
}

/* Remove text effect in light mode */
html.light-mode .form-title {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    color: var(--text-main) !important;
}

html.light-mode .brand-logo {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: var(--primary) !important;
    color: var(--primary) !important;
}

