/* General Body Styles */
body {
    font-family: 'Nunito', sans-serif;
    background-color: #f7faff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex; /* Centers the app-container vertically and horizontally */
    align-items: center; /* Vertical centering */
    justify-content: center; /* Horizontal centering */
    min-height: 100vh; /* Ensures body takes full viewport height */
    overflow-y: hidden; /* Allow scrolling if content exceeds viewport */
}

/* App Container - Mobile First (Base) */
#app-container {
    width: 100%; /* Take full width on small screens */
    max-width: 100%; /* New: Max width for mobile, reducing wasted space */
    min-height: 100vh; /* Allow height to adjust to content, but keep it substantial */
    max-height: 100vh; /* Prevent it from touching top/bottom on large mobiles */
    position: relative;
    background-color: #ffffff;
    border-radius: 0px; /* rounded-2xl */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-xl */
    overflow: hidden; /* Keep content within bounds, especially rounded corners */
    display: flex;
    flex-direction: column;
    box-shadow: none !important;
    border: 1px solid #313131;
    border-bottom: none;
}

/* Responsive adjustments for #app-container */
@media (min-width: 768px) { /* md breakpoint for tablets and small laptops */
    #app-container {
        max-width: 100%; /* Wider for desktop */
        height: 90vh; /* More fixed height for desktop layout, allowing internal scroll */
        max-height: 900px; /* Prevent it from getting too tall */
    }
}

@media (min-width: 1024px) { /* lg breakpoint for larger desktops */
    #app-container {
        max-width: 100%; /* Even wider for large monitors */
        height: 95vh;
        max-height: 1000px;
    }
}

/* App Screens */
.app-screen {
    width: 100%;
    height: 100%; /* Fill parent height */
    display: flex;
    flex-direction: column;
    /* Removed padding here as it's applied in HTML, will adjust in media queries */
}

/* Base padding for screens (p-8 equivalent) */
.app-screen:not(#auth-screen) {
    padding: 2rem; /* Matches p-8 */
    padding-top: 1em;
}
#auth-screen { /* Auth screen might have different internal padding */
    padding: 2rem;
    padding-top: 1em;
}


/* Transitions and Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
.pop-in {
    animation: popIn 0.3s ease-out forwards;
}

@keyframes xpSplash {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-80px) scale(1.1); opacity: 0; }
}
.xp-splash {
    background-color: #f59e0b; /* amber-500 */
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: bold;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    animation: xpSplash 2.5s ease-out forwards;
    white-space: nowrap; /* Prevent text wrapping */
}

/* Duolingo-style Button */
.duolingo-btn {
    border-bottom-width: 4px;
    transition: all 0.1s ease-in-out;
}
.duolingo-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

/* Duolingo-style Interactive Card */
.duolingo-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.duolingo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Grammar Point Card Style */
.grammar-point-card {
    border: 2px solid #424448; /* gray-200 */
    border-radius: 1rem; /* rounded-2xl */
    padding: 1rem; /* p-4 */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.grammar-point-card:hover {
    border-color: #3b82f6; /* blue-500 */
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.grammar-point-card.selected {
    border-color: #3b82f6; /* blue-500 */
    border-width: 3px;
    background-color: #eff6ff; /* blue-50 */
}

/* Chat Bubbles */
.chat-bubble-user {
    background-color: #3b82f6; /* blue-500 */
    color: white;
}
.chat-bubble-partner {
    background-color: #dfdfdf; /* gray-200 */
    color: #1f2937; /* gray-800 */
}
/* Adjust chat bubble max-width for larger screens */
@media (min-width: 768px) {
    .chat-bubble-wrapper {
        max-width: 60%; /* Allow bubbles to be wider on larger screens */
    }
}


/* Turn Indicator Animation */
.turn-indicator.turn-indicator-active {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Star Rating Styles */
.rating-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: center;
}
.rating-stars input {
    display: none;
}
.rating-stars label {
    font-size: 2.5rem; /* 40px */
    color: #424448; /* gray-200 */
    cursor: pointer;
    transition: color 0.2s;
}
.rating-stars input:checked ~ label,
.rating-stars label:hover,
.rating-stars label:hover ~ label {
    color: #f59e0b; /* amber-500 */
}

/* Modal container styling */
.pop-in-container {
    display: none; /* Controlled by JS */
    position: fixed; /* Use fixed for modals to overlay entire viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* bg-black bg-opacity-50 */
    z-index: 50; 
    display: flex; /* Ensure flex is set by JS when visible */
    align-items: center;
    justify-content: center;
}
/* Specific z-index for guest restriction modal to ensure it's on top */
#guest-restriction-modal {
    z-index: 100;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    opacity: 0; /* Start hidden */
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Typing Indicator Dots */
.typing-dots {
    display: flex;
    align-items: center;
    height: 20px; /* Adjust height as needed */
}

.typing-dots span {
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background-color: #999; /* Dot color */
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
}

/* Connection Banner */
#connection-banner {
    display: none; /* Default to hidden, controlled by JS */
    position: absolute; /* Position relative to its parent (#app-container) */
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 0.75rem; /* p-2 and p-3 converted to rem */
    font-size: 0.875rem; /* text-sm */
    background-color: #2563eb; /* blue-600 */
    color: #ffffff; /* text-white */
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-lg */
    align-items: center; /* Vertically align items in flex */
    justify-content: space-between; /* Space out content and close button */
    z-index: 50; /* Ensure it's above regular content but below modals */
    border-radius: 16px 16px 0 0; /* Match app-container top corners */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Adjust connection banner for larger screens */
@media (min-width: 768px) {
    #connection-banner {
        padding: 0.75rem 1rem; /* Slightly more padding */
        font-size: 1rem; /* Larger font */
    }
}
@media (min-width: 1024px) {
    #connection-banner {
        padding: 1rem 1.25rem;
        font-size: 1.125rem; /* Even larger font */
    }
}

