/* CSS Variables for Dark/Light Mode */
:root {
    --transition-speed: 0.3s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
    --border-radius-lg: 16px;

    /* Border radius variables for consistency */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --header-height: 72px;
    --sidebar-width: 250px;
}

html[data-theme="light"] {
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --primary-color: #3b82f6;
    --primary-color-rgb: 59, 130, 246;
    --secondary-color: #64748b;
    --secondary-color-rgb: 100, 116, 139;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --header-bg: rgba(255, 255, 255, 0.8);
    --dropdown-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --hover-bg: #f1f5f9;
    --active-bg: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --primary-color-rgb: 59, 130, 246;
    --secondary-color: #94a3b8;
    --secondary-color-rgb: 148, 163, 184;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --header-bg: rgba(30, 41, 59, 0.8);
    --dropdown-bg: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --hover-bg: #334155;
    --active-bg: #475569;
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(148, 163, 184, 0.2);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed) var(--transition-ease),
                color var(--transition-speed) var(--transition-ease);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    font-feature-settings: "liga" 1, "calt" 1;
}

/* Improved Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
    letter-spacing: -0.03em;
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.font-futuristic {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.02em;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    z-index: 10000;
    transform-origin: left;
    animation: pageLoad 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageLoad {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(20px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-speed) var(--transition-ease);
}

.navbar {
    padding: 1rem 0;
    min-height: 70px;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) var(--transition-ease);
}

.navbar-brand:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.navbar-brand:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    text-shadow: 0 4px 8px rgba(var(--primary-color-rgb), 0.3);
}

.navbar-brand:hover i {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(var(--primary-color-rgb), 0.4));
}

.navbar-nav .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-color-rgb), 0.1), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all var(--transition-speed) var(--transition-ease);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
    color: var(--text-color);
    background-color: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.15);
}

.navbar-nav .nav-link:hover::before {
    left: 100%;
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    width: 80%;
}

.navbar-nav .nav-link i {
    transition: all var(--transition-speed) var(--transition-ease);
}

.navbar-nav .nav-link:hover i {
    transform: scale(1.1);
    color: var(--primary-color);
}

/* Special styling for VoiceBot navigation links - Red opalescent effect */
.voicebot-link {
    position: relative;
}

.voicebot-link i,
.voicebot-link {
    background: linear-gradient(45deg, #ff6b6b, #ff8787, #ffa8a8, #ff6b6b, #ff4757, #ff3838);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: opalescent-red 3s ease-in-out infinite;
    font-weight: 600;
    transition: all 0.3s ease;
}

.voicebot-link:hover i,
.voicebot-link:hover {
    animation-duration: 1.5s;
    transform: scale(1.05);
    filter: brightness(1.3) saturate(1.2);
}

@keyframes opalescent-red {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

/* Mobile Navigation - Improved Hamburger */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) var(--transition-ease);
    background: var(--hover-bg);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

.navbar-toggler:hover {
    background: var(--active-bg);
    transform: scale(1.05);
}

.hamburger {
    width: 24px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--text-color);
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hamburger span:nth-child(1) {
    top: 0px;
    transform-origin: left center;
}

.hamburger span:nth-child(2) {
    top: 8px;
    transform-origin: left center;
}

.hamburger span:nth-child(3) {
    top: 16px;
    transform-origin: left center;
}

.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    top: 3px;
    left: 6px;
}

.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    top: 15px;
    left: 6px;
}

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: all var(--transition-speed) var(--transition-ease);
    height: calc(100vh - var(--header-height));
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: var(--spacing-lg);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Main content offset when sidebar is visible */
.main-content {
    transition: margin-left var(--transition-speed) var(--transition-ease);
    padding-left: 0;
    padding-right: 0;
}

@media (min-width: 992px) {
    .main-content.with-sidebar {
        margin-left: var(--sidebar-width);
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 991.98px) {
    .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Content wrapper for proper spacing */
.content-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .content-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    transition: all var(--transition-speed) var(--transition-ease);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-color-rgb), 0.1), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.sidebar .nav-link:hover {
    color: var(--text-color);
    background-color: var(--hover-bg);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.1);
}

.sidebar .nav-link:hover::before {
    left: 100%;
}

.sidebar .nav-link:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.75rem;
}

.sidebar .nav-link.active i {
    color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Mobile Sidebar (Off-canvas) */
.offcanvas {
    background-color: var(--sidebar-bg);
    border: none;
    width: 300px;
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.offcanvas-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
}

.offcanvas .nav-link {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
    overflow: hidden;
}

.offcanvas .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-color-rgb), 0.1), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.offcanvas .nav-link:hover {
    color: var(--text-color);
    background-color: var(--hover-bg);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.1);
}

