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

/* --- MASTER COLOR PALETTE --- */
:root {
    /* DEFAULT DARK THEME */
    --bg-main: #0f0f13;
    --bg-card: #16171d;
    --border-color: #2a2b36;
    --text-main: #ffffff; 
    --text-muted: #9ca3af;
    --primary-accent: #a78bfa;
}

/* LIGHT PINK THEME  */
body.theme-light-pink {
    --bg-main: #f3d8d8; 
    --bg-card: #f0b7b7; 
    --border-color: #c9a6a8; 
    --text-main: #4a3031; 
    --text-muted: #795959; 
    --primary-accent: #795959; 
}

/* LIGHT BLUE THEME  */
body.theme-light-blue {
    --bg-main: #e1f1f1; 
    --bg-card: #8fc2c4; 
    --border-color: #a6d5d6; 
    --text-main: #1f3b3d; 
    --text-muted: #4e7a7c; 
    --primary-accent: #4e7a7c; 
}

/* Apply the variables globally */
html, body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

 
/* ── Layout ── */
.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.3s ease;
}

@media (max-width: 768px) {
    /* Disable the grid completely on phones */
    .app { 
        display: block; 
    }
}
/* Mobile Preference
   ========================================= */

.app-single-column {
    min-height: 100vh;
    background: var(--bg-main); 
}

/* The Collapsible Menu Container */
.inline-menu-content {
    max-height: 0;
    overflow: hidden;
    background-color: var(--bg-card);
    transition: max-height 0.4s ease-in-out;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.inline-menu-content.expanded {
    max-height: 500px; 
    overflow-y: auto;
}

.dark-panel-inner {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vent-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; /* Pushes left and right sides apart */
    padding: 15px 20px;
    background: var(--bg-main);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    position: relative; 
    width: 100%; /* FORCES it to stretch the whole screen */
    box-sizing: border-box; /* Keeps padding from breaking the width */
}

.mobile-close-btn{
    background: black;
    margin-left: 200px;
    color: rgb(255, 255, 255);
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-main);
}
 
.logo span { color: var(--primary-accent); }
 
.tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.3px;
}
 
.friction-categories {
  padding: 18px 16px 12px;
  flex: 1;
  overflow-y: auto;
}
 
.cat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 10px;
}
 
.category-btn {
  width: 100%;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
 
.category-btn:hover { background: var(--bg-main); color: var(--text-main); }
.category-btn.active { background: rgba(167, 139, 250, 0.15); color: var(--primary-accent); }
 
.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
 
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}
 
.mood-strip {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}
 
.mood-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 18px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
 
.mood-btn:hover { background: var(--bg-main); border-color: var(--primary-accent); }
.mood-btn.selected { border-color: var(--primary-accent); background: rgba(167, 139, 250, 0.15); }
 
.mood-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

body {
    background: var(--bg-main); 
}
.screen {
    width: 100vw;
    height: 100vh;
    animation: fadeIn 0.4s ease-out;
}

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

.landing-page {
    font-family: Arial, sans-serif;
    color: var(--primary-accent);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    gap: 20px;
}
/* Date Display Styling */
#current-date {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing:0.5px;
}
/* 2. The Main Circular Vent Button */
.btn-vent {
    background: radial-gradient(circle, var(--bg-card) 0%, var(--bg-main) 100%);
    border: 1px solid var(--border-color); 
    width: 200px;
    height: 200px;
    border-radius: 50%; /* Perfect Circle */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: orbPulse 4s infinite ease-in-out; /* Gentle glowing effect */
    cursor: pointer;
}