/* Specific button style for logout button in mode selection header */
#mode-selection-screen #logout-btn {
    flex-shrink: 0; /* Prevent it from shrinking */
}

/* Improve general padding and spacing for larger screens */
@media (min-width: 768px) {
    .app-screen {
        padding: 2.5rem; /* from p-8 (2rem) to 2.5rem (p-10 equivalent) */
    }
    .text-4xl {
        font-size: 3.5rem; /* Larger for desktop h1 */
    }
    .text-lg {
        font-size: 1.25rem; /* Larger for inputs/buttons */
    }
    .text-xl {
        font-size: 1.5rem; /* Larger for card titles */
    }
    .text-2xl {
        font-size: 1.875rem; /* Larger for screen headers */
    }
    .text-3xl {
        font-size: 2.25rem; /* Larger for profile username */
    }
    .space-y-4 > *:not([hidden]) ~ *:not([hidden]) {
        margin-top: 1.5rem; /* Increase vertical spacing */
    }
    .space-x-4 > *:not([hidden]) ~ *:not([hidden]) {
        margin-left: 1.5rem; /* Increase horizontal spacing */
    }
    .w-10.h-10 { /* Icons */
        width: 2.75rem; 
        height: 2.75rem;
    }
    /* Adjust input field padding for larger screens */
    input[type="text"], input[type="password"], input[type="email"], textarea, select {
        padding: 1rem; /* from p-4 (1rem) to 1.25rem */
        font-size: 1.125rem; /* text-lg equivalent */
    }
    
    /* Specific adjustments for mode selection screen layout */
    #mode-selection-screen .flex.space-x-2 { /* Navigation icons container */
        gap: 1rem; /* Add gap between icons */
    }
    #mode-selection-screen .flex-grow.flex-col.justify-center.space-y-4 {
        justify-content: flex-start; /* Align content to top, not center */
        margin-top: 2rem;
        padding-top: 0em;
    }
}

/* Specific styling for the actual modal content box */
.pop-in-container > div {
    background-color: #ffffff; /* bg-white */
    border-radius: 1rem; /* rounded-2xl */
    padding: 1.5rem; /* p-6 */
    width: 91.666667%; /* w-11/12 */
    max-width: 448px; /* max-w-md */
    position: relative; /* For absolute positioned close button */
}

@media (min-width: 768px) {
    .pop-in-container > div {
        padding: 2rem; /* Even more padding for desktop modals */
        max-width: 600px; /* Wider modals on desktop */
    }
}

/* Ensure inner screen content is scrollable if needed */
.app-screen > .flex-grow {
    /* overflow-y: auto; */
    /* Add padding-bottom to the scrollable area to prevent content being cut off at the bottom,
       especially with the "Connect to Partner Directly" section */
    padding-bottom: 2rem; /* Adjust as needed */
}

#mode-selection-screen > .flex-grow{
    /* padding-top: 11em; */
    /* overflow: hidden; */
    height: 1200px;
}

/* Specific adjustment for active chats container on larger screens if it gets too wide */
@media (min-width: 768px) {
    #active-chats-container {
        /* Consider wrapping or increasing scroll area. For now, just ensure it handles overflow. */
        flex-wrap: wrap; /* Allow wrapping if items don't fit in single row */
        justify-content: start; /* Center active chat bubbles if they wrap */
        gap: 1.5rem; /* Space between wrapped items */
        padding-bottom: 0; /* Remove extra padding if wrapping */
    }
}

div#chat-messages {
    background: transparent;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}
.animate-wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

div#conversation-timer {
    margin-left: 2em;
}

#topic-change-modal, #report-modal, #correction-modal{
    display: none;
}

/* =============================================== */
/* Styles for the Connected Partners Container    */
/* =============================================== */

/* * Main container for the section.
 * - Adds a light blue background.
 * - Adds padding and rounded corners for a modern card-like look.
*/
#connected-partners-section {
    background-color: #eff6ff; /* A light, pleasant blue (Tailwind blue-100) */
    padding: 1rem;
    border-radius: 1.25rem; /* A nice rounded corner */
    border: 1px solid #dbeafe; /* A slightly darker blue for the border */
}

/*
 * Styling for the "Connected Partners" title.
 * - Makes the text a darker, more readable blue to stand out.
*/
#connected-partners-section h3 {
    color: #1e3a8a; /* A rich, dark blue (Tailwind blue-800) */
    font-weight: 800; /* extra-bold */
    padding-left: 0.25rem;
}

/*
 * Styling for the placeholder text when no partners are connected.
 * - Ensures it's also a readable, muted blue color.
*/
#no-connected-partners {
    color: #3b82f6; /* A friendly, medium blue (Tailwind blue-500) */
    text-align: center;
    padding: 0.5rem 0;
    font-weight: 500;
}

/*
 * Styling for each individual partner item within the list.
 * - Changes the background from gray to a clean white for contrast.
 * - Adds a subtle inner shadow to give it depth.
*/
#connected-partners-container > div {
    background-color: #FFFFFF;
    box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* Padding and flex are handled by existing Tailwind classes, but we ensure them */
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/*
 * Styling for the partner's name text.
*/
#connected-partners-container .font-bold {
    color: #1e40af; /* A dark, readable blue (Tailwind blue-700) */
}

/*
 * Styling for the "Waiting for host..." text.
 * - Makes it a muted, italicized gray-blue.
*/
#connected-partners-container .text-gray-500 {
    color: #6b7280; /* A neutral gray (Tailwind gray-500) */
    font-style: italic;
    font-weight: 500;
}

/* The .start-direct-chat-btn is already styled well by its Tailwind classes, so no override is needed. */