.offcanvas .nav-link:hover::before {
    left: 100%;
}

.offcanvas .nav-link:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.offcanvas .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.75rem;
}

.offcanvas .nav-link.active i {
    color: var(--primary-color);
}

.offcanvas .nav-link i {
    width: 20px;
    text-align: center;
    transition: all var(--transition-speed) var(--transition-ease);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
}

.theme-toggle:hover {
    background-color: var(--active-bg);
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.2);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    font-size: 20px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-toggle .sun-icon {
    color: #fbbf24;
    transform: translateY(0);
    opacity: 1;
}

.theme-toggle .moon-icon {
    color: #60a5fa;
    transform: translateY(40px);
    opacity: 0;
}

html[data-theme="dark"] .theme-toggle .sun-icon {
    transform: translateY(-40px);
    opacity: 0;
}

html[data-theme="dark"] .theme-toggle .moon-icon {
    transform: translateY(0);
    opacity: 1;
}

/* User Menu */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: all var(--transition-speed) var(--transition-ease);
}

.dropdown-toggle {
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed) var(--transition-ease);
}

.dropdown-toggle:hover,
.dropdown-toggle:focus {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

.dropdown-menu {
    background-color: var(--dropdown-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: calc(var(--border-radius) - 2px);
    transition: all var(--transition-speed) var(--transition-ease);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Auth Buttons */
.auth-buttons .btn {
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) var(--transition-ease);
    border-width: 2px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-speed) var(--transition-ease);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Forms */
.form-control,
.form-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) var(--transition-ease);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
    color: var(--text-color);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    backdrop-filter: blur(10px);
}

.alert-dismissible .btn-close {
    background-color: transparent;
    opacity: 0.8;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.footer h5 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer .text-muted {
    color: var(--text-muted) !important;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-speed) var(--transition-ease);
}

.footer a:hover {
    color: var(--primary-color);
}

/* Enhanced Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15), 
                0 -4px 16px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1050;
    color: var(--text-color);
    padding: 0;
}

@keyframes slideUpCookies {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-show {
    animation: slideUpCookies 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cookie-consent .container {
    padding: 1.75rem 1.5rem;
}

.cookie-consent h5 {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.cookie-consent h5 i {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.cookie-consent p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.cookie-consent p a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cookie-consent p a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.cookie-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cookie-buttons-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.flex-1 {
    flex: 1;
}

.cookie-buttons-wrapper .btn {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-buttons-wrapper .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cookie-buttons-wrapper .btn:hover::before {
    left: 100%;
}

.cookie-buttons-wrapper .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cookie-buttons-wrapper .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    color: white;
}

.cookie-buttons-wrapper .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    border-color: var(--primary-hover);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
}

.cookie-buttons-wrapper .btn-outline-primary {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    backdrop-filter: blur(10px);
}

.cookie-buttons-wrapper .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
}

.cookie-buttons-wrapper .btn-outline-secondary {
    background: rgba(var(--text-muted-rgb), 0.1);
    border-color: var(--text-muted);
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.cookie-buttons-wrapper .btn-outline-secondary:hover {
    background: var(--text-muted);
    color: var(--bg-primary);
    border-color: var(--text-muted);
    box-shadow: 0 8px 25px rgba(var(--text-muted-rgb), 0.2);
}

/* Enhanced Cookie Preferences Modal */
.cookie-preferences-modal {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1060;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalOverlayFadeIn 0.3s ease-out;
}

@keyframes modalOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cookie-preferences-modal .modal-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

.cookie-preferences-modal .modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(var(--primary-color-rgb), 0.05);
    border: 2px solid var(--primary-color);
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalContentFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cookie-preferences-modal .modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, 
                rgba(var(--primary-color-rgb), 0.08), 
                rgba(var(--primary-color-rgb), 0.03));
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cookie-preferences-modal .modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.cookie-preferences-modal .modal-title i {
    color: var(--primary-color);
    margin-right: 0.75rem;
    font-size: 1.5rem;
}

.cookie-preferences-modal .btn-close {
    background: rgba(var(--text-muted-rgb), 0.1);
    border: 2px solid var(--border-color);
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.cookie-preferences-modal .btn-close:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: rotate(90deg) scale(1.1);
}

