/* ========== THEME VARIABLES ========== */
:root {
    /* Light Theme - Blue Colors */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e1e8ed 100%);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Sidebar */
    --sidebar-bg: #e0e7ff;
    --sidebar-text: #3730a3;
    --sidebar-hover: rgba(79, 70, 229, 0.1);
    --sidebar-active-bg: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);

    /* Navbar */
    --navbar-bg: #e0e7ff;
    --navbar-text: #3730a3;

    /* Primary colors */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --primary-color: #4f46e5;
    --primary-hover: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

    /* Secondary colors */
    --secondary-gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

    /* Links */
    --link-color: #4f46e5;
    --link-hover: #4338ca;
    --link-visited: #3730a3;

    /* Cards */
    --card-bg: #ffffff;
    --card-shadow: rgba(30, 41, 59, 0.1);
    --card-border: #e2e8f0;

    /* Forms */
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-focus-border: #4f46e5;
    --input-focus-shadow: rgba(79, 70, 229, 0.15);
    --input-disabled-bg: #f1f5f9;

    /* Messages */
    --msg-left-bg: #ffffff;
    --msg-left-text: #1e293b;
    --msg-right-bg: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --msg-right-text: #ffffff;

    /* Analysis boxes */
    --analysis-box-bg: #f8fafc;
    --analysis-border: #10b981;
    --truth-border: #6366f1;
    --summary-border: #4f46e5;

    /* Badges */
    --badge-interest-bg: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    --badge-avoidance-bg: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);

    /* Other */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --shadow-color: rgba(30, 41, 59, 0.12);
}