div#direct-chat-selection-banner {
    margin-top: 5em;
}

/* General App Style */
#mode-selection-screen {
    background: #141213; /* Dark background for the app container */
}

/* Make text on mode screen white/light gray for dark background */
#mode-selection-screen, #mode-selection-screen h3, #mode-selection-screen p {
    color: #EAEAEA;
}
#mode-selection-screen .text-gray-500 {
    color: #9CA3AF;
}
#mode-selection-screen .text-gray-600 {
    color: #D1D5DB;
}
#mode-selection-screen .text-gray-300 {
    color: #D1D5DB;
}
#mode-selection-screen .border-gray-700 {
    border-color: #4A5568;
}

/* --- NEW CARD STYLES --- */

/* Large Card Style (Applied to Topic Mode) */
#select-topic-mode.duolingo-card-large {
    background-color: #ddc1ff; /* Light Purple */
    border-radius: 1.5rem; /* 24px */
    padding: 1.5rem; /* 24px */
    min-height: 250px;
    transition: transform 0.2s ease-in-out;
}
#select-topic-mode.duolingo-card-large:hover {
    transform: scale(1.02);
}
#select-topic-mode.duolingo-card-large h3, #select-topic-mode.duolingo-card-large p {
    color: #000;
}

/* Small Card Styles (For the grid) */
.duolingo-card-small {
    border-radius: 1.5rem; /* 24px */
    padding: 1rem; /* 16px */
    min-height: 180px;
    transition: transform 0.2s ease-in-out;
}
.duolingo-card-small:hover {
    transform: scale(1.03);
}
.duolingo-card-small h4, .duolingo-card-small p, .duolingo-card-small span {
     color: #000;
}

/* Specific colors for small cards */
#select-grammar-mode.duolingo-card-small {
    background-color: #F8E71C; /* Yellow */
}
#select-local-mode.duolingo-card-small {
    background-color: #7ED321; /* Green */
}
#select-bot-mode.duolingo-card-small {
    background-color: #50E3C2; /* Teal */
}
#assess-level-card.duolingo-card-small {
    background-color: #4A90E2; /* Blue */
}

/* Styles for top navigation icons */
.nav-icon-btn {
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffffe0;
    transition: background-color 0.2s;
}
.nav-icon-btn:hover {
    background-color: #4A5568; /* Lighter gray on hover */
}

.duolingo-card-small h4, .duolingo-card-small p{
    color: #000000 !important;
}

.proAvatarContainer{
    width: 100px;
}

#pro-button{
    overflow: hidden;
    max-height: 50px;
    background: #132b45;
    border: 1px solid #1e7393;
}

:root {
    /* I've defined a variable for the primary orange color from your design. */
    --brand-orange: #FF6B2C; 
  }
  
  /* --- Subscription Page Specific Styles --- */
  
  #subscription-screen {
      /* A dark charcoal background to match the mockup */
      background-color: #1F1F1F; 
  }
  
  .bg-brand-orange {
      background-color: var(--brand-orange);
  }
  
  .border-brand-orange {
      border-color: var(--brand-orange);
  }
  
  .text-brand-orange {
      color: var(--brand-orange);
  }
  
  /* The main orange container at the top */
  .subscription-hero {
      background-color: var(--brand-orange);
      box-shadow: 0px 10px 30px -5px rgba(255, 107, 44, 0.4);
  }
  
  /* The individual plan selection boxes */
  .subscription-plan {
      background-color: #2a2a2e; /* A slightly lighter dark gray for contrast */
      border-width: 2px;
      border-color: #4b5563; /* Default border color (gray-600) */
      transition: all 0.3s ease-in-out;
  }
  
  /* The style for the currently selected plan */
  .subscription-plan.selected {
      border-color: var(--brand-orange);
      background-color: #3a302b; /* A subtle, dark orange-tinted background */
      transform: scale(1.03);
  }
  
  /* The radio-button-like circle for selection */
  .plan-selector {
      width: 24px;
      height: 24px;
      border: 2px solid #6b7280; /* gray-500 */
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: border-color 0.3s ease;
  }
  
  .subscription-plan.selected .plan-selector {
      border-color: var(--brand-orange);
  }
  
  /* The inner orange dot of the selected plan */
  .plan-selector .selected-indicator {
      width: 14px;
      height: 14px;
      background-color: var(--brand-orange);
      border-radius: 50%;
      transform: scale(0);
      transition: transform 0.2s ease-in-out;
  }
  
  .subscription-plan.selected .selected-indicator {
      transform: scale(1);
  }

  .subscription-hero{
    padding-top:2em !important;
  }
/* 
  #chat-screen{
    background: #141213;
  } */
/* 
  div#chat-messages {
    background: #2b2b2b;
}

.chat-bubble-wrapper{
    background: #eb7828;
}

#chat-screen .p-4{
    background-color: rgb(35 36 45) !important;
} */

/*
 Styles for visually indicating a locked premium feature.
 Add this to your main style.css file.
*/

.locked-feature {
    opacity: 0.65;
    position: relative;
    cursor: pointer; /* Keeps it clickable to show the upgrade modal */
    transition: opacity 0.2s ease-in-out;
  }
  
  .locked-feature:hover {
      opacity: 0.8;
  }
  
  /* Add a crown icon to the top right of the locked feature card */
  .locked-feature::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 24px;
    color: #FBBF24; /* Tailwind's amber-400 color */
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    pointer-events: none; /* Make sure the icon doesn't block clicks */
  }
  
  /* ===== Custom Scrollbar CSS ===== */