.btn-vent:active {
    transform: scale(0.95); /* Shrinks when pressed */
    box-shadow: 0 0 20px color-mix(in srgb, var(--primary-accent) 40%, transparent);
    animation: none; /* Stops pulsing while holding */
}
@keyframes orbPulse {
   0% { 
        box-shadow: 0 0 35px color-mix(in srgb, var(--primary-accent) 15%, transparent), 
                    inset 0 0 15px color-mix(in srgb, var(--primary-accent) 5%, transparent); 
    }
    50% { 
        box-shadow: 0 0 60px color-mix(in srgb, var(--primary-accent) 30%, transparent), 
                    inset 0 0 25px color-mix(in srgb, var(--primary-accent) 15%, transparent); 
    }
    100% { 
        box-shadow: 0 0 35px color-mix(in srgb, var(--primary-accent) 15%, transparent), 
                    inset 0 0 15px color-mix(in srgb, var(--primary-accent) 5%, transparent); 
    }
}
.btn-vent b {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--primary-accent);
    letter-spacing: 1px;
}
.btn-vent p {
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.vent-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
}

.progress-ring {
    position: absolute;
    transform: rotate(-90deg); /* Starts the loading at the top */
    pointer-events: none; 
}

.progress-ring__circle {
    stroke-dasharray: 597; 
    stroke-dashoffset: 597; 
    transition: stroke-dashoffset 0.1s linear;
    stroke-linecap: round;
    opacity: 0.8;
}
/*HOW IT WORKS MODAL & BUTTON 
========================================== */

/* 1. The Trigger Button under the Orb */
.orb-how-it-works {
    background: transparent;
    border: none;
    color: var(--text-muted); /* Adapts to theme */
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 20px; 
    transition: color 0.3s ease;
    text-decoration: underline;
    text-underline-offset: 4px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.orb-how-it-works:hover {
    color: var(--primary-accent); /* Adapts to theme */
}

/* 2. The dark blurred background */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 3. The actual pop-up box */
.modal-content-box {
    background: var(--bg-card); /* Adapts to theme */
    border: 1px solid var(--border-color); /* Adapts to theme */
    border-radius: 16px;
    width: 90%;
    max-width: 600px; 
    max-height: 85vh; 
    overflow-y: auto;
    padding: 45px 50px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    transform: translateY(20px); 
    transition: transform 0.3s ease;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close:hover { 
    color: var(--primary-accent); 
}

/* Header Section */
.modal-header-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
    margin-bottom: 10px;
}

.modal-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 15px;
}

.modal-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 400;
    color: var(--text-main);
    line-height: 1.1;
    margin: 0;
}

/* The Italic Accent Word */
.modal-title em {
    color: var(--primary-accent); 
    font-style: italic;
}

/* The 3 Steps Layout */
.step-container {
    display: flex;
    gap: 35px;
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}
.step-container:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Elegant Step Numbers */
.step-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    color: var(--text-muted); 
    opacity: 0.8;
    min-width: 40px;
    padding-top: 2px; /* Aligns number perfectly with the heading */
}

/* Step Text Content */
.step-text h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--text-main);
    margin: 0 0 10px 0;
}

.step-text p {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

/* Scrollbar styling for the modal so it matches the theme */
.modal-content-box::-webkit-scrollbar {
    width: 6px;
}
.modal-content-box::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.vent-trigger {
    background: radial-gradient(circle, #E0E7FF 0%, #EEF2FF 100%);
    border-radius: 50%;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.vent-trigger:active {
    transform: scale(0.95); /* Shrinks slightly when pressed */
}
.vent-box-layout{
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-main);
}
.nav-title {
    font-size: 22px;
    color: var(--text-main);
    font-weight: 600;
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%);
    white-space: nowrap;
}
.nav-left {
    display: flex;
    align-items: center;
    min-width: 80px; /* Gives the left side a solid footprint */
}
/* ── Main Chat ── */
.chat-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-main);
}
 
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-main);
  flex-shrink: 0;
}
 
.topbar-left { 
    display: flex; 
    align-items: center; 
    gap: 14px; 
}
 
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.15);
  border: 1.5px solid var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--primary-accent);
  flex-shrink: 0;
}
 
.topbar-name { 
    font-size: 14px; 
    font-weight: 500; 
    color: var(--text-main); 
}
.topbar-status { 
    font-size: 12px; 
    color: var(--primary-accent); 
    display: flex; 
    align-items: 
    center; 
    gap: 5px; 
}
.status-dot { 
    width: 6px; 
    height: 6px; 
    border-radius: 50%; 
    background: var(--primary-accent); }
 
 