/* Dark Theme - Warm Colors */
[data-theme="dark"] {
    --bg-primary: #2b1f15;
    --bg-secondary: #3d2e1f;
    --bg-gradient: linear-gradient(135deg, #2b1f15 0%, #1f1610 100%);
    --text-primary: #f5f1eb;
    --text-secondary: #d4c4b4;
    --text-muted: #a89885;

    /* Sidebar */
    --sidebar-bg: #1f1610;
    --sidebar-text: #d4c4b4;
    --sidebar-hover: rgba(212, 196, 180, 0.1);
    --sidebar-active-bg: linear-gradient(135deg, #c67d4e 0%, #a85f3a 100%);

    /* Navbar */
    --navbar-bg: #1f1610;
    --navbar-text: #f5f1eb;

    /* Primary colors */
    --primary-gradient: linear-gradient(135deg, #d4925f 0%, #c67d4e 100%);
    --primary-color: #d4925f;
    --primary-hover: linear-gradient(135deg, #e89e6d 0%, #d4925f 100%);

    /* Secondary colors */
    --secondary-gradient: linear-gradient(135deg, #e89e6d 0%, #d4925f 100%);
    --accent-gradient: linear-gradient(135deg, #d4925f 0%, #c67d4e 100%);

    /* Links */
    --link-color: #e89e6d;
    --link-hover: #f5b88a;
    --link-visited: #d4925f;

    /* Cards */
    --card-bg: #3d2e1f;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-border: #4a3628;

    /* Forms */
    --input-bg: #2b1f15;
    --input-border: #4a3628;
    --input-focus-border: #d4925f;
    --input-focus-shadow: rgba(212, 146, 95, 0.25);
    --input-disabled-bg: #352820;

    /* Messages */
    --msg-left-bg: #4a3628;
    --msg-left-text: #f5f1eb;
    --msg-right-bg: linear-gradient(135deg, #d4925f 0%, #c67d4e 100%);
    --msg-right-text: #ffffff;

    /* Analysis boxes */
    --analysis-box-bg: #352820;
    --analysis-border: #8fbc8f;
    --truth-border: #d4925f;
    --summary-border: #c67d4e;

    /* Badges */
    --badge-interest-bg: linear-gradient(135deg, #e89e6d 0%, #d4925f 100%);
    --badge-avoidance-bg: linear-gradient(135deg, #e8a55e 0%, #d4925f 100%);

    /* Other */
    --success-color: #8fbc8f;
    --warning-color: #e89e6d;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Fix Bootstrap text-muted for dark mode */
.text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* Fix other text colors for dark mode */
p {
    color: var(--text-primary);
}

[data-theme="dark"] p,
[data-theme="dark"] span:not(.badge):not(.navbar-toggler-icon),
[data-theme="dark"] div:not(.spinner-border):not(.alert) {
    color: var(--text-primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary);
}

/* Fix small text */
[data-theme="dark"] small {
    color: var(--text-muted);
}

/* Ensure card text is visible */
[data-theme="dark"] .card p,
[data-theme="dark"] .card-body p {
    color: var(--text-primary) !important;
}

/* ========== GLOBAL LINK STYLES ========== */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:visited {
    color: var(--link-visited);
}

/* ========== APP LAYOUT WITH SIDEBAR ========== */
.app-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.5rem 0;
    box-shadow: 2px 0 10px var(--shadow-color);
    position: sticky;
    top: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.sidebar-content {
    padding: 0 1rem;
}

.sidebar-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding: 0 0.75rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    transform: translateX(4px);
}

.sidebar-item.active {
    background: var(--sidebar-active-bg);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

[data-theme="dark"] .sidebar-item.active {
    box-shadow: 0 2px 8px rgba(198, 125, 78, 0.4);
}

.sidebar-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-text {
    font-size: 0.95rem;
}

.main-content {
    flex: 1;
    padding-top: 2rem;
    overflow-x: hidden;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.5);
    z-index: 1040;
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.7);
}

[data-theme="dark"] .mobile-menu-btn {
    box-shadow: 0 4px 15px rgba(198, 125, 78, 0.5);
}

[data-theme="dark"] .mobile-menu-btn:hover {
    box-shadow: 0 6px 20px rgba(198, 125, 78, 0.7);
}

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

/* ========== CUSTOM BUTTONS ========== */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--text-muted);
    box-shadow: none;
    transform: none;
}

/* Dark mode button shadows */
[data-theme="dark"] .btn-primary {
    box-shadow: 0 4px 15px rgba(198, 125, 78, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(198, 125, 78, 0.6);
}

.btn-outline-secondary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* ========== HOME PAGE STYLING ========== */
.card {
    border: none;
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 10px 40px var(--card-shadow);
    overflow: hidden;
    transition: background 0.3s ease;
}

.card-body {
    padding: 2.5rem;
}

.card h2 {
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid var(--input-border);
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
}

/* Override autofill background for light theme */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1e293b !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    border: 2px solid var(--input-border);
}

/* Override autofill background for dark theme */
[data-theme="dark"] .form-control:-webkit-autofill,
[data-theme="dark"] .form-control:-webkit-autofill:hover,
[data-theme="dark"] .form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #2b1f15 inset !important;
    -webkit-text-fill-color: #f5f1eb !important;
    box-shadow: 0 0 0 1000px #2b1f15 inset !important;
    border: 2px solid #4a3628;
}

textarea.form-control {
    resize: none;
}

textarea.form-control:disabled {
    background-color: var(--input-disabled-bg) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Ensure textareas also get proper colors */
textarea.form-control {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
}

/* Readonly inputs */
.form-control[readonly] {
    background-color: var(--input-disabled-bg) !important;
    color: var(--text-muted) !important;
    cursor: default;
}

[data-theme="dark"] .form-control[readonly] {
    background-color: #352820 !important;
    color: #a89885 !important;
}

/* Clear button styling */
.btn-outline-danger {
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    transform: scale(1.05);
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-select {
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234f46e5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

/* Dark theme arrow color and ensure background persists */
[data-theme="dark"] .form-select,
[data-theme="dark"] select.form-select {
    background: #2b1f15 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e89e6d' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 1rem center !important;
    background-size: 12px !important;
}

/* Light theme - explicit white backgrounds for all inputs */
.form-control {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

.form-select {
    background-color: #ffffff !important;
    color: #1e293b !important;
}

.form-select option {
    padding: 10px;
    background-color: #ffffff !important;
    color: #1e293b !important;
}

/* Dark theme - explicit dark backgrounds for all inputs */
[data-theme="dark"] .form-control,
[data-theme="dark"] input.form-control,
[data-theme="dark"] textarea.form-control {
    background-color: #2b1f15 !important;
    color: #f5f1eb !important;
    border-color: #4a3628 !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] input.form-control:focus,
[data-theme="dark"] textarea.form-control:focus {
    background-color: #2b1f15 !important;
    color: #f5f1eb !important;
    border-color: #d4925f !important;
}

/* Dark theme select - MOST IMPORTANT - explicit colors with maximum specificity */
[data-theme="dark"] select.form-select,
[data-theme="dark"] .form-select,
html[data-theme="dark"] select.form-select,
html[data-theme="dark"] .form-select {
    background-color: #2b1f15 !important;
    color: #f5f1eb !important;
    border-color: #4a3628 !important;
    color-scheme: dark;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

[data-theme="dark"] select.form-select:focus,
[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] select.form-select:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #2b1f15 !important;
    color: #f5f1eb !important;
    border-color: #d4925f !important;
}

[data-theme="dark"] .form-select option,
[data-theme="dark"] select.form-select option {
    background-color: #2b1f15 !important;
    color: #f5f1eb !important;
}

/* Firefox specific fix */
@-moz-document url-prefix() {
    [data-theme="dark"] .form-select,
    [data-theme="dark"] select.form-select {
        background-color: #2b1f15 !important;
        color: #f5f1eb !important;
    }

    [data-theme="dark"] .form-select option,
    [data-theme="dark"] select.form-select option {
        background-color: #2b1f15 !important;
        color: #f5f1eb !important;
    }
}

/* ========== ANALYSIS RESULTS ========== */
.chat-container {
    max-width: 720px;
    margin: 0 auto;
}

.message-block {
    margin-bottom: 1.5rem;
}

.msg {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    display: inline-block;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.msg-left {
    background: var(--msg-left-bg);
    color: var(--msg-left-text);
    border-top-left-radius: 4px;
}

.msg-right {
    background: var(--msg-right-bg);
    color: var(--msg-right-text);
    border-top-right-radius: 4px;
    margin-left: auto;
    display: block;
    text-align: left;
}

.analysis-box {
    background: var(--analysis-box-bg);
    border-left: 4px solid var(--analysis-border);
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.badge-interest {
    background: var(--badge-interest-bg) !important;
    border: none;
    padding: 6px 12px;
    font-weight: 600;
    color: white !important;
}

.badge-avoidance {
    background: var(--badge-avoidance-bg) !important;
    color: #ffffff !important;
    border: none;
    padding: 6px 12px;
    font-weight: 600;
}

.truth-section {
    background: var(--card-bg);
    border-left: 5px solid var(--truth-border);
    padding: 20px;
    border-radius: 16px;
    margin-top: 2rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    color: var(--text-primary);
}

.summary-section {
    background: var(--card-bg);
    border-left: 5px solid var(--summary-border);
    padding: 20px;
    border-radius: 16px;
    margin-top: 1rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    color: var(--text-primary);
}

.share-btn {
    margin-top: 30px;
}

/* ========== LOADING STATE ========== */
.alert-info {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    color: var(--text-primary);
}

.alert-danger {
    background: var(--card-bg);
    border: 2px solid #dc3545;
    border-radius: 12px;
    color: var(--text-primary);
}

[data-theme="dark"] .alert-danger {
    background: var(--card-bg);
    border-color: #dc3545;
    color: var(--text-primary);
}

.spinner-border {
    vertical-align: middle;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    background: rgba(79, 70, 229, 0.1);
    border: 2px solid #4f46e5;
    color: #3730a3;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    color: #3730a3;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

/* Dark theme toggle styling */
[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

[data-theme="dark"] .theme-toggle svg {
    color: #ffffff;
}

.theme-toggle:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.6);
}

.theme-toggle:hover {
    color: white;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
    color: white;
    stroke: white;
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* Dark theme toggle button */
[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 4px 12px rgba(198, 125, 78, 0.6);
    color: white;
}

[data-theme="dark"] .theme-toggle:hover svg {
    color: white;
    stroke: white;
}

[data-theme="dark"] .theme-toggle:focus {
    box-shadow: 0 0 0 3px rgba(198, 125, 78, 0.3);
}

@media (max-width: 767px) {
    .theme-toggle {
        width: 38px;
        height: 38px;
    }

    .theme-toggle svg {
        width: 20px;
        height: 20px;
    }
}

/* ========== NAVBAR ========== */
.navbar-dark {
    background: var(--navbar-bg) !important;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--navbar-text) !important;
}

.navbar-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

@media (max-width: 767px) {
    .navbar-logo {
        height: 28px;
        width: 28px;
    }
}

.nav-link {
    color: var(--navbar-text) !important;
}

/* Navbar buttons - light theme */
.navbar .btn-outline-light {
    border-color: #4f46e5 !important;
    color: #4f46e5 !important;
    background: transparent !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.navbar .btn-outline-light:hover {
    background: #4f46e5 !important;
    color: white !important;
    border-color: #4f46e5 !important;
    transform: translateY(-1px);
}

/* Dark theme navbar buttons */
[data-theme="dark"] .navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #f5f1eb !important;
    background: transparent !important;
}

[data-theme="dark"] .navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-1px);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%234f46e5' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

/* ========== LOGIN PAGE ========== */
.shadow {
    box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    /* Sidebar mobile */
    .sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        height: 100vh;
        z-index: 1050;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        width: 100%;
        padding-top: 1rem;
    }

    .app-container {
        flex-direction: column;
    }

    /* Card adjustments */
    .card {
        border-radius: 15px;
        margin: 0 0.5rem;
    }

    .card-body {
        padding: 1.5rem 1rem;
    }

    /* Typography */
    .card h2 {
        font-size: 1.5rem;
    }

    .card h1 {
        font-size: 2.5rem !important;
    }

    .card p {
        font-size: 0.95rem !important;
    }

    /* Forms */
    .form-control, .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.875rem;
    }

    textarea.form-control {
        min-height: 150px;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Clear button - adjust for mobile */
    #clearBtn {
        top: 5px !important;
        right: 5px !important;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem !important;
    }

    /* Chat messages */
    .msg {
        max-width: 85%;
        font-size: 14px;
    }

    .chat-container {
        padding: 0 0.5rem;
    }

    .message-block {
        margin-bottom: 1.25rem;
    }

    .analysis-box {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Sections */
    .truth-section, .summary-section {
        padding: 15px;
        font-size: 14px;
    }

    .truth-section h4, .summary-section h4 {
        font-size: 1.1rem;
    }

    /* Share buttons */
    .share-btn {
        margin-top: 20px;
    }

    .share-btn .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .share-btn .btn:last-child {
        margin-bottom: 0;
    }

    .share-btn .me-2 {
        margin-right: 0 !important;
    }

    /* Navbar */
    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar {
        margin-bottom: 2rem !important;
    }

    /* Badges */
    .badge-interest, .badge-avoidance {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    /* Login page */
    .col-md-5 {
        padding: 0 1rem;
    }

    /* Alerts */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    /* Loading message */
    #loadingMessage {
        font-size: 0.9rem;
    }

    #loadingMessage .small {
        font-size: 0.8rem !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card-body {
        padding: 1.25rem 0.875rem;
    }

    .card h2 {
        font-size: 1.35rem;
    }

    textarea.form-control {
        min-height: 130px;
    }

    .msg {
        max-width: 90%;
        padding: 10px 14px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    textarea.form-control {
        min-height: 100px;
    }

    .card h1 {
        font-size: 2rem !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .form-control, .form-select {
        min-height: 44px;
    }

    /* Better spacing for touch */
    .form-control, .form-select, .btn {
        margin-bottom: 0.75rem;
    }
}

/* ========== LANDING PAGE STYLES ========== */

/* Hide sidebar and adjust layout for landing page */
.landing-page .sidebar {
    display: none !important;
}

.landing-page .mobile-menu-btn {
    display: none !important;
}

.landing-page .main-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.landing-page .app-container {
    display: block;
}

/* Landing page container */
.landing {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Section spacing */
.landing .section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero section */
.landing .hero {
    padding: 6rem 2rem 5rem;
    background: var(--primary-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

.landing .hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.landing .hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 0;
}

.landing .hero > * {
    position: relative;
    z-index: 1;
}

.landing .hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: white;
}

.landing .hero h1 strong {
    font-weight: 900;
    text-decoration: underline;
    text-decoration-thickness: 4px;
    text-underline-offset: 6px;
}

.landing .hero .subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
    font-weight: 300;
}

.landing .hero-points {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 3rem;
    font-weight: 400;
}

.landing .cta-group {
    margin-top: 2.5rem;
}

.landing .cta-group .btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    background: white;
    color: var(--primary-color);
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.landing .cta-group .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .landing .cta-group .btn {
    background: white;
    color: #d4925f;
}

.landing .micro-copy {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Empathy section */
.landing .empathy {
    background: var(--bg-secondary);
    text-align: center;
}

.landing .empathy-quote {
    font-size: 1.8rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.landing .empathy p:last-child {
    font-size: 1.2rem;
    color: var(--text-primary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* How it works section */
.landing .how-it-works {
    background: var(--bg-primary);
    text-align: center;
}

.landing .how-it-works h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing .steps {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.landing .step {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    text-align: center;
}

.landing .step-number {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

[data-theme="dark"] .landing .step-number {
    box-shadow: 0 4px 15px rgba(198, 125, 78, 0.4);
}

.landing .step p {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Features section */
.landing .features {
    background: var(--bg-secondary);
}

.landing .feature {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px var(--card-shadow);
    transition: all 0.3s ease;
}

.landing .feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px var(--shadow-color);
}

.landing .feature h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.landing .feature p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.landing .feature-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

.landing .feature .link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--link-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.landing .feature .link:hover {
    color: var(--link-hover);
    transform: translateX(5px);
}

/* Use cases section */
.landing .use-cases {
    background: var(--bg-primary);
    text-align: center;
}

.landing .use-cases h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.landing .use-case-list {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.landing .use-case-list li {
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--card-shadow);
    font-style: italic;
    transition: all 0.2s ease;
}

.landing .use-case-list li:hover {
    transform: translateX(10px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

/* Privacy section */
.landing .privacy {
    background: var(--bg-secondary);
    text-align: center;
}

.landing .privacy h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.landing .privacy-list {
    list-style: none;
    padding: 0;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.landing .privacy-list li {
    font-size: 1.2rem;
    color: var(--text-primary);
    padding: 0.75rem 0;
    font-weight: 500;
}

.landing .privacy-list li::before {
    content: "✓ ";
    color: var(--success-color);
    font-weight: 700;
    margin-right: 0.5rem;
}

.landing .privacy-note {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 600;
}

/* Pricing section */
.landing .pricing {
    background: var(--bg-primary);
    text-align: center;
}

.landing .pricing h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing .pricing-points {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
    font-size: 1.2rem;
}

.landing .pricing-points li {
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-weight: 500;
}

.landing .price-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    box-shadow: 0 10px 40px var(--card-shadow);
}

.landing .price {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.landing .price strong {
    font-size: 2.0rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing .price-note {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Final CTA section */
.landing .final-cta {
    background: var(--primary-gradient);
    color: white;
    padding: 5rem 2rem;
}

.landing .final-cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.landing .final-cta p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2.5rem;
}

.landing .btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.3rem;
    background: white;
    color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.landing .btn-large:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .landing .btn-large {
    color: #d4925f;
}

/* Secondary button style for landing */
.landing .btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
}

.landing .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
    background: var(--accent-gradient);
}

[data-theme="dark"] .landing .btn-secondary {
    box-shadow: 0 4px 15px rgba(212, 146, 95, 0.4);
}

[data-theme="dark"] .landing .btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(212, 146, 95, 0.6);
}

/* Mobile responsive for landing */
@media (max-width: 768px) {
    .landing .section {
        padding: 3rem 1.5rem;
    }

    .landing .hero {
        padding: 4rem 1.5rem 3rem;
    }

    .landing .hero h1 {
        font-size: 2.5rem;
    }

    .landing .hero .subtitle {
        font-size: 1.2rem;
    }

    .landing .hero-points {
        font-size: 1rem;
    }

    .landing .cta-group .btn {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
        width: 100%;
    }

    .landing .empathy-quote {
        font-size: 1.3rem;
    }

    .landing .empathy p:last-child {
        font-size: 1.05rem;
    }

    .landing .how-it-works h2,
    .landing .use-cases h2,
    .landing .privacy h2,
    .landing .pricing h2 {
        font-size: 2rem;
    }

    .landing .steps {
        flex-direction: column;
        gap: 1.5rem;
    }

    .landing .step {
        max-width: 100%;
    }

    .landing .feature {
        padding: 1.5rem;
    }

    .landing .feature h3 {
        font-size: 1.5rem;
    }

    .landing .feature p {
        font-size: 1rem;
    }

    .landing .use-case-list li {
        font-size: 1.05rem;
        padding: 0.875rem 1.25rem;
    }

    .landing .final-cta {
        padding: 3rem 1.5rem;
    }

    .landing .final-cta h2 {
        font-size: 1.8rem;
    }

    .landing .final-cta p {
        font-size: 1.1rem;
    }

    .landing .btn-large {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .landing .hero h1 {
        font-size: 2rem;
    }

    .landing .hero .subtitle {
        font-size: 1.1rem;
    }

    .landing .step-number {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.5rem;
    }

    .landing .feature {
        padding: 1.25rem;
    }

    .landing .price-box {
        padding: 1.5rem;
    }
}

/* ========== COOKIE CONSENT BANNER ========== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-text strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cookie-consent-actions {
    flex-shrink: 0;
}

.cookie-consent-actions .btn {
    white-space: nowrap;
    padding: 0.75rem 2rem;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1.5rem;
        gap: 1rem;
    }

    .cookie-consent-text strong {
        font-size: 1rem;
    }

    .cookie-consent-text p {
        font-size: 0.875rem;
    }

    .cookie-consent-actions {
        width: 100%;
    }

    .cookie-consent-actions .btn {
        width: 100%;
        padding: 0.875rem;
    }
}

/* Dark theme support */
[data-theme="dark"] .cookie-consent {
    background: var(--card-bg);
    border-top-color: var(--primary-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}