/* For Webkit-based browsers (Chrome, Safari, Edge, etc.) */
* ::-webkit-scrollbar {
    width: 10px;
  }
  
  /* The track (the background of the scrollbar) */
  * ::-webkit-scrollbar-track {
    background: #2d2d2d; /* A dark gray, slightly lighter than the body */
    border-radius: 10px;
  }
  
  /* The draggable scrolling handle */
  * ::-webkit-scrollbar-thumb {
    background: #555; /* A medium gray for the handle */
    border-radius: 10px;
    border: 2px solid #2d2d2d; /* Creates a nice padding effect */
  }
  
  /* Handle on hover */
  * ::-webkit-scrollbar-thumb:hover {
    background: #6a6a6a; /* Lighter gray on hover for better UX */
  }
  
  /* For Firefox */
  *.overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #555 #2d2d2d; /* thumb color track color */
  }

  /* Add this to your main CSS file */
.pinned-chat-badge {
    position: absolute;
    top: -1px;
    right: 10px;
    background-color: #60a5fa; /* A nice blue color */
    color: white;
    padding: 2px 8px;
    border-radius: 0 0 0.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Styles for the AI Summary --- */
.summary-section-card {
    background-color: white;
    border-radius: 0.75rem; /* 12px */
    border: 1px solid #424448; /* cool-gray-200 */
    padding: 1rem; /* 16px */
    margin-bottom: 1rem; /* 16px */
    transition: all 0.3s ease-in-out;
}

.summary-progress-bar {
    display: flex;
    height: 0.75rem; /* 12px */
    border-radius: 9999px;
    overflow: hidden;
    background-color: #424448; /* cool-gray-200 */
}

.summary-progress-user {
    background-color: #3b82f6; /* blue-500 */
    transition: width 0.5s ease-in-out;
}

.summary-progress-partner {
    background-color: #f97316; /* orange-500 */
    transition: width 0.5s ease-in-out;
}

/* For the fade-in animation */
.summary-fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
}

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

#summary-container{
    /* position: absolute;
    top: 0;
    max-height: 100%;
    overflow-y: scroll; */
}

/* In css/style.css */

/* New Leaderboard Card Styles */
.leaderboard-item {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#leaderboard-list .leaderboard-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* In css/style.css */

/* --- START: Replace old tooltip styles with this block --- */

#custom-tooltip {
    /* Core Styling */
    position: absolute; /* Changed from 'absolute' to 'fixed' for smoother viewport positioning */
    z-index: 100;
    padding: 12px 16px;
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    border-radius: 12px;
    max-width: 250px;
    
    /* Modern "Frosted Glass" Effect */
    background-color: rgba(30, 41, 59, 0.75); /* semi-transparent slate-800 */
    -webkit-backdrop-filter: blur(8px); /* Safari */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Visibility & Smooth Animation Control */
    opacity: 0;
    pointer-events: none; /* Allows mouse to pass through to elements underneath */
    /* We now transition transform for smooth movement */
    transition: opacity 0.2s ease-in-out, transform 0.15s ease-out; 
}

#custom-tooltip.visible {
    opacity: 1;
}

/* Typography and Layout inside the tooltip */
#custom-tooltip .tooltip-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px; /* Increased gap for better spacing */
    align-items: center;
}

#custom-tooltip .tooltip-grid .lucide {
    color: #a78bfa; /* A nice violet color for icons */
    width: 18px;
    height: 18px;
}

#custom-tooltip .tooltip-grid span {
    color: #cbd5e1; /* Lighter text color (slate-300) */
}

#custom-tooltip .tooltip-grid span strong {
    color: #ffffff; /* White for emphasis */
    font-weight: 600;
}

/* --- END of new tooltip style block --- */

/* --- Advanced Leaderboard Card Styles --- */

.lb-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    border-width: 1px;
    transition: all 0.2s ease-in-out;
}

.lb-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border-color: #3b82f6; /* Blue-500 */
}

.lb-card-rank {
    font-size: 1.125rem;
    font-weight: 700;
    color: #6b7280; /* Gray-500 */
    width: 2.5rem;
    text-align: center;
}

.lb-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    object-fit: cover;
    border: 2px solid #424448; /* Gray-200 */
}

.lb-card-pro-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    background-image: linear-gradient(to right, #4f46e5, #7c3aed); /* Indigo to Purple */
    padding: 2px 6px;
    border-radius: 9999px;
    margin-left: 8px;
    line-height: 1;
}

.lb-card .xp-progress-bar {
    background-color: #424448; /* Gray-200 */
    border-radius: 9999px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
}

.lb-card .xp-progress-fill {
    background-color: #3b82f6; /* Blue-500 */
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease-out;
}

.lb-card-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.lb-card-stat-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Star Rating Styles */
.star-rating-display {
    display: flex;
    align-items: center;
}
.star-rating-display .lucide {
    width: 16px;
    height: 16px;
    color: #f59e0b; /* Amber-500 */
}

/* In css/style.css */

/* --- NEW: Advanced Podium Design --- */
#leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Aligns users to the bottom of their stands */
    gap: 4px;
    padding: 2rem 1rem 0 1rem;
    position: relative;
    min-height: 280px; /* Give the podium area a fixed height */
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
}

.podium-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px; /* Space between user info and the stand */
}

.podium-stand {
    width: 100%;
    background-color: #424448; /* gray-200 */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: center;
    font-weight: 800;
    color: #4b5563; /* gray-600 */
    font-size: 2rem;
    padding-top: 8px;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.1);
}

