*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #03040b;
    --card-bg: rgba(5, 7, 20, 0.75);
    --accent-color: #00f3ff;
    --accent-hover: #00c3ff;
    --accent-secondary: #bc13fe;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --consensus-bg: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --glass-border: 1px solid rgba(0, 243, 255, 0.2);
    --glass-shadow: 0 0 50px rgba(0, 243, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.05);
    --glow-color: rgba(0, 243, 255, 0.6);
    --gradient-1: linear-gradient(135deg, #00f3ff 0%, #0066ff 100%);
    --gradient-2: linear-gradient(135deg, #bc13fe 0%, #7d00fa 100%);
    --gradient-3: linear-gradient(135deg, #00d4ff 0%, #ff006e 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Prevent body scroll */
}

body {
    font-family: 'Inter', sans-serif;
    background: #03040b;
    color: var(--text-primary);
}

/* Starfield Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(white, rgba(255, 255, 255, .3) 2px, transparent 4px),
        radial-gradient(white, rgba(255, 255, 255, .2) 1px, transparent 2px),
        radial-gradient(white, rgba(255, 255, 255, .15) 2px, transparent 3px);
    background-size: 650px 650px, 400px 400px, 300px 300px;
    background-position: 0 0, 80px 100px, 200px 400px;
    animation: starsMove 180s linear infinite;
    z-index: 0;
    opacity: 0.8;
}

/* Nebula Clouds */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 70% 30%, rgba(188, 19, 254, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 20% 70%, rgba(0, 243, 255, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(0, 102, 255, 0.10) 0%, transparent 70%);
    z-index: 0;
    filter: blur(80px);
}

@keyframes starsMove {
    from {
        background-position: 0 0, 40px 60px, 130px 270px;
    }

    to {
        background-position: 550px 550px, 390px 410px, 680px 820px;
    }
}

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
}

/* Split Screen Auth Container */
.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* Left Side - Branding & Features */
.auth-left {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    border-right: 1px solid rgba(0, 243, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.05) 0%, transparent 60%);
    z-index: 0;
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.8);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Branding Section */
.auth-branding {
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2), inset 0 0 20px rgba(0, 243, 255, 0.1);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
        box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    }

    50% {
        transform: translateY(-15px);
        box-shadow: 0 0 50px rgba(0, 243, 255, 0.4);
    }
}

.brand-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    background: none;
    -webkit-text-fill-color: white;
}

