body {
    background-color: #2c2c2c;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #f5f5f5;
    overflow-x: hidden;
    transition: background-color 0.5s ease;

}

.logo {
    display: block;
    margin: 0 auto 10px;
    max-width: min(90vw, 550px);
    height: auto;
    align-self: center;
    /* ADD THESE: Base transition properties */
    filter: hue-rotate(0deg) brightness(1);
    transform: scale(1);
    transition: all 0.4s ease;
}

        .form-container {
            width: 90%;
            max-width: 800px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        input[type="text"] {
            width: 70%;
            padding: 30px;
            font-size: 1.1em;
            border: 2px solid #555;
            color: #707070;
            border-color: #aaaaaa;
            background-color: #2c2c2c;
            border-radius: 15px;
            box-sizing: border-box;
            margin-bottom: 15px;
        }
/*textarea {
    width: 70%;
    height: 140px; 
    padding: 10px;
    font-size: 1.1em;
    border: 2px solid #777; /
    border-radius: 12px;
    background-color: #2c2c2c;
    color: #f5f5f5;
    box-sizing: border-box;
    text-align: left;        
    vertical-align: top;      
    resize: vertical;         
}
*/
/* Input container for positioning */
.input-container {
    position: relative;
    width: 70%;
    display: flex;
    align-items: flex-end;
}

/* Fix the textarea - remove width since container controls it */
#search-area .input-container textarea {
    width: 100% !important;
    min-height: 150px;
    max-height: 300px;
    height: auto !important;
    padding: 10px !important;
      padding-right: 10px;
    padding-right: 60px !important;
    margin-bottom: 0 !important;
    border-radius: 10px !important;
    box-sizing: border-box;
    overflow-y: auto;
    line-height: 1.4 !important;
    background: #3b3b3b;
    border: none;
    block-size: 1px;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
}

.conversation-input-area textarea:focus {
    outline: none;
}

#search-area .input-container textarea:focus{
    outline: none;
}

/* Update textarea to accommodate button */
textarea {
    width: 100% !important;
    padding-right: 50px !important;
    margin-bottom: 0 !important;
    resize: none;
}

/* Arrow submit button */
.submit-arrow {
    position: absolute;
    right: 12px; /* Account for border radius */
    bottom: 12px; /* Account for border radius */
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px;
    border: none;
    background-color: #555;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    z-index: 2;
}
.submit-arrow:hover:not(:disabled) {
    background-color: #666;
    color: #fff;
}

.submit-arrow:disabled {
    background-color: #333;
    color: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

.submit-arrow:active:not(:disabled) {
    transform: scale(0.95);
}

/* Nuclear mode compatibility */
body.nuclear-mode .submit-arrow {
    background-color: #6d0000;
    color: #ff6666;
}

body.nuclear-mode .submit-arrow:hover:not(:disabled) {
    background-color: #8d0000;
    color: #ff8888;
}

/* Unhinged mode compatibility */
body.unhinged-mode .submit-arrow {
    background-color: #610181;
    color: #8d00bc;
}

body.unhinged-mode .submit-arrow:hover:not(:disabled) {
    background-color: #7800a0;
    color: #a566c2;
}


html, body { height: 100%; }
body.unhinged-mode { overflow: hidden; }

#search-area .form-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;              /* centers the container */
  display: flex;
  flex-direction: column;
  align-items: center;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Add this for the glow effect */
@keyframes glowPulse {
    0%, 100% { opacity: 0.7; text-shadow: 0 0 2px #f3f3f3, 0 0 4px #f3f3f3; }
    50% { opacity: 1; text-shadow: 0 0 4px #f3f3f3, 0 0 8px #f3f3f3, 0 0 12px #f3f3f3; }
}
#search-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    padding-bottom: 60px;
    width: 100%;                /* ADDED */
}



#loading-message span.glitch-text {
    animation: glitchFlash 0.5s ease-in-out, glowPulse 1.2s infinite;
    color: #fff !important;
}

#loading-message span.glitch-text {
    animation: glitchFlash 0.5s ease-in-out, glowPulse 1.2s infinite;
    color: #fff !important;
}
.spinner.glitching {
    animation: spin 1.2s linear infinite, electricalSurge 2.5s infinite;
}
.spinner.glitching {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                0 0 40px rgba(255, 255, 255, 0.3),
                0 0 60px rgba(255, 255, 255, 0.1);
    animation: glitchSpin 1.2s linear infinite;
}
@keyframes electricalSurge {
    0%   { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
    10%  { transform: scale(1.1) rotate(5deg); opacity: 0.8; filter: brightness(1.4); }
    15%  { transform: scale(1) rotate(-3deg); opacity: 0.9; filter: brightness(0.8); }
    20%  { transform: scale(1.05) rotate(2deg); opacity: 0.6; filter: brightness(1.3); }
    30%  { transform: scale(0.95) rotate(0deg); opacity: 1; filter: brightness(1); }
    50%  { transform: scale(1.2) rotate(6deg); opacity: 0.7; filter: brightness(1.6); }
    55%  { transform: scale(1) rotate(-4deg); opacity: 0.9; filter: brightness(0.6); }
    70%  { transform: scale(1.05) rotate(1deg); opacity: 1; filter: brightness(1.2); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1); }
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(44, 44, 44, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner-text {
    margin-top: 30px; /* Space below spinner */
    font-size: 0.70em;
    text-align: center;
    font-family: "Segoe UI", sans-serif;
    color: #f3f3f3;
    animation: glowPulse 1.2s infinite;
    text-shadow: 0 0 2px #f3f3f3, 0 0 4px #f3f3f3;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #777;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.2s linear infinite;
}

@keyframes glitchSpin {
    0%   { transform: rotate(0deg) scale(1); }
    10%  { transform: rotate(30deg) scale(1.05); }
    20%  { transform: rotate(28deg) scale(0.98); }
    30%  { transform: rotate(70deg) scale(1); }
    40%  { transform: rotate(68deg) scale(1.03); }
    50%  { transform: rotate(120deg) scale(0.97); }
    60%  { transform: rotate(180deg) scale(1.05); }
    70%  { transform: rotate(240deg) scale(1); }
    80%  { transform: rotate(300deg) scale(1.02); }
    90%  { transform: rotate(350deg) scale(1); }
    100% { transform: rotate(360deg) scale(1); }
}

.glitch-container {
    font-family: "Segoe UI", sans-serif;
    font-size: 1.5em;
    color: #ccc;
    margin-top: 20px;
    text-align: center;
    min-height: 1.5em; /* prevents layout shift */
}

.glitch-text {
    animation: glitchFlash 0.5s ease-in-out;
}

@keyframes glitchFlash {
    0%   { opacity: 1; transform: none; }
    10%  { opacity: 0; transform: translateX(-2px); }
    20%  { opacity: 1; transform: translateX(2px); }
    30%  { opacity: 0; transform: translateX(-1px); }
    40%  { opacity: 1; transform: translateX(1px); }
    50%  { opacity: 0; transform: translateY(1px); }
    60%  { opacity: 1; transform: none; }
    100% { opacity: 1; transform: none; }
}


#results-container {
    transition: opacity 0.3s ease;
    justify-content: center;
}



        button {
            width: 70%;
            padding: 15px;
            margin-top: 20px;
            font-size: 0.80em;
            background-color: #787878;
            color: #777;
            background-color: #2c2c2c;
            border: 2px solid #777;
            border-radius: 12px;
            
            cursor: pointer;
        }

        button:hover {
            
            color: white;

        
        }

        .results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;         /* Center the boxes horizontally */
    align-items: flex-start;
    gap: 20px;                       /* More space between columns */
    margin: 100px auto 0;           /* Bigger gap from search bar */
    width: 90%;
    max-width: 1200px;
    padding: 0 30px;
    align-items: stretch;
}

.result-box {
    background-color: #3f3f3f;
    flex: 1;
    min-width: 250px;           /* Minimum width before wrapping */
    max-width: 320px;
    padding: 20px;
    border-radius: 15px;
    overflow-y: auto;
    min-height: 200px;              /* Taller boxes */
    font-size: 1.0em;               /* Larger text */
    line-height: 1.6;  
    width: 80%; 
    box-sizing: border-box;
    word-break: break-word;
    white-space: normal; 
    flex-direction: column;           /* Better readability */
}

@media (max-width: 1200px) {
    .critique-text {
        flex-direction: column;
        align-items: center;
    }
    
    .result-box {
        max-width: 320px;
        width: 95%;
        padding: 25px;
    }
}


.results_wrapper.visible {
  display: flex;
}

.results_wrapper {
    width: 90%;
    display: none;
    justify-content: center;
    margin: 100px auto 0;  

}
.results-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
}
.results-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap; /* Wrap on small screens */
  margin-top: 40px;
}

.result-box h3 {
  margin-top: 0;
  font-size: 1.2em;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.result-box h4 {
  margin-top: 0;
  font-size: 1.0em;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}
.critique-text p {
  font-size: 1.1em; /* or adjust as needed */
  line-height: 1.0;
  color: #ccc;
}


.result-box p {
    color: #ccc;
    font-size: 1.0em;
}

.shrunk {
    transform: scale(0.8);
    opacity: 0.6;
    transition: all 0.6s ease-in-out;
}
#results {
    margin-top: 100px;
}

.critique-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #555;
}

.critique-text-content {
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 12px;
    text-align: left;
}
.critique-bullet {
    background-color: #2a2a2a;
    color: #ccc;
    padding: 12px 15px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 1.2rem;
    margin-top: 10px;
    line-height: 1.5;
  }