.podium-stand--1 {
    height: 120px;
    background-image: linear-gradient(to top, #fbbf24, #fde68a); /* amber-400 to amber-200 */
}
.podium-stand--2 {
    height: 90px;
    background-image: linear-gradient(to top, #9ca3af, #d1d5db); /* gray-400 to gray-300 */
}
.podium-stand--3 {
    height: 60px;
    background-image: linear-gradient(to top, #fb923c, #fdba74); /* orange-400 to orange-300 */
}

/* In css/style.css */

/* --- NEW: Advanced Profile Page Design --- */

.profile-header-banner {
    background: linear-gradient(to right, #43447a, #2c2d4e);
    height: 120px;
    position: relative;
    display: none;
}

.profile-avatar-container {
    position: absolute;
    bottom: -48px; /* Half of avatar height */
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid white;
    background-color: white;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-main-content {
    padding-top: 11px; /* Space for the overlapping avatar */
}

/* Stats Grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}



.profile-stat-card .lucide {
    margin: 0 auto 0.5rem auto;
    color: #4f46e5; /* indigo-600 */
}

/* Activity Heatmap */
.activity-heatmap {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    gap: 3px;
    margin-top: 1rem;
}

.heatmap-day {
    width: 12px;
    height: 12px;
    background-color: #ebedf0; /* gray-200 */
    border-radius: 2px;
}
.heatmap-day[data-level="1"] { background-color: #9be9a8; }
.heatmap-day[data-level="2"] { background-color: #40c463; }
.heatmap-day[data-level="3"] { background-color: #30a14e; }
.heatmap-day[data-level="4"] { background-color: #216e39; }

/* In css/style.css */

/* --- NEW: Advanced Profile Page Re-Haul Styles --- */

.profile-stat-card .proficiency-meter {
    display: flex;
    gap: 4px;
    height: 10px;
    width: 100%;
}
.profile-stat-card .proficiency-segment {
    flex-grow: 1;
    background-color: #424448; /* gray-200 */
    border-radius: 4px;
}
.profile-stat-card .proficiency-segment.active {
    background-color: #4f46e5; /* indigo-600 */
}

.achievements-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.achievement-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #f3f4f6; /* gray-100 */
    border-radius: 9999px;
    border: 2px solid #424448; /* gray-200 */
    color: #6b7280; /* gray-500 */
    cursor: pointer;
    transition: all 0.2s ease-out;
}
.achievement-badge.unlocked {
    background-color: #fefce8; /* yellow-50 */
    border-color: #facc15; /* yellow-400 */
    color: #ca8a04; /* yellow-600 */
}
.achievement-badge:hover {
    transform: scale(1.1);
}

.activity-feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    transition: background-color 0.2s;
}
.activity-feed-item:hover {
    background-color: #f9fafb; /* gray-50 */
}

p.text-xs.text-gray-500.font-semibold.text-right.mt-1 {
    text-align: left;
}

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

/* In css/style.css */

/* --- NEW: Advanced Heatmap Styling --- */
.heatmap-container {
    display: flex;
    gap: 6px;
}

.heatmap-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 9px;
    color: #6b7280; /* gray-500 */
    padding-top: 20px; /* Align with top of squares */
}

.heatmap-main {
    width: 100%;
    overflow-x: auto; /* This fixes the overflow issue */
    overflow-y: hidden;
    padding-bottom: 8px; /* Space for scrollbar */
}

.heatmap-months {
    display: flex;
    font-size: 10px;
    color: #6b7280; /* gray-500 */
    margin-bottom: 4px;
    padding-left: 20px; /* Align with first column */
}
.heatmap-months > div {
    min-width: 60px; /* Approx 4 weeks width */
}

#vocabulary-screen{
    overflow-y: scroll;
}

/* css/style.css or inside a <style> tag */

/* --- Quiz Effect Animations --- */

/* Shake animation for incorrect answers */
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
  }
  .shake-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  }
  
  /* Countdown animation for quiz start */
  @keyframes countdown-pop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  @keyframes countdown-fade {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
  }
  .countdown-container {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: rgba(255, 255, 255, 0.7);
      z-index: 100;
  }
  .countdown-text {
      font-size: 8rem;
      font-weight: 800;
      color: #4c51bf;
      animation: countdown-pop 0.3s ease-out, countdown-fade 0.3s ease-in 0.5s;
  }
  
  /* Particle effect for correct answers */
  .particle {
      position: absolute;
      border-radius: 50%;
      pointer-events: none;
      z-index: 200;
  }
  
  /* Combo counter effect */
  .combo-counter {
      position: absolute;
      font-size: 2rem;
      font-weight: 800;
      color: #f59e0b; /* Amber-500 */
      text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;
      pointer-events: none;
      z-index: 200;
      transform: translateX(-50%);
  }
  
  /* Results screen pop-in effect */
  .results-stat-card {
      opacity: 0;
      transform: scale(0.8);
      transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  }
  .results-stat-card.pop-in {
      opacity: 1;
      transform: scale(1);
  }
  
  /* Confetti for perfect scores */
  @keyframes confetti-fall {
      0% { transform: translateY(-100px) rotateZ(0deg); opacity: 1; }
      100% { transform: translateY(100vh) rotateZ(360deg); opacity: 0; }
  }
  .confetti {
      position: absolute;
      top: 0;
      width: 10px;
      height: 10px;
      opacity: 0;
      animation: confetti-fall 3s linear infinite;
  }

  /* In css/style.css */

/* --- ADVANCED QUIZ EFFECTS --- */

/* For Juicy Button Feedback */
.duolingo-btn:active, .quiz-option:active, .flashcard-feedback:active {
    transform: scale(0.96);
    filter: brightness(0.95);
    transition: transform 0.05s;
}

/* 3D Card Flip Animation */
.quiz-card-container {
    perspective: 1000px;
}
.quiz-card {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.quiz-card.is-flipped {
    transform: rotateY(180deg);
}
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.card-back {
    transform: rotateY(180deg);
}

/* "SSR" Effect for getting a difficult word right */
@keyframes ssr-flash {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.6; }
    100% { opacity: 0; transform: scale(1.5); }
}
.ssr-effect-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(255,229,153,0) 0%, rgba(252,211,77,0.8) 40%, rgba(245,158,11,0) 80%);
    z-index: 200;
    pointer-events: none;
    animation: ssr-flash 0.8s ease-out forwards;
}

