/* ===================================
   THEME VARIABLES (LIGHT)
=================================== */
/* In global.css */
*, *::before, *::after {
  box-sizing: border-box;
}
:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #222;
    --subtext: #666;
    --primary: #6c63ff;

    --input: #ececf1;
    --bubble-ai: #6c63ff;
    --bubble-user: #e4e4eb;

    --shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ===================================
   THEME VARIABLES (DARK) — optional
=================================== */
body.dark {
    --bg: #0f0f11;
    --card: #18181c;
    --text: #f2f2f7;
    --subtext: #aaa;
    --primary: #7d74ff;

    --input: #242428;
    --bubble-ai: #7d74ff;
    --bubble-user: #2d2d32;

    --shadow: 0 6px 18px rgba(0,0,0,0.55);
}

/* ===================================
   TRANSITIONS
=================================== */
* {
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ===================================
   BASE LAYOUT
=================================== */
body {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page-content {
    padding: 18px 16px 100px;
    animation: fadeSlide 0.35s ease;
}

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

/* ===================================
   TOP BAR
=================================== */
.top-bar {
    background: var(--card);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: var(--shadow);
    border-radius: 0 0 20px 20px;

    position: sticky;
    top: 0;
    z-index: 20;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-logo {
    width: 40px;
    border-radius: 12px;
}

.top-app-name {
    font-size: 17px;
    font-weight: 700;
}

.top-subtext {
    font-size: 12px;
    color: var(--subtext);
}

.theme-toggle {
    font-size: 20px;
    cursor: pointer;
}

/* ===================================
   BOTTOM NAV
=================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    height: 70px;
    background: var(--card);

    display: flex;
    justify-content: space-around;
    align-items: center;

    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);

    z-index: 30;
}

.nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    color: var(--subtext);
}

.nav-item span {
    display: block;
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

/* ===================================
   FORM ELEMENTS
=================================== */
input {
    background: var(--input);
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text);
    font-size: 14px;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-btn {
    background: #dedee3;
    color: #333;
    border: none;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
}

/* ===================================
   CHAT BUBBLES
=================================== */
.ai-bubble {
    background: var(--bubble-ai);
    color: white;
    padding: 12px 16px;
    border-radius: 14px;
    max-width: 80%;
    margin-bottom: 12px;
}

.user-bubble {
    background: var(--bubble-user);
    color: var(--text);
    padding: 12px 16px;
    border-radius: 14px;
    margin-left: auto;
    max-width: 80%;
    margin-bottom: 12px;
}

/* ===================================
   GLASS CARD SUPPORT
=================================== */
.glass-card {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

/* ===================================
   FLOATING MASCOT (animated)
=================================== */
.mascot {
    position: fixed;
    bottom: 85px;
    right: 16px;
    width: 52px;
    border-radius: 20px;
    animation: floaty 3s infinite ease-in-out;
}

@keyframes floaty {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}
.nav-icon {
    width: 42px;        /* Perfect clarity */
    height: 42px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform .25s ease, filter .25s ease;
}

/* ACTIVE styling */
.nav-item.active .nav-icon {
    transform: scale(1.15);
}

/* Hover animation */
.nav-item:hover .nav-icon {
    transform: scale(1.10);
}

/* DARK MODE – invert only when needed */
body.dark .nav-icon {
    filter: brightness(1.15);
}
button, .chip, .tool-card, .nav-item, .floating-quick-btn {
    cursor: pointer;
}
/* ===============================
   💎 ICON STYLES (Lucide)
================================*/

/* General SVG sizing */
i[data-lucide] {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px; /* Thicker, bolder lines */
}

/* 1. Icon Only Button (Circle) */
.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-icon {
    background: transparent;
    color: var(--subtext);
}

.secondary-icon:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
    transform: scale(1.1);
}

/* 2. Send Button Fix */
.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Remove padding to center icon */
}

.send-btn i {
    margin-left: -2px; /* Visual optical alignment */
}

/* 3. Mic Button in Tools (Floating) */
.mic-btn {
    /* Existing style override */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Focus Buttons (Icon + Text) */
.icon-text-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}

.icon-only-btn {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode tweaks */
body.dark .secondary-icon:hover {
    background: rgba(255,255,255,0.1);
}
/* Snappy Button Presses */
button:active, .tool-card:active, .nav-item:active {
    transform: scale(0.96) !important;
    transition: transform 0.05s ease;
}

/* Notion-style Clean Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--subtext); opacity: 0.3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Glass Borders for Dark Mode Depth */
.card, .tool-card, .ai-bubble {
    border: 1px solid rgba(255,255,255, 0.08);
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--primary);
}

.profile-menu {
    position: absolute;
    top: 60px;
    right: 20px;
    background: var(--card);
    border-radius: 12px;
    padding: 10px 0;
    width: 180px;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: fadeIn 0.2s ease-in-out;
}

.profile-menu.show {
    display: flex;
}

.profile-menu button {
    background: none;
    border: none;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.profile-menu button:hover {
    background: var(--input);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.profile-wrapper {
    position: relative;
    cursor: pointer;
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.profile-menu {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: var(--card);
    border-radius: 12px;
    padding: 10px;
    width: 170px;
    box-shadow: var(--shadow);
    z-index: 999;
}

.profile-wrapper:hover .profile-menu {
    display: block;
}

.profile-menu button {
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 14px;
}

.profile-menu button:hover {
    background: var(--primary);
    color: white;
    border-radius: 8px;
}
.profile-dropdown {
  display: none;
}

.profile-dropdown.open {
  display: block;
}

.profile-wrapper {
    position: relative;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
}

.profile-menu {
    position: absolute;
    top: 48px;
    right: 0;
    background: var(--card);
    border-radius: 12px;
    padding: 8px;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.profile-wrapper:hover .profile-menu {
    display: block;
}
/* ===============================
   TOP NAVBAR FIX
================================ */

/* ===============================
   PROFILE DROPDOWN FIX
================================ */

.profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--primary);
}

.profile-menu {
    position: absolute;
    top: 48px;
    right: 0;

    background: var(--card);
    border-radius: 12px;
    padding: 6px;
    min-width: 180px;

    display: none;
    flex-direction: column;
    gap: 4px;

    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.profile-wrapper:hover .profile-menu {
    display: flex;
}

.profile-menu button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
}

.profile-menu button:hover {
    background: var(--input);
}



.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 20px;
    background: var(--card);
    border-radius: 16px;
    margin: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-logo {
    width: 40px;
    height: 40px;
}

.top-right,
#navbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--input);
    color: var(--text);
    transition: 0.2s;
}

.icon-btn-small:hover {
    background: var(--primary);
    color: white;
}
/* ================================
   CHATGPT-STYLE CODE BLOCK
================================ */

.code-block-wrapper {
  background: #0f172a; /* dark slate */
  border-radius: 12px;
  margin: 14px 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* Top bar */
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #020617;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.code-lang {
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd; /* blue */
  text-transform: lowercase;
}

.copy-btn {
  background: transparent;
  border: none;
  color: #cbd5f5;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.copy-btn:hover {
  color: #ffffff;
}

/* Code body */
.code-block-wrapper pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 14px;
}

/* Scrollbar (optional sexy touch) */
.code-block-wrapper pre::-webkit-scrollbar {
  height: 6px;
}
.code-block-wrapper pre::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 10px;
}
/* 1. Ensure the wrapper acts as the anchor */
.profile-wrapper {
    position: relative;
    display: inline-block;
}

/* 2. Style the menu */
.profile-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Puts it directly below the avatar */
    right: 0; 
    
    /* === THE FIX === */
    /* This creates an invisible filler area at the top of the menu */
    /* so your mouse doesn't fall into the "gap" */
    padding-top: 15px; 
    
    z-index: 1000;
}