.critique-item h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #e0e0e0;
    padding: 8px 12px;
    background-color: #4a4a4a;
    border-radius: 6px;
}

#critique-results {
    display: flex;
    background-color: #3f3f3f;
    padding: 25px;
    padding-top: 0px !important;
    border-radius: 12px;
    max-width: 1000;
    margin: auto;
    font-size: 1.2em;
    color: #ddd;
    white-space: pre-line;
    margin-bottom: 15px;
}
.critique-results {
  gap: 40px;
  margin-top: 100px;
  width: 70%;
  max-width: 500;
  padding:  40px;
  box-sizing: border-box;
}
.critique_wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}
#critique-results .result-box {
    display: flex;
    background-color: #3f3f3f;
    border-radius: 15px;
    margin-top: 30px;
    font-size: 1.0em;
    width: 70%;
    color: #ddd;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}
.nuclear-toggle {
    margin-top: 30px;
    padding: 10px 20px;
    font-size: 0.95em;
    background-color: transparent;
    color: #f33;
    border: 1px solid #f33;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nuclear-toggle:hover {
    background-color: #f33;
    color: #fff;
}
body.nuclear-mode {
    background-color: #1a0000 !important;
}
/* Body background + text color */
body.unhinged-mode {
    background-color: #2e003e; /* chaos purple */
    color: #ffea00;           /* acid yellow text */
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Textarea styles */
body.unhinged-mode textarea {
    background-color: rgb(34, 0, 44); /* match body */
    border: 2px solid rgb(34, 0, 44);
    color: #8d00bc;
}

/* Button styles */
body.unhinged-mode button {
    background-color: rgb(34, 0, 44); /* match body */
    border: 2px solid rgb(34, 0, 44);
    color: #610181;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.unhinged-mode button:hover {
    background-color: #ffea00;
    color: rgb(34, 0, 44);
}

/* Placeholder text */
body.unhinged-mode textarea::placeholder {
    color: #7800a0;
}
body.unhinged-mode .steve-banner {
    background-color: #4a1a6d; /* darker purple */
    color: #a566c2;           /* slightly darker purple text */
    border-bottom: 2px solid #3b1456; /* even darker bottom border */
}
body.unhinged-mode textarea:focus,
body.unhinged-mode input:focus {
    border-color: #2e003e; /* bright cyan */
    box-shadow: 0 0 8px #1b0024;
    outline: none; /* remove browser default outline */
}





body.nuclear-mode .steve-banner {
    background-color: #3b0000;
    color: #6d0000;
    border-bottom: 2px solid #000000;
    letter-spacing: 1px;
}
.nuclear-mode .logo {
    filter: hue-rotate(-45deg) brightness(0.9);
    transform: scale(1.05);
    transition: all 0.4s ease;
}

.critique-text {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 30px;
    padding-top: 0px !important;
}
#search-area, #results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}



#critique-loading-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 5px;
    width: 0%;
    background: #777;
    z-index: 9999;
    transition: width 0.3s ease-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

body.nuclear-mode #critique-loading-bar {
    background: linear-gradient(90deg, #310000, #5e0000);
}

body:not(.critiquing) #critique-loading-bar {
    opacity: 0;
}
body.critiquing #critique-loading-bar {
    opacity: 1;
}


/* Animation */
@keyframes spin-border {
    to {
        transform: rotate(360deg);
    }
}
#critique-loading-text {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6em;
    font-style: italic;
    color: #999;
    opacity: 0;
    display: none;
    transition: opacity 0.5s ease-in-out;
    z-index: 9999;
    pointer-events: none;
}

body.nuclear-mode #critique-loading-text {
    color: #ffaaaa;
}

.steve-banner {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100vw;             /* full viewport width */
  left: 0;                  /* ensure it spans edge-to-edge */
  text-align: center;
  padding: 4px 0;
  font-weight: bold;
  font-size: 0.8em;
  color: #8f8f8f;
  background-color: #2f2f2f;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;    /* include border in width */
}

@keyframes subtleFlash {
    0%   { opacity: 0.2; }
    50%  { opacity: 1; }
    100% { opacity: 0.2; }
}

body.critiquing #critique-loading-text {
    animation: subtleFlash 2.5s infinite ease-in-out;
    display: block;
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

#chat-input-area {
    display: flex;
    border-top: 1px solid #ccc;
    padding: 10px;
    background-color: var(--bg-color, white);
}

#chat-textarea {
    flex: 1;
    resize: none;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-right: 8px;
    background: #3b3a3b
}

#chat-send-btn {
    padding: 8px 16px;
    border: none;
    background-color: purple;
    color: white;
    border-radius: 8px;
}

.chat-messages { flex:1; overflow-y:auto; padding:16px 16px 90px; }

.message { display:flex; margin: 10px 0; }
.message .bubble {
  max-width: 70ch;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.5;
  word-wrap: break-word;
}

/* Right-aligned user bubble */
.message.user { justify-content: flex-end; }
.message.user .bubble {
  background: #3f3f3f; color:#eee; border-left: 0; border: 2px solid #777;
}

/* Left-aligned assistant bubble */
.message.assistant { justify-content: flex-start; }
.message.assistant .bubble {
  background: #2f2f2f; color:#ddd; border-left: 3px solid #777;
}

/* Unhinged colors for fun */
body.unhinged-mode .message.user .bubble {
  background: rgba(34,0,44,0.6); color:#ffea00; border:2px solid #610181;
}
body.unhinged-mode .message.assistant .bubble {
  background: rgba(34,0,44,0.35); color:#ffea00; border-left:3px solid #8d00bc;
}



#auth-area {
  display: flex;
  align-items: center;
  min-width: 120px;       /* reserve space so it doesn’t shove things around */
  justify-content: flex-end;
}


 /* Enhanced Sidebar Styles */
 .sidebar {
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            width: 60px;
              /* start hidden */

            background-color: #323232;
            transition: width 0.3s ease;
            overflow: hidden;
            z-index: 1000;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
            
        }

        .sidebar.expanded {
            width: 250px;
            background-color: #1a1a1a;
        }

        /* Menu Toggle Button */
        #toggle-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 60px;
            width: 60px;
            background-color: #323232;
            border: none;
            cursor: pointer;
            border-radius: 50%;  
            color: rgb(159, 159, 159);
            font-size: 20px;
            transition: transform 0.3s ease;
            margin: 0;
            padding: 0;

        }

        #toggle-btn:hover {
            background-color: #333;
        }
        #toggle-btn.extended{
            background-color: #1a1a1a; 
        }
        .sidebar.expanded #toggle-btn {
    transform: translateX(175px);
    background-color: rgba(26, 26, 26, 0.8);  /* ← NEW: Dark background to blend with menu */
    transition: transform 0.3s ease;
}


        /* Hamburger Icon */
        .hamburger {
            display: flex;
            flex-direction: column;
            width: 24px;
            height: 18px;
        }

        .hamburger span {
            width: 100%;
            height: 2px;
            background-color: rgb(123, 123, 123);
            margin: 2px 0;
            transition: 0.3s;
            transform-origin: center;
        }




        /* Navigation Styles */
        .sidebar nav {
            margin-top: 20px;
        }

        .sidebar ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .sidebar li {
            margin: 0;
        }

        .sidebar.expanded #toggle-btn {
    transform: translateX(175px);  /* ← NEW: Slides button 175px to the right */
}

        .sidebar a {
            display: flex;
            align-items: center;
            left: -250px;
            color: #595959;
            text-decoration: none;
            /*transition: left 0.3s ease;*/
            white-space: nowrap;
            font-family: inherit;
            padding: 6px 10px;         /* slimmer left/right */
  margin: 3px 8px;           /* subtle space from edges */
            border-radius: 4px;
            z-index: 2000;        
        }

        .sidebar a:hover {
            background-color: #242424; /* only a slight dark shift */
             /* text pops to white on hover */
}

        .sidebar a.active {
            background-color: #3a3a3a;
            color: #d1d0d0;              /* white text for contrast */
  font-weight: 500;            
        }

        .menu-icon {
            min-width: 20px;
            margin-right: 15px;
            font-size: 18px;
            text-align: center;
        }

        .menu-text {
            opacity: 0;
            transition: opacity 0.3s ease;
            font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
        }

        .sidebar.expanded .menu-text {
            opacity: 1;
        }

        /* Main Content Area */
        .main-content {
            margin-left: 0px;
            transition: filter 0.3s ease;
            min-height: 100vh;
            position: relative;
        }

       

        /* Responsive Design */
        @media (max-width: 768px) {
            .sidebar {
                width: 0;
                transform: translateX(-100%);
            }

            .sidebar.expanded {
                width: 250px;
                transform: translateX(0);
                left: 0;
            }

            .main-content {
                margin-left: 0;
            }

            .sidebar.expanded + .main-content {
                margin-left: 0;
            }
        }
        .sidebar.expanded .hamburger span:nth-child(1) {
    opacity: 0;                    /* ← NEW: Fades out completely */
    transform: translateY(8px);    /* ← NEW: Moves down toward center */
}

/* CHANGED: Middle line stays visible (becomes the minus) */
.sidebar.expanded .hamburger span:nth-child(2) {
    transform: scaleX(1);          /* ← NEW: Stays as horizontal line */
}