/* LEVEL UP Animation */
@keyframes level-up-pop {
  0% { transform: translateY(50px) scale(0.5); opacity: 0; }
  50% { transform: translateY(0) scale(1.2); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes level-up-fade {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50px); }
}
.level-up-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}
.level-up-text {
    font-size: 5rem;
    font-weight: 900;
    color: #f59e0b; /* Amber 500 */
    text-shadow: 3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff, 4px 4px 0px rgba(0,0,0,0.2);
    animation: level-up-pop 0.5s ease-out, level-up-fade 0.5s ease-in 1.5s;
}

.summary-fade-in.bg-slate-50.p-4.rounded-t-lg.overflow-y-auto.h-full {
    padding-bottom: 7em;
}

.mt-4 {
    /* z-index: 12; */
}

#bottom-dock {
    border-top: 1px solid #4a5568; /* a subtle top border */
    transition: transform 0.3s ease-in-out;
    border-radius: 20px;
    width: 350px;
    height: 50px;
    margin: 0 auto;
    margin-bottom: 1em;
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0aec0; /* gray-400 */
    font-size: 0.75rem; /* 12px */
    font-weight: 600;
    width: 20px;
    height: 20px;
    transition: all 0.2s ease-in-out;
    border-radius: 0.75rem; /* 12px */
    margin-top: 6px;
}

.dock-btn.active {
    color: #f6e05e; /* yellow-300 */
}

.dock-btn.active i {
    transform: scale(1.1);
}

.dock-btn span {
    margin-top: 4px;
}

/* Animation for the "More Options" menu */
.pop-up-from-bottom {
    animation: slideUp 0.3s ease-out forwards;
}

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

div#bottom-dock {
    background: #1f2123;
}

/* Default style for ALL icons inside the dock */
.dock-btn svg {
    width: 28px;
    height: 28px;
    stroke: #4e5256;  /* Set a consistent dark gray OUTLINE for all inactive icons */
    fill: none;       /* Ensure they are NOT filled by default */
    stroke-width: 2;
    transition: all 0.2s ease-in-out;
}



/* --- THE FIX: Active State with Higher Specificity --- */
/* This rule is more specific and will correctly override the defaults. */
.dock-btn.active {
    color: #f6e05e; /* Change text color to active yellow */
}

/* We target the SVG inside the active button */
.dock-btn.active svg {
    stroke: #f6e05e;    /* ALSO change the stroke to yellow for a solid look */
}

/* Set the background for the auth screen container */
#auth-screen {
    background-color: #1a1a1a; /* A very dark charcoal background */
    /* This ensures the content inside is centered vertically */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Style for the text-based inputs */
.auth-input-dark {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
    color: #ffffff;
    background-color: #1f2937; /* Dark blue-gray */
    border: 2px solid #374151; /* Slightly lighter gray border */
    border-radius: 0.75rem; /* 12px */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Style for the inputs when they are focused (clicked on) */
.auth-input-dark:focus {
    outline: none;
    border-color: #facc15; /* Bright yellow border on focus */
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.3); /* Soft yellow glow */
}

/* Style for the main action button (Login/Create Account) */
.auth-button-main {
    width: 100%;
    padding: 1rem;
    border-radius: 0.75rem; /* 12px */
    border: none;
    color: #111827; /* Dark text for contrast on yellow button */
    background-color: #facc15; /* Vibrant yellow */
    font-weight: 700; /* Bold */
    font-size: 1.1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.15s ease-out, background-color 0.15s ease-out;
    transform-origin: center;
}

/* Add a hover effect to make the button feel interactive */
.auth-button-main:hover {
    background-color: #fde047; /* Slightly lighter yellow on hover */
    transform: scale(1.03); /* Gently grows on hover */
}
/* === EVEN BETTER STYLING (ADD THIS TO css/style.css) === */
/* Add this to the bottom of your css/style.css file */

.mode-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem; /* 12px */
    border-radius: 1rem; /* 16px */
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.mode-list-icon-wrapper {
    width: 4rem;  /* 64px */
    height: 4rem; /* 64px */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem; /* 12px */
    flex-shrink: 0;
    margin-right: 1rem; /* 16px */
}

.mode-list-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-in-out;
}

.mode-list-item:hover .mode-list-icon {
    transform: scale(1.1);
}

.mode-list-text {
    flex-grow: 1;
}

.mode-list-title {
    font-size: 1.125rem; /* 18px */
    font-weight: 800; /* extra-bold */
    color: #E5E7EB; /* gray-200 */
}

.mode-list-description {
    font-size: 0.875rem; /* 14px */
    color: #9CA3AF; /* gray-400 */
}

.mode-list-arrow {
    width: 1.25rem; /* 20px */
    height: 1.25rem; /* 20px */
    color: #6B7280; /* gray-500 */
    margin-left: 1rem; /* 16px */
    flex-shrink: 0;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.mode-list-item:hover .mode-list-arrow {
    transform: translateX(4px);
    color: #E5E7EB; /* gray-200 */
}

/* --- 1. Base Styles for the Enhanced List Item --- */
.mode-list-item {
    /* Use a darker base and a gradient for a lighting effect */
    background-color: #1f2228; /* A dark, neutral base */
    background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent);
    
    /* A subtle inner shadow gives a top-lit 3D effect */
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);

    /* We'll use a pseudo-element for the border to allow for gradients */
    border: none; 
    position: relative; /* Needed for the pseudo-element border */
    z-index: 1;
}