.cookie-preferences-modal .modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.cookie-preferences-modal .modal-body > p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(var(--primary-color-rgb), 0.05);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.cookie-category {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cookie-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.cookie-category:hover::before {
    transform: scaleX(1);
}

.cookie-category:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(var(--primary-color-rgb), 0.15);
    transform: translateY(-2px);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cookie-category-header h6 {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
}

.cookie-category-header h6 i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.cookie-category-header .text-muted {
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-check {
    min-height: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: 3.5rem;
    height: 2rem;
    border-radius: 1rem;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

.form-check-input:disabled {
    background-color: var(--text-muted);
    border-color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}

.form-check-input:disabled + .form-check-label {
    color: var(--text-muted);
    cursor: not-allowed;
}

.cookie-preferences-modal .modal-footer {
    padding: 1.5rem 2rem 2rem;
    border-top: 2px solid var(--border-color);
    background: rgba(var(--bg-secondary-rgb), 0.3);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cookie-preferences-modal .modal-footer .btn {
    padding: 0.875rem 2rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.cookie-preferences-modal .modal-footer .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cookie-preferences-modal .modal-footer .btn:hover::before {
    left: 100%;
}

.cookie-preferences-modal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cookie-preferences-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    color: white;
}

.cookie-preferences-modal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.4);
}

.cookie-preferences-modal .modal-footer .btn-outline-secondary {
    background: rgba(var(--text-muted-rgb), 0.1);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.cookie-preferences-modal .modal-footer .btn-outline-secondary:hover {
    background: var(--text-muted);
    color: var(--bg-primary);
    box-shadow: 0 8px 25px rgba(var(--text-muted-rgb), 0.3);
}

.cookie-preferences-modal .alert {
    background: linear-gradient(135deg, 
                rgba(var(--primary-color-rgb), 0.1), 
                rgba(var(--primary-color-rgb), 0.05));
    border: 2px solid rgba(var(--primary-color-rgb), 0.2);
    border-radius: 12px;
    color: var(--text-color);
    padding: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cookie-preferences-modal .alert-link {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cookie-preferences-modal .alert-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

/* Chat Container Styles */
.chat-container {
    height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-message {
    max-width: 80%;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    position: relative;
    color: #fff;
    box-shadow: var(--shadow-lg);
    word-wrap: break-word;
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.chat-input {
    position: sticky;
    bottom: 0;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Mobile optimizations */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .navbar {
        padding: 0.75rem 0;
        min-height: 70px;
    }

    /* Mobile controls positioning */
    .mobile-controls {
        gap: 0.75rem;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    /* Auth buttons mobile sizing */
    .auth-buttons .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Mobile header layout improvements */
    .navbar-brand {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .navbar-brand i {
        font-size: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .main-header {
        position: sticky;
        top: 0;
    }

    .navbar {
        padding: 0.75rem 0;
        min-height: 64px;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-brand i {
        font-size: 1.3rem;
    }

    /* Mobile controls */
    .mobile-controls {
        gap: 0.5rem;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    /* Auth buttons mobile optimization */
    .auth-buttons {
        gap: 0.5rem !important;
    }

    .auth-buttons .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    .auth-buttons .btn i {
        display: none; /* Hide icons on small screens */
    }

    /* Enhanced Cookie Consent Mobile */
    .cookie-consent .container {
        padding: 1.25rem 1rem;
    }

    .cookie-consent .row {
        --bs-gutter-x: 0;
        flex-direction: column;
        gap: 1rem;
    }

    .cookie-consent h5 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .cookie-consent p {
        font-size: 0.9rem;
        line-height: 1.5;
        text-align: center;
    }

    .cookie-buttons-wrapper {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .cookie-buttons-row {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }

    .cookie-buttons-wrapper .btn {
        width: 100%;
        min-width: unset;
        font-size: 0.9rem;
        padding: 0.875rem 1.5rem;
        justify-content: center;
    }

    .flex-1 {
        flex: unset;
        width: 100%;
    }

    /* Mobile button ordering */
    .mobile-order-1 { order: 1; }
    .mobile-order-2 { order: 2; }
    .mobile-order-3 { order: 3; }

    /* Flatten the structure on mobile */
    .cookie-buttons-wrapper {
        display: flex;
        flex-direction: column;
    }

    .cookie-buttons-row {
        display: contents; /* This makes the wrapper invisible and children become direct children */
    }

    /* Enhanced Cookie Preferences Modal Mobile */
    .cookie-preferences-modal {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .cookie-preferences-modal .modal-content {
        max-height: 95vh;
        border-radius: 20px;
        margin-top: 1rem;
    }

    .cookie-preferences-modal .modal-header {
        padding: 1.5rem 1.25rem 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-preferences-modal .modal-title {
        font-size: 1.25rem;
        justify-content: center;
        order: 1;
    }

    .cookie-preferences-modal .btn-close {
        order: 2;
        align-self: center;
    }

    .cookie-preferences-modal .modal-body {
        padding: 1.25rem;
        max-height: calc(95vh - 180px);
    }

    .cookie-preferences-modal .modal-body > p {
        font-size: 0.9rem;
        padding: 0.875rem;
    }

    .cookie-category {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-category-header h6 {
        font-size: 1rem;
        text-align: center;
        justify-content: center;
    }

    .cookie-category-header .text-muted {
        text-align: center;
        font-size: 0.9rem;
    }

    .form-check {
        justify-content: center;
        margin-top: 0.75rem;
    }

    .form-check-input {
        width: 3rem;
        height: 1.75rem;
    }

    .form-check-label {
        font-size: 0.9rem;
    }

    .cookie-preferences-modal .modal-footer {
        padding: 1.25rem;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .cookie-preferences-modal .modal-footer .btn {
        width: 100%;
        min-width: unset;
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }

    .cookie-preferences-modal .alert {
        font-size: 0.9rem;
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .main-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .navbar {
        min-height: 60px;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar-brand i {
        font-size: 1.2rem;
    }

    .mobile-controls {
        gap: 0.5rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    /* Optimized auth buttons for very small screens */
    .auth-buttons .btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Footer mobile improvements */
    .footer {
        padding: var(--spacing-lg) 0;
        text-align: center;
    }

    .footer .row > div {
        margin-bottom: 2rem;
    }

    .footer .row > div:last-child {
        margin-bottom: 0;
    }

    .footer .d-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .footer h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer ul {
        text-align: center;
    }

    .footer .d-flex.gap-3 {
        flex-direction: row;
        justify-content: center;
    }

    /* Mobile content spacing */
    .container-fluid.mt-4 {
        margin-top: 1rem !important;
    }

    /* Mobile alert improvements */
    .alert {
        border-radius: var(--border-radius);
    }

    /* Ultra Mobile Cookie Consent */
    .cookie-consent .container {
        padding: 1rem 0.75rem;
    }

    .cookie-consent h5 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .cookie-consent p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .cookie-buttons-wrapper .btn {
        font-size: 0.85rem;
        padding: 0.75rem 1.25rem;
    }

    /* Ultra Mobile Cookie Modal */
    .cookie-preferences-modal {
        padding: 0.5rem;
        padding-top: 0.5rem;
    }

    .cookie-preferences-modal .modal-content {
        border-radius: 16px;
        max-height: 98vh;
    }

    .cookie-preferences-modal .modal-header {
        padding: 1.25rem 1rem 0.75rem;
    }

    .cookie-preferences-modal .modal-title {
        font-size: 1.1rem;
    }

    .cookie-preferences-modal .btn-close {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }

    .cookie-preferences-modal .modal-body {
        padding: 1rem;
        max-height: calc(98vh - 160px);
    }

    .cookie-preferences-modal .modal-body > p {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .cookie-category {
        padding: 1rem;
        border-radius: 12px;
    }

    .cookie-category-header h6 {
        font-size: 0.95rem;
    }

    .cookie-category-header .text-muted {
        font-size: 0.8rem;
    }

    .form-check-input {
        width: 2.75rem;
        height: 1.5rem;
    }

    .form-check-label {
        font-size: 0.85rem;
    }

    .cookie-preferences-modal .modal-footer {
        padding: 1rem;
    }

    .cookie-preferences-modal .modal-footer .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.85rem;
    }

    .cookie-preferences-modal .alert {
        font-size: 0.85rem;
        padding: 0.875rem;
    }
}

/* Extra small screens and when space is really tight */
@media (max-width: 450px) {
    .navbar-brand span {
        display: none; /* Hide "ChatbotAssistant" text on very small screens */
    }

    .navbar-brand i {
        font-size: 1.4rem;
    }

    .auth-buttons {
        gap: 0.25rem !important;
    }

    .auth-buttons .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-width: 1px;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
    }

    .mobile-controls {
        gap: 0.25rem;
    }

    .cookie-consent h5 {
        font-size: 0.9rem;
    }

    .cookie-consent p {
        font-size: 0.8rem;
    }

    .cookie-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Ultra small screens (320px and below) */
@media (max-width: 360px) {
    .auth-buttons .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
    }

    .navbar-toggler {
        width: 38px;
        height: 38px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .navbar-nav .nav-link:hover,
    .sidebar .nav-link:hover,
    .dropdown-item:hover,
    .btn:hover,
    .card:hover {
        transform: none;
    }

    .theme-toggle:hover {
        transform: none;
        background-color: var(--hover-bg);
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand,
    .nav-link,
    .btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}