/* CHANGED: Bottom line fades away and moves up */
.sidebar.expanded .hamburger span:nth-child(3) {
    opacity: 0;                    /* ← NEW: Fades out completely */
    transform: translateY(-8px);   /* ← NEW: Moves up toward center */
}
.sidebar.expanded .hamburger span {
    color: white;          /* ← NEW: Stays as horizontal line */
}
.sidebar:not(.expanded) a {
    pointer-events: none;  /* Prevents clicking */
    cursor: default;       /* Shows default cursor instead of pointer */
    opacity: 0.3;          /* Visual indication that items are disabled */
}
.sidebar:not(.expanded) a.active {
    background-color: transparent;  /* Removes active styling when retracted */
}

.sidebar-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  padding: 12px 20px;          /* ← matches your nav item padding */
  border-top: 1px solid #3a3a3a;
  background-color: #323232;   /* ← collapsed bg */
  transition: background-color 0.3s ease;
}

/* Center when collapsed, align left when expanded */
.sidebar:not(.expanded) .sidebar-footer { 
    justify-content: center; 
    padding: 12px;
}
.sidebar.expanded .sidebar-footer {
  background-color: #1a1a1a;   /* ← matches expanded bg */
}



/* Make sure the Clerk button is clickable even when links are disabled collapsed */

.sidebar:not(.expanded) .sidebar-footer .user-label { display: none; }

/* Keep nav from overlapping the footer’s space on long menus */
.sidebar nav { padding-bottom: 70px; }

.sidebar-footer .user-label {
  font-size: inherit;
  color: #707070;
  white-space: nowrap;
  opacity: 0;
}

.user-label:hover {
    color: #707070 !important;
}

#clerk-user-button {
  width: 32px;
  height: 32px;
  min-width: 32px;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}


.subscription-status {
    padding: 10px 16px;
    border-bottom: 1px solid #3a3a3a;
    font-size: 14px;
    color: #e5e5e5;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: opacity .2s ease;

  pointer-events: none;

  /* animate both height and opacity */
  transition: max-height .2s ease, opacity .2s ease;
}

.subscription-tier{
    color: white;
}
.subscription-status.hidden {
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    max-height: 0;
  }
  
  .subscription-status.visible {
    opacity: 1;
    pointer-events: auto;
  }


.sidebar.expanded .subscription-status[data-ready="1"] {
    max-height: 58px;             /* your compact row height */
  opacity: 1;
  display: block;

  /* delay the fade until after the sidebar width anim (~0.3s) */
  transition-delay: 0s, .3s;    /* first delay for height, second for opacity */
  pointer-events: auto;
}

.sidebar:not(.expanded) .subscription-status {
    display: none;
  }
  
  .sidebar.expanded .subscription-status {
    display: block; /* or flex, whatever you prefer */
  }


  .top-right-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(63, 63, 63, 0.95);
    border: 1px solid #555;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-right-toggle:hover {
    background: rgba(79, 79, 79, 0.95);
    border-color: #777;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}


.toggle-label {
    font-size: 0.85em;
    color: #ccc;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    user-select: none;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #444;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #555;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Active state */
.toggle-switch.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(102, 126, 234, 0.3);
}

.toggle-switch.active::before {
    transform: translateX(24px);
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active + .toggle-label {
    color: #fff;
}

/* Pulse animation on click */
.toggle-switch.pulse {
    animation: togglePulse 0.3s ease-out;
}

@keyframes togglePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .top-right-toggle {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        gap: 8px;
    }
    
    .toggle-label {
        font-size: 0.8em;
    }
    
    .toggle-switch {
        width: 44px;
        height: 24px;
    }
    
    .toggle-switch::before {
        width: 18px;
        height: 18px;
    }
    
    .toggle-switch.active::before {
        transform: translateX(20px);
    }
}

/* Nuclear mode compatibility */
body.nuclear-mode .top-right-toggle {
    background: rgba(59, 0, 0, 0.95);
    border-color: #6d0000;
}

body.nuclear-mode .toggle-switch.active {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border-color: #ff4444;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 68, 68, 0.3);
}

/* Unhinged mode compatibility */
body.unhinged-mode .top-right-toggle {
    background: rgba(34, 0, 44, 0.95);
    border-color: #610181;
}