/* --- 2. The Gradient Border Effect --- */
.mode-list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem; /* Must match the parent's border-radius */
    padding: 1px; /* This controls the "border" thickness */
    
    /* The magic: A gradient border that uses the --glow-color variable */
    background: linear-gradient(135deg, var(--glow-color, #888), #374151); /* Default from color to gray */
    
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0.4;
    transition: opacity 0.3s ease-in-out;
}

/* Add this to css/style.css */
.view-toggle-btn {
    padding: 0.375rem; /* 6px */
    border-radius: 0.375rem; /* 6px */
    color: #9ca3af; /* gray-400 */
    transition: all 0.2s ease-in-out;
}
.view-toggle-btn:hover {
    color: #fff;
    background-color: #4b5563; /* gray-600 */
}
.view-toggle-btn.active {
    background-color: #3b82f6; /* blue-500 */
    color: #fff;
}

/*
================================
New Chat Screen Styles
================================
*/

/* --- Main Chat Screen --- */
#chat-screen {
    background-color: #1C1C1E;
}

/* --- Sticky Prompt Header --- */
#ai-question {
    color: #EAEAEA;
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 700;
}

/* --- Message Bubbles --- */
#chat-messages .chat-bubble-user {
    background-color: #007AFF; /* A vibrant blue for user messages */
    color: white;
    border-radius: 1.25rem;
}

#chat-messages .chat-bubble-partner {
    background-color: #3A3A3C; /* Dark grey for partner messages */
    color: white;
    border-radius: 1.25rem;
}

/* --- Creative Correction Bubble Style --- */
.correction-bubble {
    background-color: #333;
    border-left: 4px solid #FDBB2D;
    padding: 1rem;
    border-radius: 0.75rem;
    margin: 1rem auto;
    max-width: 95%;
    width: 100%;
}

.correction-bubble .correction-header {
    font-weight: bold;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    color: #FDBB2D;
    font-size: 0.9rem;
}

.correction-bubble .correction-diff-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.correction-diff-text .diff-added {
    background-color: rgba(4, 120, 87, 0.4); /* Transparent green */
    color: #A7F3D0;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
}

.correction-diff-text .diff-removed {
    background-color: rgba(153, 27, 27, 0.4); /* Transparent red */
    color: #FECACA;
    text-decoration: line-through;
    padding: 2px 4px;
    border-radius: 4px;
}

/* --- Typing Indicator --- */
#typing-indicator .typing-dots span {
    background-color: #8E8E93;
}

/* --- Bottom Input Area --- */
#message-input {
    background-color: transparent;
    border: none;
    color: white;
}

#message-input:focus {
    outline: none;
    box-shadow: none;
    ring-offset-width: 0;
}

#message-input::placeholder {
    color: #8E8E93;
}

#send-message-btn {
    background-color: #FDBB2D;
    color: #1C1C1E; /* Dark icon for contrast */
    transition: background-color 0.2s;
}

#send-message-btn:hover {
    background-color: #ffca48;
}

/* --- Turn Indicator (Hidden but styled for JS compatibility) --- */
#turn-indicator {
    display: none; /* We are hiding this in favor of the new design */
}



/*
================================
New "Background-less" Message Styles
================================
*/

/* --- Remove the bubble background and padding --- */
#chat-messages .chat-bubble-user,
#chat-messages .chat-bubble-partner {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    max-width: 100%; /* Allow messages to take more width */
    align-items: flex-start; /* Align icon to the top */
}

/* Position the message text and action buttons */
#chat-messages .chat-bubble-partner {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between text and icon */
}

/* --- Style the message text itself --- */
#chat-messages .chat-bubble-wrapper p.break-words {
    font-size: 1.4rem;  /* Larger font size */
    line-height: 1.5;   /* More space between lines */
    font-weight: 600;   /* Bolder text */
    flex-grow: 1;       /* Allow text to take up space */
}

/* User's sent message text is the accent color */
#chat-messages .chat-bubble-user p.break-words {
    color: #FDBB2D; 
    text-align: right; /* Align user text to the right */
}

/* Partner's received message text is white */
#chat-messages .chat-bubble-partner p.break-words {
    color: #EAEAEA;
}

/* --- Reposition and style action buttons (Translate/Speak) --- */
#chat-messages .message-actions {
    margin-top: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column; /* Stack icons vertically if needed */
    gap: 0.5rem;
}

#chat-messages .message-actions .translate-message-btn,
#chat-messages .message-actions .speak-message-btn {
    color: #8E8E93; /* Subtle grey for icons */
    transition: color 0.2s ease;
}

#chat-messages .message-actions .translate-message-btn:hover,
#chat-messages .message-actions .speak-message-btn:hover {
    color: #FFFFFF; /* Bright white on hover */
}

/* --- Style for System Messages (e.g., "Time's up!") --- */
span.bg-gray-200.text-gray-600.text-xs.font-semibold.px-3.py-1.rounded-full {
    background: #333333;
    color: #ffc32a;
}

button.speak-message-btn.text-purple-500.hover\:text-purple-700, svg.lucide.lucide-volume-2.w-5.h-5 {
    margin: 0 !important;
    color: #fff !important;
}

svg.lucide.lucide-languages.w-5.h-5, svg.lucide.lucide-volume-2.w-5.h-5 {
    color: #fff;
}

/* --- New styles for translated text layout --- */

/* This turns the main message container into a vertical layout */
#chat-messages .chat-bubble-partner {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns content to the left */
    gap: 0.5rem; /* Adds a small space between the original message and the translation */
}

/* This new class keeps the original message and its icons on the same line */
.message-line {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
}

/* This is the style for the translated text that appears underneath */
.translation-text {
    color: #8E8E93; /* A lighter grey for the translation */
    font-size: 1.1rem; /* Slightly smaller font for the translation */
    font-weight: 500;
    font-style: italic;
    max-width: 100%;
}

.button.speak-message-btn{
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.space-x-2 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 0;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

#ai-question {
    font-size: 2rem;
}