/* 3. Show menu when hovering the WRAPPER (not just the image) */
.profile-wrapper:hover .profile-menu {
    display: block;
}

/* Navbar Icon Button */
.icon-btn-small {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px; /* Spacing between icons */
}

.icon-btn-small:hover {
    background-color: #f1f5f9;
    color: #6366f1;
}

/* Tooltip (The white box) */
.tooltip-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-tooltip {
    visibility: hidden;
    opacity: 0;
    background-color: white;
    color: #333;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: opacity 0.2s;
}

.tooltip-wrapper:hover .custom-tooltip {
    visibility: visible;
    opacity: 1;
}

/* 1. The Wrapper: Aligns button and navbar side-by-side */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between History icon and Profile */
}

/* 2. The Button: Resetting it to look like a Nav Icon */
.floating-history-btn {
    /* IMPORTANT: Reset position so it sits in the navbar */
    position: relative; 
    bottom: auto;
    right: auto;
    z-index: auto;
    margin: 0;
    
    /* Icon Styling */
    background: transparent;
    color: #64748b; /* Slate Gray */
    border: none;
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    box-shadow: none; /* Remove the old floating shadow */
    
    /* Flex center */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Hover Effect */
.floating-history-btn:hover {
    background-color: #f1f5f9;
    color: #6366f1;
}

/* 3. The "Tool History" Tooltip (CSS Only) */
.floating-history-btn::after {
    content: "Tool History";
    visibility: hidden;
    opacity: 0;
    
    /* Tooltip Box Style */
    background-color: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Position below button */
    position: absolute;
    top: 115%; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    transition: opacity 0.2s;
    pointer-events: none;
}

.floating-history-btn:hover::after {
    visibility: visible;
    opacity: 1;
}

/* Dashboard Button Styling */
.nav-dash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #f3f4f6; /* Light Gray (Normal) */
    color: #374151; /* Dark Gray Icon */
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 12px; /* Space between dash and profile */
}