body.unhinged-mode .toggle-switch.active {
    background: linear-gradient(135deg, #8d00bc, #610181);
    border-color: #8d00bc;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(141, 0, 188, 0.3);
}

body.unhinged-mode .toggle-label {
    color: #ffea00;
}

/* Demo content */
.demo-content {
    padding: 100px 20px 20px;
    text-align: center;
}

.mode-indicator {
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(63, 63, 63, 0.5);
    border-radius: 8px;
    display: inline-block;
}

.rate-limit-error {
    background: linear-gradient(135deg, #3a1f1f, #2d1a1a);
    border: 2px solid #ff6b6b;
    border-radius: 15px;
    padding: 30px;
    margin: 40px auto;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.2);
    animation: errorPulse 2s ease-in-out infinite;
}

.rate-limit-error h3 {
    color: #ff8a8a;
    font-size: 1.4em;
    margin: 0 0 15px 0;
    text-align: center;
}

.rate-limit-error p {
    color: #ffcccc;
    font-size: 1.1em;
    text-align: center;
    margin: 10px 0;
    line-height: 1.5;
}

.rate-limit-error .upgrade-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.rate-limit-error .upgrade-btn:hover {
    background: linear-gradient(135deg, #ff5252, #e57373);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

@keyframes errorPulse {
    0%, 100% { border-color: #ff6b6b; box-shadow: 0 8px 32px rgba(255, 107, 107, 0.2); }
    50% { border-color: #ff8a8a; box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4); }
}

/* Nuclear mode error styling */
body.nuclear-mode .rate-limit-error {
    background: linear-gradient(135deg, #4a0000, #360000);
    border-color: #ff4444;
}

body.nuclear-mode .rate-limit-error h3 {
    color: #ff6666;
}

.login-footer-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;  /* expanded = normal row */
    gap: 12px;
    cursor: pointer;
    padding: 0;
    border-radius: 8px;
    color: #ccc;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  
  #unauthenticated-footer {
    display: flex;
    align-items: center;      /* vertical centering */
    justify-content: center;  /* horizontal centering */
    height: 100%;             /* make footer fill available space */
  }

  #login-btn{
    display: flex;
    align-items: center;      /* vertical centering */
    justify-content: center;  /* horizontal centering */
    height: 100%;  
  }
  
 /* default hidden */
.menu-text {
    opacity: 0;
    visibility: hidden;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.3s ease, max-width 0.3s ease;
  }
  
  .menu-text:hover {
    color: rgb(157, 157, 157);
}

  .sidebar.expanded .menu-text {
    opacity: 1;
    visibility: visible;
    max-width: 200px;        /* enough for your text */
    transition-delay: 0.2s;  /* wait until sidebar finishes expanding */
  }
  
  /* collapsed: snap out instantly (no delay) */
  .sidebar:not(.expanded) .menu-text {
    opacity: 0 !important;
    visibility: hidden !important;
    max-width: 0 !important;
    transition-delay: 0s !important;
  }
  
  .sidebar:not(.expanded) .login-footer-btn {
    justify-content: center;      /* center icon only */
  }



.login-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background:  #232323;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Hide login button text when sidebar is collapsed */
/* Center the icon when collapsed */

/* Ensure unauthenticated footer follows same visibility rules */


#authenticated-footer{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
/* Hide text when collapsed */
.sidebar:not(.expanded) #unauthenticated-footer {
    display: none;
  }

  /* Add this mobile-responsive CSS to your styles.css file */

/* Step 4: Add to your styles.css file */

.history-container {
    max-width: 800px;
    margin: 100px auto 0;
    padding: 20px;
}

.history-container h1 {
    color: #f5f5f5;
    margin-bottom: 30px;
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background-color: #3f3f3f;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: #4a4a4a;
}

.history-preview {
    flex: 1;
}

.history-text {
    color: #f5f5f5;
    font-size: 1.1em;
    margin-bottom: 8px;
    line-height: 1.4;
}

.history-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.history-mode {
    background-color: #555;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    text-transform: capitalize;
}

.history-date {
    color: #999;
    font-size: 0.9em;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.delete-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.delete-btn:hover {
    background-color: #ff4444;
    color: white;
}

.loading {
    text-align: center;
    color: #ccc;
    padding: 40px;
    font-size: 1.1em;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    color: #f5f5f5;
    margin-bottom: 10px;
}

.empty-state p {
    color: #ccc;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    background-color: #555;
    color: #f5f5f5;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #666;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background-color: #2c2c2c;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
}

.modal-header h2 {
    color: #f5f5f5;
    margin: 0;
}

.close {
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #f5f5f5;
}

.modal-body {
    padding: 20px;
}

.query-section {
    margin-bottom: 30px;
}

.query-section h3 {
    color: #f5f5f5;
    margin-bottom: 10px;
}

.query-text {
    background-color: #3a3a3a;
    padding: 15px;
    border-radius: 8px;
    color: #f5f5f5;
    line-height: 1.6;
    margin-bottom: 10px;
}

.query-mode {
    color: #ccc;
    font-size: 0.9em;
}

.response-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.response-box {
    background-color: #3a3a3a;
    padding: 20px;
    border-radius: 8px;
}

.response-box h4 {
    color: #f5f5f5;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    border-bottom: 1px solid #555;
    padding-bottom: 8px;
}

.response-box p {
    color: #ccc;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #444;
}

.btn-secondary {
    background-color: #555;
    color: #f5f5f5;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #666;
}

.btn-danger {
    background-color: #cc4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #dd5555;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .history-container {
        margin-top: 60px;
        padding: 15px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .history-actions {
        align-self: flex-end;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .response-grid {
        grid-template-columns: 1fr;
    }
}

.content {
    position: relative;
    z-index: 1;
}

#page-content {
    position: relative;
    z-index: 2;
}

/* Simple Custom Notification */
.simple-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #1e1e1e;
    color: #f5f5f5;
    padding: 16px 20px;
    border-radius: 8px 8px 5px 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    max-width: 350px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    border-bottom: 2px solid #666;
    border-left: 2px solid #666;
    animation: slideIn 0.3s ease;
}

.simple-notification.error {
    border-bottom-color: #f44336;
    border-left-color: #f44336;
    background-color: #2a1a1a;
}

.simple-notification.success {
    border-top-color: #4caf50;
    background-color: #1a2a1a;
}

.simple-notification.warning {
    border-left-color: #898989;
    border-bottom-color: #898989;
    background-color: #2a2410;
}

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



/* Clerk Component Styling - Consolidated and Cleaned */

/* User Button Dropdown */
.cl-userButtonPopoverCard {
    background-color: #404040 !important;
    border: 1px solid #555 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

.cl-userButtonPopoverActions,
.cl-userButtonPopoverMain,
.cl-userButtonPopoverFooter {
    background-color: #404040 !important;
}

.cl-userButtonPopoverFooter {
    border-top: 1px solid #555 !important;
}

.cl-userButtonPopoverActionButton {
    color: #ffffff !important;
    background-color: transparent !important;
}

.cl-userButtonPopoverActionButton:hover {
    background-color: #4a4a4a !important;
    color: #646464 !important;
}

.cl-userButtonPopoverMain *,
.cl-userButtonPopoverFooter * {
    color: #ffffff !important;
}

/* Main Modals - Comprehensive targeting */
div[data-clerk-modal],
div[data-clerk-modal] *,
.cl-modalContent,
.cl-modalContent *,
.cl-userProfile-root,
.cl-userProfile-root *,
.cl-profilePage,
.cl-profilePage *,
.cl-card,
.cl-card * {
    background-color: #404040 !important;
    background: #404040 !important;
    color: #ffffff !important;
}

/* Rounded corners for modals */
div[data-clerk-modal],
.cl-modalContent,
.cl-userProfile-root,
.cl-profilePage {
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* Ensure modal backdrop doesn't interfere */
.cl-modalBackdrop {
    border-radius: 0 !important;
}

/* Override any inline white backgrounds */
[style*="background-color: white"],
[style*="background-color: #fff"],
[style*="background-color: #ffffff"],
[style*="background: white"],
[style*="background: #fff"],
[style*="background: #ffffff"] {
    background-color: #404040 !important;
    background: #404040 !important;
}



/* Smaller, more compact sign-in window */
.cl-signIn-start,
.cl-signUp-start {
    max-width: 360px !important;
    padding: 20px !important;
}

/* Smaller input field */
.cl-formFieldInput {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    background-color: #4a4949 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.cl-formField {
    width: 100% !important;
    max-width: 100% !important;
}


/* Better contrast on focus */
.cl-formFieldInput:focus {
    box-shadow: 0 0 0 2px rgba(119, 119, 119, 0.2) !important;
    background-color: #4a4949 !important;
}

/* White placeholder/hint text */
.cl-formFieldInput::placeholder {
    color: #dfdfdf !important;
    opacity: 0.8 !important;
}

/* More contrasted buttons */


.cl-formButtonPrimary:hover {
    background-color: #666 !important;
    border-color: #777 !important;
}

/* Social login buttons - better contrast */
/* Remove text background highlighting from buttons */
.cl-socialButtonsBlockButton *,
.cl-formButtonPrimary *,
.cl-socialButtonsBlockButton span,
.cl-formButtonPrimary span {
    background: none !important;
    background-color: transparent !important;
    text-shadow: none !important;
}
.cl-formButtonPrimary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure button text is clean */
.cl-socialButtonsBlockButton {
    background-color: #4a4949 !important;

    color: #ffffff !important;
}

.cl-formButtonPrimary {
    background-color: #4a4949 !important;
    border: 2px solid #4a4949 !important;
    color: #ffffff !important;
}

/* Remove any text selection highlighting */
.cl-socialButtonsBlockButton,
.cl-formButtonPrimary {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
}

/* Fix close button positioning - keep it inside modal bounds */
.cl-modalCloseButton {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 1000 !important;
    width: 28px !important;
    height: 28px !important;
    background: rgba(202, 202, 202, 0.038) !important;
    border: none !important;
    border-radius: 4px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure the modal container has relative positioning */
.cl-modalContent {
    position: relative !important;
}

/* Constrain the password visibility button */
.cl-formFieldInput[type="password"] + button,
.cl-formFieldInputShowPasswordButton {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    background: none !important;
    border: none !important;
    color: #ccc !important;
    font-size: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    outline: none !important;
}

/* Ensure password field has relative positioning for the button */
.cl-formField:has(input[type="password"]) {
    position: relative !important;
}

/* More aggressive positioning to prevent any movement */
.cl-formFieldInput[type="password"] + button,
.cl-formFieldInputShowPasswordButton,
.cl-formFieldInputShowPasswordButton * {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    width: 16px !important;
    height: 16px !important;
    transform: none !important;
    background: none !important;
    border: none !important;
    color: #ccc !important;
    font-size: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix the eye icon positioning within the button */
.cl-formFieldInputShowPasswordButton svg,
.cl-formFieldInputShowPasswordButton path,
.cl-formFieldInputShowPasswordButton use {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

/* Ensure the button itself centers its content */
.cl-formFieldInputShowPasswordButton {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    color: #ccc !important;
}

/* Lock all states in the same position */
.cl-formFieldInputShowPasswordButton:hover,
.cl-formFieldInputShowPasswordButton:focus,
.cl-formFieldInputShowPasswordButton:active,
.cl-formFieldInputShowPasswordButton[aria-pressed="true"],
.cl-formFieldInputShowPasswordButton[aria-pressed="false"] {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    width: 16px !important;
    height: 16px !important;
    transform: none !important;
}

/* Prevent Continue button from moving when clicked */
.cl-formButtonPrimary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 40px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    background-color: #555 !important;
    border: 2px solid #666 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    /* Add these to prevent movement */
    position: relative !important;
    transform: none !important;
    margin: 0 !important;
}

/* Lock all button states in the same position */
.cl-formButtonPrimary:hover,
.cl-formButtonPrimary:focus,
.cl-formButtonPrimary:active,
.cl-formButtonPrimary:pressed {
    transform: none !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    height: 40px !important;
    padding: 10px 20px !important;
    background-color: #666 !important;
    border-color: #777 !important;
}

/* Mobile Optimisation

/* More specific mobile sidebar hiding */
@media only screen and (min-device-width: 600px) and (max-device-width: 700px) {
    #search-area {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 90% !important;
        padding: 120px 0 40px 0 !important; /* Increased from 80px to 120px */
        margin: 50px auto 0 !important; /* Add top margin for spacing */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

@media only screen and (min-device-width: 850px){

    .result-box p {
        font-size: 0.9rem !important; /* Much larger response text */
        line-height: 1.5;

    }

    .critique-text-content{
        font-size: 0.9rem !important;
    }

    .critique-bullet{
        font-size: 0.9rem !important;
    }
}

@media only screen and (max-device-width: 400px) {
    .conversation-container{
        width: 85% !important;
    }
.conversation-header{
    padding: 30px 110px;
    gap: 40px !important;
    
}

    .conversation-messages{
        font-size: 30px;
    }
    .conversation-bubble {
        width: 100% !important;  
    }
    .conversation-header h1{
        font-size: 35px !important;
    }
    .conversation-model-badge{
        font-size: 25px !important;
    }
    .conversation-back{
        font-size: 3.5rem !important;
    }
    .conversation-menu-button{
        font-size: 50px !important;
    }
    .conversation-menu-item{
        font-size: 35px;
    }
    .conversation-input-area{
        padding: 20px 0px 20px !important;
    }
    .conversation-model-label{
        font-size: 1.5rem !important;
    }
    .analyze-text{
        font-size: 1.5rem !important;
        max-width: 170px;
        position: absolute;
        top: 12px;
        right: 16px;
    }

    .analysis-header{
        font-size: 25px !important;
    }

    .analysis-content{
        font-size: 22px !important;
    }

    
    .analyze-dropdown {
        position: absolute;
        top: 110px !important;      /* Directly below the text */
        right: 0;
        margin-top: 4px;
    }
    
    .analyze-option {
        font-size: 25px !important;
        text-align: center;
        padding: 30px !important;
    }

    .result-box h3 {
        font-size: 3.1rem !important; /* Much larger headers */
        margin-bottom: 25px !important;
        line-height: 1.2 !important;
    }
    
    .result-box p {
        font-size: 1.5rem !important; /* Much larger response text */
        line-height: 1.5 !important;
        margin-bottom: 15px !important;
    }
    .results {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: none !important;
        gap: 80px !important; 
        margin: 40px auto 0 !important;
        padding: 0 20px !important;
    }
    
    .result-box {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        flex: none !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure critique section also stacks */
    .critique-text {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 80px !important;
        padding: 20px !important;
    }
    
    .critique-text .result-box {
        width: 100% !important;
        margin-bottom: 0 !important;
    }
    
    /* Critique section text sizing */
    .critique-item h4 {
        font-size: 3.0rem !important; /* Larger critique headers */
        margin-bottom: 23px !important;
        line-height: 1.2 !important;
    }
    
    .critique-text-content {
        font-size: 1.5rem !important; /* Larger critique text */
        line-height: 1.5 !important;
        margin-bottom: 15px !important;
    }
    
    /* Summary bullets - consistent large size */
    .critique-bullet {
        font-size: 1.5rem !important; /* Larger summary text */
        padding: 20px 18px !important;
        line-height: 1.5 !important;
        margin-top: 15px !important;
    }
    
    /* Results grid adjustments for mobile */
    .results {
        flex-direction: column !important;
        gap: 25px !important;
        margin-top: 40px !important;
        padding: 0 15px !important;
    }
    
    .critique-text {
        flex-direction: column !important;
        gap: 25px !important;
        padding: 20px 15px !important;
        font-size: 1.2rem;
    }

    /* Hide sidebar */
    .sidebar:not(.expanded) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    opacity: 0 !important;
    transform: translateX(-100%) !important;    
    }

    /* Position search area 2/5 down the page and center */
    #search-area {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 90% !important;
    padding: 200px 0 40px 0 !important; /* Increased from 80px to 120px */
    margin: 90px auto 0 !important; /* Add top margin for spacing */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    }

    body, html {
    position: relative !important;
    overflow-y: auto !important;
    height: auto !important;
    }

    .main-content {
    position: relative !important;
    padding-top: 0 !important;
    }


    /* Make logo wider but not too big */
    .logo {
    max-width: 90% !important;
    margin: 0 auto 20px !important;
    }

    /* Center and widen the form container */
    .form-container {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    }



.top-right-toggle {
    position: fixed !important;
    top: 80px !important;
    right: 60px !important;
    padding: 16px 24px !important;
    gap: 20px !important;
    border-radius: 35px !important;
    z-index: 9999 !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Much larger toggle switch */
.toggle-switch {
    width: 70px !important;
    height: 38px !important;
    border-radius: 20px !important;
}

.toggle-switch::before {
    width: 30px !important;
    height: 30px !important;
    top: 4px !important;
    left: 4px !important;
}

.toggle-switch.active::before {
    transform: translateX(32px) !important;
}

/* Larger toggle label text */
.toggle-label {
    font-size: 25px !important;
    font-weight: 400 !important;
    letter-spacing: 1px !important;
}

.mobile-menu-button {
    position: fixed !important;
    top: 90px !important;
    left: 50px !important;
    width: 130px !important;
    height: 130px !important;
    background-color: rgba(63, 63, 63, 0.95) !important;
    border: 1px solid #555 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
}

.mobile-menu-button:hover {
    background-color: rgba(79, 79, 79, 0.95) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Menu icon - three horizontal lines */
.mobile-menu-icon {
    width: 60px !important;
    height: 50px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.mobile-menu-icon span {
    width: 100% !important;
    height: 4px !important;
    background-color: #ccc !important;
    border-radius: 3px !important;
    transition: all 0.3s ease !important;
}
.sidebar.expanded ~ .content .mobile-menu-button .mobile-menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(18px, 18px) !important;
}

.sidebar.expanded ~ .content .mobile-menu-button .mobile-menu-icon span:nth-child(2) {
    opacity: 0 !important;
}

.sidebar.expanded ~ .content .mobile-menu-button .mobile-menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(18px, -18px) !important;
}

/* Nuclear mode styling */
body.nuclear-mode .mobile-menu-button {
    background-color: rgba(74, 0, 0, 0.95) !important;
    border-color: #6d0000 !important;
}

body.nuclear-mode .mobile-menu-icon span {
    background-color: #ff6666 !important;
}

.sidebar.expanded,
#sidebar.expanded,
div.sidebar.expanded {
    display: block !important;
    visibility: visible !important;
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 10000 !important;
    background-color: #1a1a1a !important;
    transform: translateX(0) !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

.sidebar.expanded nav ul li a {
    padding: 25px 30px !important;
    font-size: 22px !important;
    border-bottom: 1px solid #333 !important;
    display: flex !important;
    align-items: center !important;
    min-height: 60px !important;
}

.sidebar.expanded nav ul li a .menu-text {
    opacity: 1 !important;
    visibility: visible !important;
    max-width: none !important;
}

/* Larger footer area for mobile */
.sidebar.expanded .sidebar-footer {
    padding: 40px 30px !important;
    font-size: 18px !important;
    min-height: 80px !important;
}

/* Hide the regular toggle button on mobile when sidebar is expanded */
.sidebar.expanded #toggle-btn {
    display: none !important;
}
.sidebar.expanded {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    background-color: #1a1a1a !important;
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#mobile-clerk-user-button,
clerk-user-button {
transform: scale(2.2) !important;
margin: 0 !important;
flex-shrink: 0 !important;
display: inline-block !important;
transform-origin: center !important; /* Ensure scaling from center */
}

#overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
}

/* Much larger spinner */
.spinner {
    width: 90px !important; /* Increased from 60px */
    height: 90px !important;
    border: 12px solid #f3f3f3 !important; /* Increased from 8px */
    border-top: 12px solid #777 !important;
    border-radius: 50% !important;
}

/* Much larger spinner text */
.spinner-text {
    margin-top: 60px !important; /* More space from spinner */
    font-size: 1.2rem !important; /* Much larger text */
    line-height: 1.2 !important;
    text-align: center !important;
    padding: 0 20px !important; /* Add padding for text wrapping */
    max-width: 80vw !important; /* Prevent text from going off screen */
}

/* Scale up loading message specifically */
#loading-message {
    font-size: 1.2rem !important;
    line-height: 1.4 !important;
    text-align: center !important;
    padding: 0 20px !important;
}

/* Make glitch text larger too */
.glitch-text {
    font-size: 1.2rem !important;
    line-height: 1.4 !important;
}
}

.mobile-account-modal {
    display: none;
}

.cl-signUp-root::after {
    content: "By signing up, you agree to our Terms & Conditions and Privacy Policy";
    display: block;
    font-size: 10px;
    color: #a4a4a4;
    text-align: center;
    padding-bottom: 9px;
    padding-top: 9px;
    line-height: 1.4;
}


@media only screen and (max-device-width: 600px) {
    #mobile-authenticated-footer {
        display: flex !important;
        align-items: center !important;
        position: relative !important;
    }
    
    .mobile-chevron,
    #mobile-chevron {
        font-size: 1.9rem !important;
        color: #ffffff !important;
        transition: transform 0.3s ease !important;
        margin-left: auto !important; /* Push to the right */
        transform-origin: center 60% !important;
    }
    
    #mobile-chevron.flipped,
    .mobile-chevron.flipped {
        transform: rotate(180deg) !important;
        transform-origin: center 60% !important;
    }

        .mobile-account-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 999999;
        }
        
        .mobile-account-modal.show {
            display: block;
        }
        
        .mobile-account-modal-content {
            position: absolute;
            bottom: 120px; /* Position above the footer */
            left: 10px; /* Aligned to the right */
            background-color: #272727;
            border-radius: 12px;
            width: 70%;
            padding: 0;
            box-shadow: 0 4px 20px rgba(73, 73, 73, 0.5);
            /* Removed animation */
        }
        
        .mobile-account-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 25px;
            border-bottom: 1px solid #444;
        }
        .mobile-accounthead_details{
            display: flex !important;
            flex-direction: column !important;
            gap: 5px !important;
            align-items: flex-start !important;
        }
        
        .mobile-account-header h3 {
            margin: 0;
            font-size: 35px !important;
            font-weight: 400;
            color: #fff;
        }
        .mobile-account-header h4 {
            margin: 0;
            font-size: 1.6rem;
            font-weight: 200;
            color: #ffffffb8;
        }
        .mobile-account-close {
            background: none;
            border: none;
            color: #999;
            font-size: 2.5rem;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }
        
        .mobile-account-options {
            padding: 15px;
            padding-top: 0px !important;
        }
        
        .mobile-account-option {
            width: 100%;
            background-color: #1f1f1fb5;
            border: none;
            border-radius: 10px;
            padding: 35px 30px;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 18px;
            font-size: 35px;
            color: #fff;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }
        
        .mobile-account-option:last-child {
            margin-bottom: 0;
        }
        
        .mobile-account-option:active {
            background-color: #4a4a4a;
        }
        
        .option-icon {
            font-size: 1.8rem;
        }

        div[data-clerk-modal],
    .cl-modalBackdrop,
    .cl-modalContent {
        position: fixed !important;
        z-index: 9999999 !important; /* Changed from 999999 to 9999999 */
        overflow: visible !important;
    }

}

/* Remove the red test and replace with this: */
@media only screen and (min-device-width: 400px) and (max-device-width: 600px) {





        .result-box h3 {
            font-size: 2.5rem !important; /* Much larger headers */
            margin-bottom: 20px !important;
            line-height: 1.2 !important;
        }
        
        .result-box p {
            font-size: 1.0rem !important; /* Much larger response text */
            line-height: 1.5 !important;
            margin-bottom: 15px !important;
        }
        .results {
            display: flex !important;
            flex-direction: column !important;
            width: 100% !important;
            max-width: none !important;
            gap: 80px !important; 
            margin: 40px auto 0 !important;
            padding: 0 20px !important;
        }
        
        .result-box {
            width: 100% !important;
            max-width: none !important;
            min-width: 0 !important;
            flex: none !important;
            margin: 0 !important;
            box-sizing: border-box !important;
        }
        
        /* Ensure critique section also stacks */
        .critique-text {
            display: flex !important;
            flex-direction: column !important;
            width: 100% !important;
            gap: 80px !important;
            padding: 20px !important;
        }
        
        .critique-text .result-box {
            width: 100% !important;
            margin-bottom: 0 !important;
        }
        
        /* Critique section text sizing */
        .critique-item h4 {
            font-size: 1.8rem !important; /* Larger critique headers */
            margin-bottom: 15px !important;
            line-height: 1.2 !important;
        }
        
        .critique-text-content {
            font-size: 1.2rem !important; /* Larger critique text */
            line-height: 1.5 !important;
            margin-bottom: 15px !important;
        }
        
        /* Summary bullets - consistent large size */
        .critique-bullet {
            font-size: 1.7rem !important; /* Larger summary text */
            padding: 20px 18px !important;
            line-height: 1.6 !important;
            margin-top: 15px !important;
        }
        
        /* Results grid adjustments for mobile */
        .results {
            flex-direction: column !important;
            gap: 25px !important;
            margin-top: 40px !important;
            padding: 0 15px !important;
        }
        
        .critique-text {
            flex-direction: column !important;
            gap: 25px !important;
            padding: 20px 15px !important;
            font-size: 1.2rem;
        }
    
    /* Hide sidebar */
    .sidebar:not(.expanded) {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        opacity: 0 !important;
        transform: translateX(-100%) !important;
    }
    
    /* Position search area 2/5 down the page and center */
    #search-area {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 90% !important;
        padding: 150px 0 40px 0 !important; /* Increased from 80px to 120px */
        margin: 90px auto 0 !important; /* Add top margin for spacing */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body, html {
        position: relative !important;
        overflow-y: auto !important;
        height: auto !important;
    }
    
    .main-content {
        position: relative !important;
        padding-top: 0 !important;
    }
    
    
    /* Make logo wider but not too big */
    .logo {
        max-width: 65% !important;
        margin: 0 auto 40px !important;
    }
    
    /* Center and widen the form container */
    .form-container {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
  
    


    .top-right-toggle {
        position: fixed !important;
        top: 40px !important;
        right: 40px !important;
        padding: 16px 24px !important;
        gap: 20px !important;
        border-radius: 35px !important;
        z-index: 9999 !important;
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Much larger toggle switch */
    .toggle-switch {
        width: 70px !important;
        height: 38px !important;
        border-radius: 20px !important;
    }
    
    .toggle-switch::before {
        width: 30px !important;
        height: 30px !important;
        top: 4px !important;
        left: 4px !important;
    }
    
    .toggle-switch.active::before {
        transform: translateX(32px) !important;
    }
    
    /* Larger toggle label text */
    .toggle-label {
        font-size: 18px !important;
        font-weight: 600 !important;
        letter-spacing: 1px !important;
    }

    .mobile-menu-button {
        position: fixed !important;
        top: 30px !important;
        left: 30px !important;
        width: 130px !important;
        height: 130px !important;
        background-color: rgba(63, 63, 63, 0.95) !important;
        border: 1px solid #555 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        z-index: 9999 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
    }
    
    .mobile-menu-button:hover {
        background-color: rgba(79, 79, 79, 0.95) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Menu icon - three horizontal lines */
    .mobile-menu-icon {
        width: 60px !important;
        height: 50px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    .mobile-menu-icon span {
        width: 100% !important;
        height: 4px !important;
        background-color: #ccc !important;
        border-radius: 3px !important;
        transition: all 0.3s ease !important;
    }
    .sidebar.expanded ~ .content .mobile-menu-button .mobile-menu-icon span:nth-child(1) {
        transform: rotate(45deg) translate(18px, 18px) !important;
    }
    
    .sidebar.expanded ~ .content .mobile-menu-button .mobile-menu-icon span:nth-child(2) {
        opacity: 0 !important;
    }
    
    .sidebar.expanded ~ .content .mobile-menu-button .mobile-menu-icon span:nth-child(3) {
        transform: rotate(-45deg) translate(18px, -18px) !important;
    }
    
    /* Nuclear mode styling */
    body.nuclear-mode .mobile-menu-button {
        background-color: rgba(74, 0, 0, 0.95) !important;
        border-color: #6d0000 !important;
    }
    
    body.nuclear-mode .mobile-menu-icon span {
        background-color: #ff6666 !important;
    }

    .sidebar.expanded,
    #sidebar.expanded,
    div.sidebar.expanded {
        display: block !important;
        visibility: visible !important;
        width: 100vw !important;
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 10000 !important;
        background-color: #1a1a1a !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        transition: all 0.3s ease !important;
    }
    
    .sidebar.expanded nav ul li a {
        padding: 25px 30px !important;
        font-size: 22px !important;
        border-bottom: 1px solid #333 !important;
        display: flex !important;
        align-items: center !important;
        min-height: 60px !important;
    }
    
    .sidebar.expanded nav ul li a .menu-text {
        opacity: 1 !important;
        visibility: visible !important;
        max-width: none !important;
    }
    
    /* Larger footer area for mobile */
    .sidebar.expanded .sidebar-footer {
        padding: 40px 30px !important;
        font-size: 18px !important;
        min-height: 80px !important;
    }
    
    /* Hide the regular toggle button on mobile when sidebar is expanded */
    .sidebar.expanded #toggle-btn {
        display: none !important;
    }
    .sidebar.expanded {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999 !important;
        background-color: #1a1a1a !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    #mobile-clerk-user-button,
clerk-user-button {
    transform: scale(2.2) !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    transform-origin: center !important; /* Ensure scaling from center */
}



    



    #overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
    }
    
    /* Much larger spinner */
    .spinner {
        width: 90px !important; /* Increased from 60px */
        height: 90px !important;
        border: 12px solid #f3f3f3 !important; /* Increased from 8px */
        border-top: 12px solid #777 !important;
        border-radius: 50% !important;
    }
    
    /* Much larger spinner text */
    .spinner-text {
        margin-top: 60px !important; /* More space from spinner */
        font-size: 1.2rem !important; /* Much larger text */
        line-height: 1.2 !important;
        text-align: center !important;
        padding: 0 20px !important; /* Add padding for text wrapping */
        max-width: 80vw !important; /* Prevent text from going off screen */
    }
    
    /* Scale up loading message specifically */
    #loading-message {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
        text-align: center !important;
        padding: 0 20px !important;
    }
    
    /* Make glitch text larger too */
    .glitch-text {
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
    }
    
    /* Allow Clerk modals to display properly on mobile */



    

}



.mobile-close-btn {
    font-size: 60px;
    color: #ccc;
    cursor: pointer;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Navigation */




.mobile-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}






body.nuclear-mode .mobile-close-btn {
    color: #ff9999;
}

/* Only show on mobile screens */


/* Mobile sidebar overlay - completely hidden by default */


/* Mobile sidebar overlay - single clean definition */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0); /* Start transparent */
    z-index: 99999;
    visibility: hidden;
    pointer-events: none; /* Allow clicks through when hidden */
    transition: background-color 0.3s ease;
}
.mobile-sidebar-overlay.show {
    background-color: rgba(0, 0, 0, 0.7);
    visibility: visible;
    pointer-events: auto;
}
/* Smooth slide-in animation when shown *

/* Sidebar content with staggered animation */
.mobile-sidebar-content {
    width: 70%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    padding-bottom: 0px !important;
    box-sizing: border-box;
    opacity: 1 !important; /* ALWAYS fully visible */
    transform: translateX(-100%); /* Start off-screen left */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Only animate position */
}

.mobile-sidebar-overlay.show .mobile-sidebar-content {
    transform: translateX(0); /* Slide to visible position */
    opacity: 1 !important; /* Stay fully visible */
}

.mobile-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px; /* Increased from 20px */
    padding-top: 40px;
}
.mobile-nav-item {
    display: block;
    color: #ccc;
    text-decoration: none;
    font-size: 35px; /* Increased from 20px */
    font-weight: 200;
    padding: 30px 30px; /* Increased padding */
    margin-bottom: 0; /* Remove since we're using gap now */
    border-radius: 15px; /* Slightly more rounded */
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid transparent;
    text-align: left;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-left-color: #fff;
    font-weight: 400;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* Staggered animation for nav items */
.mobile-sidebar-overlay.show .mobile-nav-item:nth-child(1) { 
    animation: slideInNav 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards; 
}
.mobile-sidebar-overlay.show .mobile-nav-item:nth-child(2) { 
    animation: slideInNav 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards; 
}
.mobile-sidebar-overlay.show .mobile-nav-item:nth-child(3) { 
    animation: slideInNav 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards; 
}
.mobile-sidebar-overlay.show .mobile-nav-item:nth-child(4) { 
    animation: slideInNav 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards; 
}

@keyframes slideInNav {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-left-color: #666;
    transform: translateX(8px);
}

.mobile-sidebar-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding: 10px 15px 0 0;
}

.mobile-close-btn {
    font-size: 50px;
    color: #ccc;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}
#mobile-authenticated-footer {
    display: flex !important;
    flex-direction: row !important;
    align-items: left !important;
    justify-content: left !important;
    gap: 50px !important; /* Increased gap for larger elements */
    width: 95% !important;
    padding: 20px 40px !important; /* More padding for larger content */
    padding-left: 30px;
    min-height: 10px !important; /* Force minimum height */
    overflow: hidden;
}



#mobile-user-name {
    color: #fff !important;
    font-size: 32px !important;
    font-weight: 200 !important;
    text-align: left !important;
    letter-spacing: 0.7px !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    display: inline-block !important;
    align-self: center !important;
    line-height: 1.2 !important; /* Control line height for large text */
}

/* Also increase the footer container size */


.mobile-sidebar-footer :hover {
    background-color: rgba(91, 91, 91, 0);
}
/* For unauthenticated users */
.mobile-sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Changed from center to stretch */
    margin-top: auto;
    background-color: rgba(44, 44, 44, 0);
    border-radius: 20px;
    width: 100%; /* Ensure footer takes full width */
    /* Add horizontal padding like nav items */
    box-sizing: border-box;
    padding-bottom: 20px;
}

/* Update the login button */
.mobile-login-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: #fff;
    font-size: 35px;
    font-weight: 100;
    cursor: pointer;
    padding: 15px 30px;
    border-radius: 20px;
    background-color: rgba(61, 61, 61, 0.134);
    transition: all 0.3s ease;
    width: 100%; /* Full width of parent */
    box-sizing: border-box;
    text-align: left;
    margin: 0;
    outline: #575757;
    flex-shrink: 0; /* Prevent shrinking */
}