/* Override for mobile screens (<= 500px) */
@media only screen and (max-width: 500px) {
    #ai-question {
        font-size: 22px;
    }
}

.sticky.top-0.bg-gradient-to-b.from-\[\#1C1C1E\].to-transparent.p-6.pt-2.z-10 {
    border-bottom: 1px solid #3f3f3f;
}

svg.lucide.lucide-arrow-left {
    width: 17px;
    color: #fff;
}

/*
================================
New Homepage Header & Lists Styles
================================
*/

/* --- New Simplified Header --- */
.home-header {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.home-header:hover {
    background-color: #2C2C2E;
}
.home-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #555;
}
.home-header-text {
    margin-left: 0.75rem;
}
.home-header-text #user-name-display {
    font-size: 1.125rem;
    font-weight: 700;
    color: #FFF;
}
.home-header-text #user-status-display {
    font-size: 0.75rem;
    font-weight: 700;
    color: #FDBB2D; /* Gold accent for PRO */
    text-transform: uppercase;
}
.home-header-stats {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #AEAEB2;
}
.home-header-stats #streak-container,
.home-header-stats #xp-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 700;
}
.home-header-stats .lucide {
    width: 20px;
    height: 20px;
}
.home-header-stats #streak-container { color: #FDBB2D; }
.home-header-stats #xp-container { color: #5E5CE6; }
.home-header-stats #admin-btn { color: #AEAEB2; }

/* --- Section Titles --- */
.home-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #EAEAEA;
    margin-bottom: 0.5rem;
}

/* --- Active Chats --- */
#active-chats-container .active-chat-bubble img {
    border: 3px solid #0A84FF;
    padding: 2px;
}
#active-chats-container .active-chat-bubble p {
    color: #EAEAEA;
    font-weight: 500;
}

/* --- New Learner Card --- */
.learner-card {
    background-color: #1C1C1E;
    border: 1px solid #3A3A3C;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease-in-out;
}
.learner-card:hover {
    transform: translateY(-2px);
    border-color: #555;
}
.learner-card-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    flex-grow: 1;
    min-width: 0;
}
.learner-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.learner-card-info {
    min-width: 0;
}
.learner-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.learner-card-langs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 2px;
}
.learner-card-langs img {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}
.learner-card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1rem;
}
.learner-card-level {
    background-color: #5856D6; /* Purple accent */
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid #1C1C1E;
    box-shadow: 0 0 0 2px #5856D6;
}
.learner-card .hub-connect-btn {
    background-color: #34C759; /* Green accent */
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transform: scale(1);
    transition: transform 0.2s ease;
}
.learner-card .hub-connect-btn:hover {
    transform: scale(1.1);
}

.recent-learners-container{
    margin-bottom: 1em;
    margin-top: -1em;
}

#user-name-display svg{
    position: relative;
    top: 13px;
}

/*
================================
New Active Chat Card Styles
================================
*/

/* Add horizontal padding to the scrolling container */
#active-chats-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    gap: 1em;
}

.active-chat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 240px;
    height: 140px;
    background: #2C2C2E;
    border-radius: 1.25rem;
    padding: 1rem;
    border: 1px solid #3A3A3C;
    flex-shrink: 0;
    transition: all 0.2s ease-in-out;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.active-chat-card:hover {
    transform: translateY(-4px);
    border-color: #555;
}

/* Colored accent border at the top */
.active-chat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #5856D6; /* Default color */
}
.active-chat-card.mode-topic::before {
    background-color: #0A84FF; /* Blue for Topic */
}
.active-chat-card.mode-grammar::before {
    background-color: #5856D6; /* Purple for Grammar */
}

/* Card content styling */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #444;
}
.card-partner-info {
    min-width: 0;
}
.partner-name {
    font-weight: 700;
    color: #FFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topic-name {
    font-size: 0.8rem;
    color: #AEAEB2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: #FF453A;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1C1C1E;
}

.card-body {
    padding: 0.25rem 0;
}
.last-message {
    font-style: italic;
    color: #EAEAEA;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-footer {
    text-align: right;
}
.timestamp {
    font-size: 0.75rem;
    font-weight: 500;
    color: #8E8E93;
}

svg.lucide.lucide-shield-check{
    stroke: #fff;
}

/* Styling for the last message sender's name */
.last-sender-name {
    display: block;
    font-size: 0.75rem;
    color: #AEAEB2;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-connect-btn .lucide {
    pointer-events: none;
}

p.text-4xl.font-bold.text-gray-800.break-words, .p.text-4xl.font-bold.break-words {
    font-size: 20px;
    text-align: center;
    line-height: 24px;
}

.app-screen:not(#chat-screen) svg.lucide-arrow-left {
    color: #333 !important;
}

.profile-stat-card {
    background-color: white;
    border-radius: 0.75rem; /* 12px */
    border: 1px solid rgb(67 66 66 / 16%) !important;
    padding: 1rem;
    text-align: center;
}

/*
================================
Auto-Hide Bottom Dock Styles
================================
*/
#bottom-dock {
    /* Establishes the default, visible state and the transition effect */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#bottom-dock.hidden-by-scroll {
    /* This class is added by JS to fade out the dock */
    opacity: 0;
    visibility: hidden;
}

/* --- Styling for the new 'End Chat' button on cards --- */

/* This wrapper helps separate the main clickable area from the button */
.card-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.end-chat-card-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    padding: 0.25rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    color: #AEAEB2;
    cursor: pointer;
    line-height: 0;
    transition: all 0.2s ease-in-out;
}

.end-chat-card-btn:hover {
    background-color: #FF453A; /* Red on hover */
    color: white;
    transform: scale(1.1);
}

.active-chat-card{
    cursor: pointer !important;
}

#connect-partner-mode-container{
    margin-bottom: 1em;
}