/* ── Messages ── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
 
.messages::-webkit-scrollbar { 
    width: 4px; 
}
.messages::-webkit-scrollbar-track { 
    background: transparent; 
}
.messages::-webkit-scrollbar-thumb { 
    background: var(--border-color); 
    border-radius: 2px; 
}
 
/* ── Empty state ── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
  text-align: center;
}
 
.empty-logo {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1;
}
 
.empty-logo span { color: var(--primary-accent); }
 
.empty-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.7;
}

.icon-btn{
    background: transparent;
    border:none;
    color: var(--text-muted);
    width: 55px;
    font-size: medium;
    height: 50px;
    border-radius: 10%; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.icon-btn:active {
    transform: scale(0.9); /* Feedback when pressing */
}
.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 80px; 
}

.save-indicator {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s ease; 
}

.auto-save-text {
    font-size: 14px;
    color: var(--text-muted); 
    font-weight: 500;
    font-style: italic;
    transition: color 0.3s ease;
}

.vent-main{
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap:15px;
    scroll-behavior: smooth;;
    text-align: center;
}
.vent-main::-webkit-scrollbar {
    width: 6px;
}
.vent-main::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}
.emoji {
    font-size: 50px;
    margin-bottom: 15px;
}
.vent-main h2 {
    color: var(--text-main);
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.0;
}
.vent-main h3 {
    color: var(--text-main);
    font-size: 19px;
    margin-bottom: 1px;
    font-weight: 550;
    line-height: 1.0;
}

.vent-main p {
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1.5;
    max-width: 280px;
}
.input-area {
    width: 100%;
    background: var(--bg-card);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
textarea {
    flex: 1;
    height: 50px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 15px;
    font-size: 15px;
    outline: none;
    resize: none;
    font-family: inherit;
    background: var(--bg-main);
    color: var(--text-main);
}

textarea::placeholder {
    color: var(--text-muted);
}
.circle-ring{
    background: var(--primary-accent);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-left: auto;
    transition: transform 0.2s ease;
}
.circle-ring:active {
    transform: scale(0.95);
}
.user-message-bubble, .ai-message-bubble {
    max-width: 80%; /* Prevents text from stretching all the way across */
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    animation: slideUpFade 0.3s ease-out;
}

/* USER MESSAGE*/
.user-message-bubble {
    align-self: flex-end; /* Pushes the bubble to the right side of the screen */
    background: var(--primary-accent);
    color: #ffffff;
    border-radius: 20px 20px 5px 20px; 
}

/* AI MESSAGE  */
.ai-message-bubble {
    align-self: flex-start; /* Pushes the bubble to the left side of the screen */
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 20px 20px 20px 5px;
    border-left: 4px solid var(--primary-accent);
}
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 15px 20px;
    width: fit-content;
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-bubble span:nth-child(1) { 
    animation-delay: -0.32s; 
}
.typing-bubble span:nth-child(2) { 
    animation-delay: -0.16s; 
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1.2); opacity: 1; 
    }
}

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


/* 6. Action Row (Horizontal Buttons) */
.action-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap; 
}