.mobile-login-icon {
    width: 50px;
    height: 50px;
    min-width: 32px;
    background:  #232323;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}


.mobile-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

body.nuclear-mode {
    background-color: #1a0000 !important;
    color: #ffcccc !important;
}





@media only screen and (max-device-width: 600px) and (min-device-width: 440px){
    .input-container {
        width: 92% !important;
        position: relative !important;
    }
    
    .input-container textarea {
        width: 100% !important;
        min-height: 200px !important;
        padding: 20px !important;
        padding-right: 80px !important; /* More space for button */
        border-radius: 15px !important;
        font-size: inherit !important;
        line-height: 1.2 !important;
        box-sizing: border-box !important;
    }
    
    /* CRITICAL: Override ALL other positioning */
    .submit-arrow {
        position: absolute !important;
        right: 20px !important;
        top: 20px !important; /* Position from top of textarea */
        width: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
        margin: 0 !important;
        z-index: 100 !important;
        /* Force override any other positioning */
        bottom: auto !important;
        transform: none !important;
    }
    
    .submit-arrow svg {
        width: 30px !important;
        height: 30px !important;
    }
}

@media only screen and (max-device-width: 440px) {
    .input-container {
        width: 92% !important;
        position: relative !important;
    }
    
    .input-container textarea {
        width: 100% !important;
        min-height: 270px !important;
        padding: 20px !important;
        padding-right: 100px !important; /* More space for button */
        border-radius: 15px !important;
        font-size: 27px !important;
        line-height: 1.2 !important;
        box-sizing: border-box !important;
    }
    
    /* CRITICAL: Override ALL other positioning */
    .submit-arrow {
        position: absolute !important;
        right: 25px !important;
        top: 25px !important; /* Position from top of textarea */
        width: 60px !important;
        height: 60px !important;
        border-radius: 10px !important;
        margin: 0 !important;
        z-index: 100 !important;
        /* Force override any other positioning */
        bottom: auto !important;
        transform: none !important;
    }
    
    .submit-arrow svg {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Ensure login button stays visible on very narrow screens */
@media only screen and (max-width: 250px) {
    .mobile-sidebar-content {
        width: 80% !important; /* Wider on very narrow screens */
        min-width: 200px !important; /* Prevent going too narrow */
    }
    
    .mobile-login-btn {
        font-size: 28px !important; /* Smaller text on narrow screens */
        padding: 25px 20px !important; /* Less padding */
        min-width: 160px !important; /* Minimum button width */
    }
    
    .mobile-login-icon {
        width: 20px !important;
        height: 20px !important;
        font-size: 16px !important;
    }
    
    .mobile-nav-item {
        font-size: 28px !important;
        padding: 25px 20px !important;
    }
}

/* Mobile Clerk zoom - much simpler approach */
@media only screen and (max-device-width: 600px) {

    div[data-clerk-modal]:not(:has(.cl-otpCodeField)),
    .cl-modalContent:not(:has(.cl-otpCodeField)),
    .cl-signIn-start:not(:has(.cl-otpCodeField)),
    .cl-signUp-start:not(:has(.cl-otpCodeField)) {
        zoom: 1.33 !important;
        transform-origin: center !important;
    }
    
    div[data-clerk-modal]:has(.cl-otpCodeField) {
        zoom: 1 !important;
    }
    
    .cl-modalBackdrop {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    div[data-clerk-modal] {
        max-width: 90vw !important;
        max-height: 90vh !important;
        overflow: auto !important;
    }
}


/* Continue Conversation Section */
.continue-section {
    margin-top: 20px;
    padding: 10px;
    background-color: #3f3f3f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
    gap: 20px;
    width: 90%;
    max-width: 500px; /* ✅ Fixed - was missing 'px' */
    box-sizing: border-box;
    margin-bottom: 20px;
}


.continue-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}



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

.continue-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.continue-subtitle {
    text-align: center;
    color: #a0a0a0;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.continue-buttons {
    display: flex; /* ✅ Change from grid to flex */
    justify-content: center; /* ✅ Center the buttons */
    flex-wrap: wrap; /* ✅ Allow wrapping on smaller screens */
    gap: 20px;
    margin-bottom: 30px;
}

.btn-continue {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    min-width: 280px; 
    flex: 0 0 auto; /* ✅ Don't grow/shrink, maintain natural size */
}




.btn-continue:hover {
    border-color: rgba(139, 139, 139, 0.5);
    box-shadow: 0 12px 24px rgba(55, 55, 55, 0.2);
}


.btn-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.btn-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-label {
    font-size: 1 rem;
    font-weight: 300;
    color: #ffffff;
}

.btn-desc {
    font-size: 0.9rem;
    color: #a0a0a0;
}

/* Premium Upsell */
.premium-notice {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    margin-top: 20px;
}

.premium-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.premium-text {
    flex: 1;
}

.premium-text h4 {
    font-size: 1.4rem;
    color: #ffd700;
    margin-bottom: 8px;
}

.premium-text p {
    color: #a0a0a0;
    line-height: 1.6;
}

.btn-upgrade {
    padding: 14px 28px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

/* Loading state for buttons */
.btn-continue.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-continue.loading::after {
    content: "Creating conversation...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: #fff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .continue-section {
        padding: 30px 20px;
        margin-top: 40px;
    }
    
    .continue-title {
        font-size: 1.6rem;
    }
    
    .continue-subtitle {
        font-size: 1rem;
    }
    
    .continue-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn-continue {
        padding: 20px;
    }
    
    .btn-icon {
        font-size: 2rem;
    }
    
    .btn-label {
        font-size: 1.1rem;
    }
    
    .premium-notice {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .premium-icon {
        font-size: 2.5rem;
    }
}

/* Mobile specific - larger touch targets */
@media only screen and (max-device-width: 500px) {
    .continue-section {
        padding: 25px 15px;
        margin: 40px 15px;
    }
    
    .continue-title {
        font-size: 2rem;
    }
    
    .continue-subtitle {
        font-size: 1.2rem;
    }
    
    .btn-continue {
        padding: 25px 20px;
        min-height: 100px;
    }
    
    .btn-icon {
        font-size: 2.5rem;
    }
    
    .btn-label {
        font-size: 1.4rem;
    }
    
    .btn-desc {
        font-size: 1.1rem;
    }
    
    .btn-upgrade {
        padding: 18px 32px;
        font-size: 1.2rem;
    }
}

/* Conversation Page Styles */
.conversation-page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.conversation-container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 70%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.conversation-header {
    padding: 16px 24px;
    border-bottom: 1px solid #626262;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.conversation-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}
.conversation-back {
    color: #858585;
    text-decoration: none;
    font-size: 1.9rem;
    display: inline-block;
    margin-bottom: 10px;
}

.conversation-back:hover {
    color: #ffffff;
}

.conversation-title-text {
    font-size: 1.5rem;
    color: #fff;
    margin: 10px 0 5px 0;
}

.conversation-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
}

.conversation-model-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #b9b9b9;
    color: rgb(0, 0, 0);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}
.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conversation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #a0a0a0;
}

.conversation-message {
    display: flex;
    animation: fadeIn 0.3s ease-out;
    max-width: 1200px;
}

.conversation-message.user {
    justify-content: flex-end;
}

.conversation-message.assistant {
    justify-content: flex-start;
}

.conversation-bubble {
    max-width: 60%;
    padding: 16px 20px;
    border-radius: 16px;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.conversation-message.user .conversation-bubble {
    background: linear-gradient(135deg, #000000, #000000);
    color: white;
    border-bottom-right-radius: 4px;
}

.conversation-message.assistant .conversation-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 0px solid rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
    border-bottom-left-radius: 4px;
}

.conversation-model-label {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.conversation-input-area {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    color: #94a3b8;
    border: 1px solid #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.back-button:hover {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #667eea;
}
.conversation-input-area .input-container {
    width: 100%;
}

.conversation-input-area textarea {
    width: 100%;
    resize: none;
    overflow-y: hidden; /* ✅ Hide scroll until max height */
    line-height: 1.5;
    box-sizing: border-box;
    min-height: 80px ; /* Base height */
    max-height: 300px ; /* Prevent it getting too tall */
    height: auto !important; /* Allow auto-sizing */
    padding: 10px !important; /* Inset text from edges */
    padding-right: 60px !important; /* Extra space for button */
    margin-bottom: 0 !important;
    border-radius: 10px !important; /* Your requested radius */
    overflow-y: auto; /* Scroll if content exceeds max-height */
    background: #3b3b3b;
    border: none;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
}

/* Mobile */
@media (max-width: 768px) {
    .conversation-container {
        height: calc(100vh - 80px);
    }
    
    .conversation-bubble {
        max-width: 85%;
    }
}

.streaming-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: #313131a9;
    margin-left: 1px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}


/* Add to your existing CSS */

.conversation-message {
    position: relative;
}

/* Remove these old styles */
/*
.message-actions { ... }
.analyze-btn { ... }
*/

/* ✅ New analyze text link styles */
.analyze-text {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #b5b5b5;
    cursor: pointer;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.analyze-option:hover,
.analyze-text:hover {
    color: #000000ad;
  }

.analyze-dropdown {
    position: absolute;
    top: 32px;
    right: 16px;
    margin-top: 4px;
    background: #2c2c2c;  /* ✅ Match your dark background */
    border: 1px solid #2c2c2c;  /* ✅ Subtle outline */
    border-radius: 8px;
    min-width: 150px;
    display: none;
    z-index: 10;
}

.analyze-dropdown.show {
    display: block;
}

.analyze-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 11px;  /* ✅ Match analyze text */
    font-weight: 600;  /* ✅ Match analyze text */
    color: #b5b5b5;  /* ✅ Match analyze text color */
    text-transform: uppercase;  /* ✅ Match analyze text */
    letter-spacing: 0.5px;  /* ✅ Match analyze text */
    border-bottom: 1px solid #5c5c5c;
}

.analyze-option:last-child {
    border-bottom: none;
}





.analysis-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.analysis-bubble {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #878787;
    font-weight: 500;
}

.analysis-icon {
    width: 16px;
    height: 16px;
}

.analysis-content {
    font-size: 14px;
    line-height: 1.6;
    color: #555555;
}

.streaming-analysis .streaming-cursor {
    color: #000000;
}

/* Skeleton Loading */
.conversation-skeleton {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.skeleton-message {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.skeleton-message.user {
    justify-content: flex-end;
}

.skeleton-message.assistant {
    justify-content: flex-start;
}

.skeleton-bubble {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    height: 80px;
    width: 60%;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-bubble.large {
    height: 200px;
    width: 70%;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.15;
    }
}

/* Hide skeleton when messages load */
.conversation-messages:not(:empty) .conversation-skeleton {
    display: none;
}


/* Conversations Divider */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.sidebar:not(.expanded) .nav-divider {
    display: none !important;
}

/* Conversations Section - matches nav style */
.conversations-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-conversation-item {
    display: block;
    padding: 15px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}


.sidebar-conversation-text {
    font-size: 14px;
}

/* Hide when collapsed */
.sidebar:not(.expanded) .sidebar-conversation-text {
    display: none;
}

.sidebar-conversations-loading,
.sidebar-conversations-empty {
    display: none;
}

/* Three-dot menu */
.conversation-header {
    flex-shrink: 0;
    padding: 16px 24px;
    border-bottom: 1px solid #626262;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.conversation-menu {
    position: relative;
    margin-left: auto;
}

.conversation-menu-button {
    background: none;
    border: none;
    color: #858585;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;

}

.conversation-menu-button:hover {
    color: #ffffff;
    border: none !important;
}

.conversation-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #2c2c2c;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    min-width: 160px;
    margin-top: 0px !important;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.conversation-menu-dropdown.show {
    display: block;
}

.conversation-menu-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #e0e0e0;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0px !important;
}



.conversation-menu-item.delete {
    color: #ff6b6b;
}



/* Delete confirmation dialog */
.delete-conversation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    animation: fadeIn 0.2s ease;
}

.delete-conversation-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

.delete-conversation-content h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #fff;
    font-weight: 500;
}

.delete-conversation-content p {
    margin: 0 0 20px 0;
    color: #999;
    font-size: 14px;
    line-height: 1.5;
}

.delete-conversation-actions {
    display: flex;
    gap: 10px;
}

.delete-conversation-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-cancel {
    background: #333;
    color: #fff;
}

.delete-cancel:hover {
    background: #444;
    border: none !important;
}

.delete-confirm {
    background: #dc2626;
    color: #fff;
}

.conversation-menu-item.delete:hover{
    border: none !important;
    color: #c00000;
}

.conversation-menu-item:hover{
    border: none !important;
}

.delete-confirm:hover {
    background: #b91c1c;
    border: none !important;
}

/* Clerk OTP Fix - Clean Solution */
.cl-otpCodeField {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
}

.cl-otpCodeFieldInputContainer {
    display: flex !important;
    justify-content: center !important;
}

.cl-otpCodeFieldInputs {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Individual input boxes */
.cl-otpCodeFieldInput {
    display: inline-flex !important;
    width: 48px !important;
    height: 56px !important;
}

.cl-otpCodeFieldInput input {
    width: 100% !important;
    height: 100% !important;
    text-align: center !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    background-color: #4a4949 !important;
    border: 2px solid #666 !important;
    border-radius: 8px !important;
    color: #ffffff !important;
}

.cl-otpCodeFieldInput input:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}

/* Error state styling */
.cl-otpCodeField[data-status="error"] .cl-otpCodeFieldInput input {
    border-color: #ef4444 !important;
}

/* Hide Clerk's default error positioning issues */
.cl-formFieldErrorText {
    margin-top: 8px !important;
    text-align: center !important;
}

/* ULTRA AGGRESSIVE Clerk OTP Fix */
div[class*="cl-otpCodeField"] * {
    flex-direction: revert !important;
    position: revert !important;
}



/* Hide the visual OTP boxes but keep the input working */
.cl-otpCodeFieldInputs {
    position: relative !important;
    height: auto !important; /* ✅ Changed from 56px to auto */
    min-height: 56px !important; /* ✅ Added min-height */
    padding: 8px 0 !important; /* ✅ Added padding for breathing room */
    overflow: visible !important; /* ✅ Changed from hidden to visible */
}

.cl-otpCodeFieldInput {
    display: none !important;
}

/* Show the actual hidden input as a regular text box */
input[data-input-otp="true"] {
    clip-path: none !important;
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 300px !important;
    height: 56px !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    background: #4a4949 !important;
    border: 2px solid #666 !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 18px !important;
    text-align: center !important;
    letter-spacing: 8px !important;
    box-sizing: border-box !important;
}

input[data-input-otp="true"]:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}

/* Make sure the parent container doesn't clip it */
.cl-otpCodeField {
    overflow: visible !important;
    padding: 12px 0 !important; /* ✅ Added padding to parent too */
}

/* Continue links - matching conversation style */
.continue-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.continue-link {
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    min-width: 200px;
    text-align: center;
}

.continue-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.continue-label {
    color: #a0a0a0;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.continue-link:hover .continue-label {
    color: #ffffff;
}

/* Mobile responsive */
@media only screen and (max-device-width: 500px) {
    .continue-link {
        padding: 18px 30px;
        min-width: 280px;
    }
    
    .continue-label {
        font-size: 1.2rem;
    }
}


.conversation-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(44, 44, 44, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.conversation-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.conversation-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.conversation-spinner {
    border: 12px solid #f3f3f346;
    border-top: 12px solid #7777775b;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1.9s linear infinite;
}

.conversation-header::after {
    content: '';
    position: absolute;
    bottom: -21px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, #2c2c2c, transparent);
    pointer-events: none;
    z-index: 10;
  }

/* ============================================
   LEGAL & INFO PAGES (Terms, About, Privacy)
   Add this to your main styles.css
   ============================================ */

   .legal-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #e5e5e5;
    line-height: 1.7;
    padding: 60px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.legal-container h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.legal-container .subtitle {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 40px;
    font-style: italic;
}

.legal-container h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    color: #f0f0f0;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3a3a;
}

.legal-container p {
    margin-bottom: 16px;
    color: #c5c5c5;
}

.legal-container ul {
    margin: 16px 0;
    padding-left: 24px;
}

.legal-container li {
    margin-bottom: 12px;
    color: #c5c5c5;
}

.legal-container li strong {
    color: #e5e5e5;
}

.legal-container a {
    color: #7a9ff0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-container a:hover {
    color: #a8c0f5;
    text-decoration: underline;
}

/* Mobile responsive */
@media only screen and (max-width: 768px) {
    .legal-container {
        padding: 40px 24px;
    }
    
    .legal-container h1 {
        font-size: 2rem;
    }
    
    .legal-container h2 {
        font-size: 1.2rem;
    }
}

@media only screen and (max-device-width: 600px) {
    .legal-container {
        padding: 40px 20px;
        padding-top: 160px !important;
    }
    
    .legal-container h1 {
        font-size: 1.8rem;
    }
    
    .legal-container .subtitle {
        font-size: 1rem;
    }
    
    .legal-container h2 {
        font-size: 1.1rem;
        margin-top: 32px;
    }
    
    .legal-container p,
    .legal-container li {
        font-size: 0.95rem;
    }
}

/* Nuclear mode compatibility */
body.nuclear-mode .legal-container {
    color: #ffcccc;
}

body.nuclear-mode .legal-container h1,
body.nuclear-mode .legal-container h2 {
    color: #ff9999;
}

body.nuclear-mode .legal-container h2 {
    border-bottom-color: #4a2020;
}

body.nuclear-mode .legal-container a {
    color: #ff7777;
}

body.nuclear-mode .legal-container a:hover {
    color: #ffaaaa;
}

#main-content {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

#main-content.htmx-request,
#main-content.htmx-settling,
#main-content.htmx-swapping {
    opacity: 0;
    transform: translateY(4px);
}