.brand-tagline {
    font-size: 1.1rem;
    color: #a0a0ff;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Features Showcase */
.features-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feature-item:hover {
    background: rgba(0, 243, 255, 0.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
    transform: translateX(10px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.feature-content h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    color: white;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.feature-content p {
    margin: 0;
    color: #bac4e3;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Stats Section */
.auth-stats {
    display: flex;
    justify-content: space-around;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(0, 243, 255, 0.1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
    background: none;
    -webkit-text-fill-color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #a0a0ff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Quote Section */
.auth-quote {
    position: relative;
    padding: 2rem;
    text-align: center;
    z-index: 1;
}

.quote-icon {
    font-size: 2rem;
    color: var(--accent-secondary);
    opacity: 0.6;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(188, 19, 254, 0.5);
}

.quote-text {
    font-size: 1.2rem;
    font-style: italic;
    color: #e2e8f0;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.quote-author {
    font-size: 0.9rem;
    color: var(--accent-hover);
}

/* Right Side - Form */
.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    z-index: 2;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 20, 0.7);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 243, 255, 0.05);
    color: var(--text-primary);
    animation: fadeUp 0.6s ease-out forwards;
    position: relative;
    overflow: hidden;
}

/* Holographic Edge Effect */
.auth-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.5;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, #00f3ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
    animation: gradientText 3s ease infinite;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

@keyframes gradientText {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

/* Input Styles */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.input-wrapper:hover {
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: transparent;
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: none;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0, 243, 255, 0.05);
    background: rgba(0, 243, 255, 0.02);
}

input:focus+i,
.input-wrapper:focus-within i {
    color: var(--accent-color);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Button Styles */
.auth-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(90deg, #00f3ff, #0066ff);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    border-radius: 0;
    transform: none;
}

.auth-btn:hover::before {
    left: 100%;
    width: 100%;
    height: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.5);
    background: linear-gradient(90deg, #00c3ff, #0055dd);
}

.auth-btn span,
.auth-btn i {
    position: relative;
    z-index: 1;
}

/* Benefit Badges */
.auth-benefits {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.benefit-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 500;
}

.benefit-badge i {
    font-size: 0.9rem;
}

.auth-footer {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 968px) {

    html,
    body {
        overflow-y: auto;
    }

    .auth-container {
        flex-direction: column;
    }

    .auth-left {
        border-right: none;
        border-bottom: 2px solid rgba(0, 212, 255, 0.2);
        padding: 3rem 2rem;
    }

    .auth-right {
        padding: 2rem;
    }

    .brand-title {
        font-size: 2rem;
    }

    .features-showcase {
        gap: 1rem;
    }

    .auth-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}


/* Messages */
.error-message,
.success-message {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-message {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Main App Styles */
header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff 0%, #ff006e 50%, #00f0ff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    animation: gradientText 4s ease infinite;
    text-shadow: 0 0 40px var(--glow-color);
}

header .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.search-box {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.animated-placeholder {
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.animated-placeholder.hidden {
    opacity: 0;
}

.placeholder-text {
    font-size: 1.05rem;
    background: linear-gradient(135deg, #00d4ff, #ff006e, #00f0ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s ease infinite;
}

.typing-cursor {
    color: var(--accent-color);
    font-size: 1.2rem;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

#questionInput {
    width: 100%;
    padding: 1.25rem 1.75rem;
    border-radius: 16px;
    border: 2px solid rgba(0, 212, 255, 0.2);
    background: var(--input-bg);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#questionInput:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px var(--glow-color), 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

#askBtn {
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    border: none;
    background: var(--gradient-3);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#askBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#askBtn:hover::before {
    width: 300px;
    height: 300px;
}

#askBtn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(79, 172, 254, 0.6);
}

#askBtn:active {
    transform: translateY(-1px) scale(0.98);
}

#askBtn span,
#askBtn i {
    position: relative;
    z-index: 1;
}

.new-chat-btn {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 212, 255, 0);
    }
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.loading-spinner.active {
    display: block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.results-area {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.results-area.visible {
    opacity: 1;
    transform: translateY(0);
}

.consensus-card {
    background: var(--consensus-bg);
    padding: 2.5rem;
    border-radius: 24px;
    margin-bottom: 2.5rem;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
}

.consensus-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.model-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-3);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.model-card:hover::before {
    transform: scaleX(1);
}

.model-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.4);
}

.model-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-header::before {
    content: '◆';
    color: var(--accent-secondary);
    font-size: 0.8rem;
}

/* Profile Styles */
.profile-section {
    position: relative;
    /* Changed from absolute to relative/static flow */
    /* top: 1.5rem;  Removed */
    /* right: 2rem; Removed */
    z-index: 100;
    margin-left: auto;
    /* Push to the right if needed, though space-between does it */
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.profile-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 12px;
    width: 180px;
    padding: 0.5rem;
    box-shadow: var(--glass-shadow);
    display: none;
    backdrop-filter: blur(20px);
}

.profile-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--accent-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.profile-modal {
    background: #0f172a;
    /* Solid dark background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.modal-title {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout & Sidebar Styles */
.app-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.history-sidebar {
    width: 280px;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(30px);
    border-right: 2px solid rgba(0, 212, 255, 0.15);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transform: translateX(-100%);
    /* Hidden by default */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
}

.history-sidebar.open {
    transform: translateX(0);
    /* Visible when open */
}

/* Toggle Button used in Header */
.history-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.history-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.main-content {
    flex: 1;
    margin-left: 0;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* Contain chat layout */
    display: flex;
    flex-direction: column;
}

/* Override container for new layout */
.container {
    max-width: 1000px;
    /* Slightly reduced width to fit comfortably */
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Sidebar Elements */
.sidebar-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    gap: 1rem;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    background: var(--gradient-3);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s ease infinite;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--accent-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.icon-btn:hover::before {
    opacity: 1;
}

.icon-btn i {
    position: relative;
    z-index: 1;
}

.icon-btn:hover {
    color: white;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Scrollbar for sidebar */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.history-item {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-align: left;
    position: relative;
}

.history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-3);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
}

.history-item:hover::before {
    height: 60%;
}

.history-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: white;
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.history-item.active {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-color);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    font-weight: 600;
}

.history-placeholder {
    color: #4b5563;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.clear-history-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 0, 110, 0.3);
    background: rgba(255, 0, 110, 0.1);
    color: var(--accent-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.clear-history-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clear-history-btn:hover::before {
    opacity: 1;
}

.clear-history-btn:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 110, 0.3);
}

.clear-history-btn i,
.clear-history-btn span {
    position: relative;
    z-index: 1;
}

.clear-history-btn:hover {
    color: white;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    background: var(--card-bg);
    border: var(--glass-border);
    color: var(--accent-color);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: scale(1.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Close Button */
.sidebar-close-btn {
    display: flex;
    /* Always visible to allow closing */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .history-sidebar {
        /* On smaller screens, maybe hide it or off-canvas? For now, simple stack or keep. */
    }
}

/* Tablet and Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Show sidebar close button */
    .sidebar-close-btn {
        display: flex;
    }

    /* Sidebar - Hidden by default on mobile, slides in from left */
    .history-sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 50;
    }

    .history-sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Container padding adjustment */
    .container {
        padding: 1.5rem 1rem;
        max-width: 100%;
    }

    /* Header adjustments */
    header h1 {
        font-size: 2rem;
        text-align: center;
    }

    header .subtitle {
        font-size: 0.95rem;
        text-align: center;
        margin-bottom: 2rem;
    }

    /* Profile section positioning */
    .profile-section {
        /* Reset positioning */
        margin-left: auto;
    }

    .profile-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Model selector dropdown */
    .model-dropdown-container {
        max-width: 100%;
    }

    .model-dropdown-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .selected-models-display {
        padding: 1rem;
        margin-top: 1rem;
    }

    .model-badge {
        padding: 0.4rem 0.875rem;
        font-size: 0.85rem;
    }

    /* Search box - stack vertically */
    /* Search box - ensure row layout on mobile */
    .search-box {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .search-input-wrapper {
        width: auto;
        flex: 1;
        min-width: 0;
    }

    #askBtn {
        width: auto;
        padding: 0.75rem 1rem;
        justify-content: center;
        flex-shrink: 0;
    }

    .new-chat-btn {
        width: 100%;
        height: 44px;
    }

    /* Results area */
    .consensus-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .consensus-card h2 {
        font-size: 1.5rem;
    }

    /* Model grid - single column on mobile */
    .model-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .model-card {
        padding: 1.5rem;
    }

    /* Auth pages - stack vertically */
    .auth-container {
        flex-direction: column;
    }

    .auth-left {
        border-right: none;
        border-bottom: 2px solid rgba(0, 212, 255, 0.2);
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .auth-right {
        padding: 2rem 1rem;
        flex: 1;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }

    .brand-title {
        font-size: 2rem;
    }

    .brand-tagline {
        font-size: 1rem;
    }

    .features-showcase {
        gap: 1rem;
    }

    .feature-item {
        padding: 1.25rem;
        gap: 1rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.25rem;
    }

    .feature-content h3 {
        font-size: 1rem;
    }

    .feature-content p {
        font-size: 0.9rem;
    }

    .auth-stats {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .quote-text {
        font-size: 1.1rem;
    }

    /* Modal adjustments */
    .profile-modal {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    /* Input adjustments for touch */
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        padding: 1rem 1rem 1rem 2.75rem;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    #questionInput {
        padding: 1rem 1.5rem;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Button touch targets */
    .auth-btn,
    #askBtn,
    .clear-history-btn {
        min-height: 44px;
        /* Minimum touch target size */
    }

    .clear-history-btn span {
        display: none;
        /* Hide text on mobile, icon is enough */
    }

    .clear-history-btn {
        width: 100%;
        justify-content: center;
    }

    /* Sidebar header adjustments */
    .sidebar-header {
        padding-bottom: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .sidebar-header h3 {
        font-size: 1.1rem;
        flex: 1;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    header .subtitle {
        font-size: 0.85rem;
    }

    .consensus-card {
        padding: 1.25rem;
    }

    .consensus-card h2 {
        font-size: 1.25rem;
    }

    .model-card {
        padding: 1.25rem;
    }

    .auth-left {
        padding: 1.5rem 1rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .brand-title {
        font-size: 1.75rem;
    }

    .brand-logo {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .feature-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .feature-icon {
        margin: 0 auto;
    }

    .auth-stats {
        padding: 1rem;
    }

    .stat-item {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .mobile-menu-toggle {
        top: 0.75rem;
        left: 0.75rem;
        width: 40px;
        height: 40px;
    }

    .history-sidebar {
        width: 260px;
    }

    .switch-card {
        padding: 12px 14px;
    }

    .switch-info span {
        font-size: 0.9rem;
    }
}

/* Model Selector Dropdown */
.model-selector-wrapper {
    margin-bottom: 30px;
    animation: slideDown 0.6s ease-out;
}

.model-dropdown-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.model-dropdown-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.model-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}


.model-dropdown-btn span {
    flex: 1;
    text-align: left;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.model-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: var(--glass-shadow);
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    animation: fadeInDown 0.3s ease-out;
}

.model-dropdown-menu.active {
    display: flex;
}

/* Dropdown scrollbar */
.model-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.model-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.model-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.model-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.dropdown-option:hover {
    background: rgba(0, 212, 255, 0.1);
}

.dropdown-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-color);
    flex-shrink: 0;
}

.option-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    flex: 1;
}

.option-content i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.option-content span:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.model-tag {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 10px;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dropdown Groups */
.dropdown-group {
    margin-bottom: 1rem;
}

.dropdown-group:last-child {
    margin-bottom: 0;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.provider-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}

.provider-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
    background: transparent;
}

.badge-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin-right: 0.25rem;
    background: transparent;
    vertical-align: middle;
}

/* Selected Models Display */
.selected-models-display {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.display-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.selected-models-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.model-badge:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.model-badge img {
    vertical-align: middle;
}

.no-models {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

/* Premium Modal Styles */
.premium-modal-card {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(251, 191, 36, 0.1);
    animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-header {
    margin-bottom: 1.5rem;
}

.crown-icon-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.4);
    animation: float 3s ease-in-out infinite;
}

.premium-header h2 {
    font-size: 1.8rem;
    margin: 0;
    background: linear-gradient(135deg, #fbbf24 0%, #fff 50%, #d97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.status-message {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.subscription-details {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item .label {
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.detail-item .value.active-status {
    color: #4ade80;
}

.detail-item .value.highlight {
    color: #fbbf24;
}

.premium-benefits-list {
    text-align: left;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem;
}

.benefit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.benefit i {
    color: #fbbf24;
}

.premium-action-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.premium-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.5);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- New Layout Styles --- */

.chat-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Safer than height 100% in flex parent */
    height: 100%;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.app-header {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.5rem;
    z-index: 50;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
    /* Allow wrap for safety on tablet/small desktop */
}

/* Ensure model dropdown doesn't take unlimited width in flex */
.model-selector-wrapper {
    min-width: 200px;
    flex-shrink: 1;
}

.app-header h1 {
    font-size: 1.5rem;
    margin: 0;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Columns Container */
.chat-columns-container {
    display: flex;
    flex: 1 1 0px;
    /* Magic bullet for flex scrolling */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 1rem;
    gap: 15px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    min-height: 0;
    position: relative;
    /* Ensure z-index works */
    z-index: 10;
    /* Lift above default background but below header/input */
    margin-bottom: 5px;
    /* Separate scrollbar from input area */
}

/* Custom Scrollbar for horizontal scrolling */
.chat-columns-container::-webkit-scrollbar {
    height: 14px;
    /* Larger touch target */
    width: 14px;
    /* For vertical if needed */
}

.chat-columns-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    /* Visible track */
    border-radius: 7px;
}

.chat-columns-container::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    /* Brighter thumb */
    border-radius: 7px;
    border: 3px solid rgba(10, 14, 39, 0.8);
    /* Padding effect */
    background-clip: content-box;
}

.chat-columns-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
    border: 2px solid rgba(10, 14, 39, 0.8);
}

/* Individual Column */
.chat-column {
    min-width: 380px;
    width: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(20, 25, 45, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    /* Ensure clickable */
}

.chat-column:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(20, 25, 45, 0.7);
    transform: translateY(-2px);
}

.chat-column.consensus-col {
    position: sticky;
    left: 0;
    z-index: 10;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    background: rgba(30, 20, 50, 0.95);
    /* High opacity to hide content behind */
    order: -1;
    backdrop-filter: blur(20px);
}

/* Column Header */
.column-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.column-header img.col-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.column-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.column-header .model-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Column Body */
.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    /* Critical for scrolling inside flex item */
}

/* Chat Bubbles within Column */
.chat-message {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    line-height: 1.5;
    font-size: 0.95rem;
    max-width: 100%;
    word-wrap: break-word;
}

.chat-message.user {
    background: rgba(255, 255, 255, 0.05);
    color: #ddd;
    align-self: flex-end;
    border-top-right-radius: 2px;
    margin-bottom: 0.5rem;
}

.chat-message.ai {
    background: rgba(0, 212, 255, 0.05);
    color: #fff;
    border-top-left-radius: 2px;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.consensus-col .chat-message.ai {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Input Area Fixed Bottom */
.input-area {
    padding: 1rem 2rem;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 50;
    flex-shrink: 0;
    width: 100%;
}

.input-area .search-box {
    margin-bottom: 0;
    max-width: 100%;
    animation: none;
}

/* Initial Message */
.initial-message {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    pointer-events: none;
    /* Just checking */
    position: absolute;
    /* Center in container */
    left: 0;
    top: 0;
}

/* Loading in column */
.col-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Profile tweaks for header */
.profile-section {
    margin-left: auto;
    /* Push to right */
}

.model-selector-wrapper {
    margin: 0;
    /* remove old margin */
}

/* Media Queries */
@media (max-width: 768px) {
    .chat-columns-container {
        /* Change to vertical stack */
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        padding-bottom: 120px;
        /* Increased padding for input area */
    }

    .chat-column {
        min-width: 100%;
        width: 100%;
        height: 60vh;
        /* Fixed height for internal scrolling */
        scroll-snap-align: start;
        margin-bottom: 1.5rem;
    }

    .chat-column.consensus-col {
        position: relative;
        /* Disable sticky on mobile as it takes too much width */
        left: auto;
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
        /* reduced shadow */
        background: rgba(30, 20, 50, 0.6);
        order: -1;
    }

    /* Header adjustments */
    .header-content {
        flex-wrap: wrap;
        /* Allow wrapping on small screens */
        gap: 0.5rem;
    }

    .brand h1 {
        font-size: 1.25rem;
        /* Smaller font on mobile */
    }

    /* Fix Send Button Overflow */
    .input-area {
        padding: 0.75rem 0.5rem;
        /* Reduce padding */
    }

    .search-box {
        flex-direction: row;
        /* Keep row layout */
        flex-wrap: nowrap;
        /* Force single line */
        gap: 0.5rem;
        margin-bottom: 0;
    }

    .search-input-wrapper {
        min-width: 0;
        /* Important for flex child to shrink */
        flex: 1;
    }

    #askBtn {
        padding: 0.75rem 1rem;
        /* Smaller button */
        width: auto;
        /* Allow auto width */
        min-width: 44px;
        flex-shrink: 0;
        /* Prevent button from vanishing */
    }
}

/* --- Code Block Styling --- */
.code-block-container {
    background: #1e1e24;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-header {
    background: #2d2d34;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-language {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.copy-code-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.code-block-container pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-block-container code {
    font-family: "Fira Code", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}