.btn-insights, .btn-history, .btn-settings {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-insights:hover, .btn-history:hover, .btn-settings:hover {
    background-color: var(--bg-main);
    border-color: var(--primary-accent);
}

.quick-starters {
    display: grid;
    /* Automatically creates columns that fit the screen */
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 850px;
    margin: 0 auto; 
    padding-bottom: 30px;
}

.starter-btn {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    justify-content: center;
}

.btn-emoji {
    font-size: 26px; 
}

/* Hover & Tap Effects */
.starter-btn:hover, .starter-btn:focus {
    background: var(--bg-main);
    border-color: var(--primary-accent); 
    transform: translateY(-3px); 
    outline: none;
}

/* End of Session UI Elements */
.session-end-container {
    margin-top: 30px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.session-end-divider {
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.session-end-divider::before,
.session-end-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.session-end-divider span {
    padding: 0 15px;
    color: var(--primary-accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.session-end-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
    max-width: 80%;
    line-height: 1.5;
}

.session-end-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap; /* Allows to stack on very small screens */
}

.btn-end-action {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-end-action:hover {
    background: var(--bg-main);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0, 0.1);
}

/* Insights Page */
.insights-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    box-sizing: border-box;
}
/* Clear Data Button */
.btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    border-color: #ef4444;
    color: #ef4444; /* warning text */
    background: rgba(239, 68, 68, 0.1);
}

.graph-area {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    background: var(--bg-card);
    overflow-x: auto; /* Allows horizontal scrolling as graph grows */
    overflow-y: hidden;
    position: relative;
}

.insights-bottom-panels {
    display: flex;
    gap: 15px;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.panel h3 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--text-main);
    letter-spacing: 1px;
}

.theme-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Styles to theme tabs in key themes box */
.theme-tabs {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-main);
}

.sessions-stats {
    justify-content: space-between;
}

.stats-summary {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-main);
}

/* Ai Card Generation */
.module-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Main Module Body */
.body-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 550px; 
    padding: 24px;
    color: var(--text-main);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

/* Header Elements */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    color: var(--primary-accent); 
    font-size: 20px;
}

.module-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color:var(--text-main);
}

.close-module-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-module-btn:hover {
    background: var(--bg-main);
    color: var(--primary-accent);
    border-color: var(--primary-accent);
}

/* The Grid System for the Cards */
.module-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Individual Cards */
.module-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.card-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-value {
    font-size: 16px;
    font-weight: 500;
}

/* Background Icons inside the top cards */
.card-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 20px;
    opacity: 0.5; 
}

.module-card .theme-tabs {
    background: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    padding: 6px 14px;
    font-size: 13px;
    display: inline-block;
}

/* AI Overview Bottom Box */
.ai-overview-card {
    padding: 20px;
}

#module-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
}
/* Floating Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10; 
}

.zoom-btn {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    padding: 18px 2px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.zoom-btn:hover {
    background: var(--bg-main);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    transform: scale(1.05);
}

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

.history-container {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    height: calc(100vh - 80px);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.session-history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-history-card:hover {
    background: var(--bg-main);
    border-color: var(--primary-accent);
    transform: translateX(5px); /* Slides slightly to the right if hovered */
}

.history-card-left h4 {
    color: var(--text-main);
    margin-bottom: 5px;
}

.history-card-left p {
    color: var(--text-muted);
}

.card-info{
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    color: var(--text-main);
}

.card-info-body{
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}
.history-card-right{
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}
/* Clear History Button */
.btn-clearH {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-clearH:hover {
    border-color: #ef4444;
    color: #ef4444; /* warning text */
    background: rgba(239, 68, 68, 0.1);
}
.btn-create{
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    width: 90px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight:500;
    padding: 0px;
}
.btn-create:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent); 
    background: var(--bg-main);
}
/* button to view insights from history page */
.btn-view-insights {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-insights:hover {
    background: var(--bg-main);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    transform: translateY(-2px);
}
/*Overlay */
.header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;

}

.header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}
/* OVERLAY (Forces it to float on top of everything) */
.overlay {
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh;
    background: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(8px); 
    display: flex; 
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Guarantees it sits above the navigation bar */
}

/* THE content WINDOW  */
.content {
    width: 90%;
    max-width: 600px;
    max-height: 80vh; /* Prevents it from being taller than the screen */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    color: var(--text-main);
}
.close-modal-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: var(--bg-main);
    color: var(--primary-accent);
    border-color: var(--primary-accent);
}

/* 7. SETTINGS PAGE 
/* ========================================== */
.settings-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.settings-card {
    background: var(--bg-card); /* Now it will change automatically! */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: background 0.3s ease, border 0.3s ease;
}

.settings-card-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 14px;
}

.settings-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background: var(--bg-main);
}

.theme-btn.active-theme {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    background: transparent;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