/* Hover & Active State */
.nav-dash-btn:hover, 
.nav-dash-btn.active {
    background-color: #6c63ff; /* Brand Purple */
    color: white; /* White Icon */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* Dark Mode Support (Optional) */
[data-theme="dark"] .nav-dash-btn {
    background-color: #2d2d2d;
    color: #e0e0e0;
}
[data-theme="dark"] .nav-dash-btn:hover {
    background-color: #6c63ff;
    color: white;
}

/* =========================================
   🌙 DARK MODE OVERRIDES (Add to bottom of global.css)
   ========================================= */

/* --- 1. MODAL FIXES (History & Tools) --- */
[data-theme="dark"] .history-modal .history-content,
[data-theme="dark"] .modal-content, 
[data-theme="dark"] .glass-panel {
    background: rgba(30, 30, 30, 0.85) !important; /* Dark Glass */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Fix text inside history items */
[data-theme="dark"] .history-item {
    background: rgba(255, 255, 255, 0.05); /* Slight light tint */
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .history-date {
    color: #a0a0a0;
}

[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] p {
    color: #ffffff;
}

/* --- 2. INPUT & PASSWORD EYE FIX --- */
[data-theme="dark"] input, 
[data-theme="dark"] textarea, 
[data-theme="dark"] select {
    background-color: #2d2d2d;
    color: #ffffff;
    border-color: #444;
}

/* Placeholder text color */
[data-theme="dark"] ::placeholder {
    color: #888;
}

/* 👁️ THE EYE ICON FIX */
[data-theme="dark"] .lucide-eye, 
[data-theme="dark"] .lucide-eye-off {
    stroke: #ffffff !important; /* Forces icon lines to be white */
    opacity: 0.7;
}

/* --- 3. DASHBOARD CARDS FIX --- */
[data-theme="dark"] .stat-card, 
[data-theme="dark"] .dashboard-card {
    background: #1e1e1e; /* Dark card background */
    color: #fff;
    border: 1px solid #333;
}

[data-theme="dark"] .stat-label, 
[data-theme="dark"] .chart-label {
    color: #aaa; /* Muted text for labels */
}

[data-theme="dark"] .stat-value {
    color: #fff; /* Bright white for numbers */
}

/* --- 4. ABOUT PAGE (MEET CREATOR) FIX --- */
/* Ensure the main container in about.html uses variables */
[data-theme="dark"] body {
    background-color: #121212; /* Fallback if gradient fails */
    color: white;
}

[data-theme="dark"] .about-card, 
[data-theme="dark"] .profile-card {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .about-text {
    color: #ddd;
}

/* --- 5. BUTTONS IN DARK MODE --- */
[data-theme="dark"] .secondary-btn {
    background: rgba(255,255,255,0.1);
    color: white;
}
[data-theme="dark"] .secondary-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* =========================================
   🌙 HISTORY LIST FIXES (Chat & Tools)
   ========================================= */

/* 1. Default State (Visible Text) */
[data-theme="dark"] .history-item,
[data-theme="dark"] .tool-history-item {
    background-color: rgba(255, 255, 255, 0.05); /* Slight box background */
    color: #e0e0e0 !important; /* Force Light Text */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

/* 2. Hover State (Highlight) */
[data-theme="dark"] .history-item:hover,
[data-theme="dark"] .tool-history-item:hover {
    background-color: rgba(255, 255, 255, 0.15) !important; /* Lighter on hover */
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 3. Fix the "Text Only Appearing on Hover" issue */
/* This targets the text specifically inside the history items */
[data-theme="dark"] .history-item span,
[data-theme="dark"] .history-item div,
[data-theme="dark"] .history-item p {
    color: #e0e0e0 !important;
}

/* 4. Fix Chat Bubble Colors inside History (If they exist) */
[data-theme="dark"] .history-item .user-bubble-preview {
    background: #444;
    color: white;
}
[data-theme="dark"] .history-item .ai-bubble-preview {
    background: #2d2d2d;
    color: #ccc;
}
/* =========================================
   🏷️ TOOL HISTORY BADGE FIX (Dark Mode)
   ========================================= */
   /* =========================================
   🔧 TOOLS HISTORY SPECIFIC FIX
   ========================================= */

/* 1. The Badge (Planner, Dev, etc.) */
[data-theme="dark"] .history-tool-badge {
    background: rgba(255, 255, 255, 0.15) !important; /* Glassy background */
    color: #ffffff !important;       /* Bright White Text */
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0,0,0,0.8); /* Shadow makes it pop */
    
    /* Ensure it looks like a pill/tag */
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    text-transform: capitalize;
}

/* 2. The Text (The user's query) */
[data-theme="dark"] .history-query {
    color: #e0e0e0 !important; /* Light Grey Text */
    font-weight: 400;
}

/* 3. The Row Item Container */
[data-theme="dark"] .history-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

[data-theme="dark"] .history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 4. Date Headers (Today, Yesterday) */
[data-theme="dark"] .history-date-header {
    color: #aaa !important;
    font-size: 13px;
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   👤 PROFILE DROPDOWN POLISH
   ========================================= */

/* 1. The Dropdown Container (Glassy & Floating) */
.profile-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transform-origin: top right;
    animation: scaleIn 0.2s ease;
    min-width: 200px;
}

/* 2. The Menu Items (Buttons) */
.profile-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px; /* Space between icon and text */
    padding: 12px 16px;
    margin-bottom: 4px;
    border: none;
    background: transparent;
    color: #4b5563; /* Dark Grey */
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

/* 3. ✨ THE HOVER EFFECT */
.profile-menu button:hover {
    background: rgba(108, 92, 231, 0.1); /* Soft Purple Tint */
    color: #6c5ce7; /* Primary Purple Text */
    transform: translateX(5px); /* Slide slightly to the right */
    box-shadow: -2px 0 0 #6c5ce7; /* Left border accent */
}

/* 4. Active/Pressed State */
.profile-menu button:active {
    transform: scale(0.98) translateX(5px);
}

/* 5. 🌙 DARK MODE OVERRIDES */
[data-theme="dark"] .profile-menu {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

[data-theme="dark"] .profile-menu button {
    color: #e0e0e0;
}

[data-theme="dark"] .profile-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: -2px 0 0 #fff; /* White accent in dark mode */
}

/* Animation Keyframes */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
/* =========================================
   📱 MOBILE SAFETY NET (Max-Width: 600px)
   ========================================= */
@media (max-width: 600px) {

    /* 1. Make Stats Grid 1 Column on tiny screens */
    /* If 2 columns feel too squashed, this makes them stack nicely */
    .stats-row {
        grid-template-columns: 1fr 1fr; /* Keep 2 if cards are small */
    }
    
    /* 2. Stack the Charts vertically */
    .charts-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    /* 3. Adjust Padding so content touches edges less */
    .about-container, 
    .settings-container,
    .page-content {
        padding: 15px;
        padding-bottom: 100px; /* Space for bottom nav */
    }

    /* 4. Make Modals Full Width on Mobile */
    .modal-content, 
    .history-modal .history-content {
        width: 95% !important;
        margin: 10% auto;
        max-height: 80vh; /* Prevent it being too tall */
        overflow-y: auto; /* Scrollable inside */
    }

    /* 5. Fix Tool Output Code Blocks */
    pre {
        white-space: pre-wrap;       /* Wrap long code lines */
        word-wrap: break-word;
        font-size: 12px;             /* Smaller code font */
    }

    /* 6. Profile Page adjustments */
    .glass-panel, .glass-card {
        padding: 20px; /* Less padding on mobile */
    }
}

/* 🤏 EXTRA TINY SCREENS (iPhone SE / Fold) */
@media (max-width: 380px) {
    .stats-row {
        grid-template-columns: 1fr !important; /* Force 1 column stack */
    }
    .stat-value {
        font-size: 1.5rem; /* Smaller numbers */
    }
}
/* =========================================
   📱 MOBILE "CHUNKY" MODE (Better Touch Experience)
   ========================================= */
@media (max-width: 600px) {

    /* 1. Make the "Quick Action" buttons TALLER & BOLDER */
    /* This targets the Chat, Focus, Chill, Tools buttons */
    .dashboard-card, .stat-card {
        min-height: 110px !important;  /* Taller buttons */
        padding: 20px !important;      /* More breathing room */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;                     /* Space between icon and text */
    }

    /* 2. Make the Text BIGGER */
    .stat-label, h3, .card-title {
        font-size: 1rem !important;    /* Readable text (was tiny) */
        font-weight: 700 !important;
    }

    /* 3. Make the Icons BIGGER */
    .dashboard-card i, .stat-card i, [data-lucide] {
        transform: scale(1.5);         /* 50% larger icons */
        margin-bottom: 5px;
    }

    /* 4. Fix the Home Grid to be "Chunky 2-Column" */
    /* This fills the width of the phone perfectly */
    .quick-actions-grid, .stats-row {
        display: grid;
        grid-template-columns: 1fr 1fr !important; /* Keep 2 columns */
        gap: 15px !important;          /* Bigger gap looks cleaner */
        padding: 0 5px;                /* Slight edge spacing */
    }

    /* 5. Vibe Check Banner (Top Banner) */
    .vibe-check-banner {
        padding: 20px !important;
        margin-bottom: 25px !important;
    }
    
    /* 6. Fix "Meet the Creator" Button */
    .footer-btn {
        padding: 15px !important;
        font-size: 0.9rem !important;
    }
}