/* Highlighted search match style */
mark {
    background: rgb(153, 195, 255);
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --primary-color: #4a90e2;
    /* Keeping for text/accents */
    --primary-gradient: linear-gradient(135deg, #4a90e2 0%, #a29bfe 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5191ff 0%, #8e44ad 100%);
    --text-color: #333;
    --text-secondary: #666;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    /* Lifted */
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
    /* Hover/Deep */
    --transition-speed: 0.3s;
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    --glass-bg: rgba(23, 23, 23, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --primary-color: #6ba3ff;
    --primary-gradient: linear-gradient(135deg, #6ba3ff 0%, #a29bfe 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5191ff 0%, #8e44ad 100%);
    --text-color: #ececec;
    --text-secondary: #b4b4b4;
    --danger-color: #ff6b6b;
    --success-color: #51cf66;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    font-size: clamp(14px, 1vw + 0.8rem, 16px);
    transition: background var(--transition-speed), color var(--transition-speed);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
    width: 100%;
    flex: 1;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
}

/* Header: Floating Premium */
header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-bottom: 30px;
    gap: 20px;

    /* Sticky & Floating Logic */
    position: sticky;
    top: 20px;
    z-index: 1000;
    margin-top: 10px;

    /* "Island" Look */
    border-radius: 20px;
    /* Rounded corners */
    background: rgba(255, 255, 255, 0.4);
    /* Subtle initial glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode header {
    background: rgba(30, 30, 30, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Docked State (via JS) */
header.is-pinned {
    top: 0;
    margin-top: 0;
    border-radius: 0 0 20px 20px;
    /* Flatten top, round bottom */
    border: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 35px;
    /* Sleeker height */

    background: var(--glass-bg);
    /* Stronger glass */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--glass-shadow);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
}

.brand-logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-logo-img.small {
    height: 32px;
}

.brand-logo-img.micro {
    height: 24px;
}

.logo-area h1 {
    font-size: clamp(1.2rem, 2vw + 1rem, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-color), #a29bfe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-icon-new {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.auth-icon-new .brand-logo-img {
    height: 64px;
    filter: drop-shadow(0 4px 12px rgba(74, 144, 226, 0.3));
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 10px;
    color: var(--text-secondary);
}

.search-box input {
    padding: 10px 10px 10px 35px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    outline: none;
    transition: all var(--transition-speed);
    width: 250px;
    /* Default desktop width */
}

body.dark-mode .search-box input {
    background: rgba(30, 30, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .search-box input:focus {
    background: rgba(40, 40, 40, 0.6);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.search-box input:focus {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15);
    /* Keep specific focus ring, it's functional */
}

/* Shared View Container */
.shared-view-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    animation: fadeIn 0.3s ease-out;
}

.shared-navbar {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    margin-bottom: 40px;
}

.shared-navbar .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
}

.shared-navbar .brand-name {
    font-size: 1.5rem;
    font-weight: 850;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-color), #a29bfe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shared-card-wrapper {
    width: 100%;
    max-width: 600px;
    padding: 30px;
    margin-top: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    /* Ensure it fits with navbar (approx 80px) + margins */
    max-height: calc(100vh - 120px);
}

body.dark-mode .shared-card-wrapper {
    background: rgba(30, 30, 30, 0.95);
}

.shared-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 20px;
    margin-bottom: 24px;
    text-align: center;
    flex-shrink: 0;
    /* Header shouldn't shrink */
}

.logo-area.small span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Shared Content Area */
#sharedContentArea {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 30px;
}

.shared-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
    color: var(--text-color);
}

.shared-body {
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.03);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Responsive Adjusments for Shared View */
@media (max-width: 768px) {
    .shared-navbar {
        height: 60px;
        padding: 0 20px;
        margin-bottom: 20px;
    }

    .shared-navbar .brand-name {
        font-size: 1.3rem;
    }

    .shared-card-wrapper {
        width: 95%;
        max-width: 100%;
        margin-top: 10px;
        padding: 20px;
        border-radius: 16px;
    }

    .shared-title {
        font-size: 1.5rem;
    }

    .shared-body {
        padding: 16px;
        font-size: 1rem;
    }
}



body.dark-mode .shared-body {
    background: rgba(0, 0, 0, 0.2);
}

.shared-meta {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 16px;
    opacity: 0.7;
}

.shared-footer {
    flex-shrink: 0;
    margin-top: 10px;
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    min-width: 80px;
    font-size: 0.95rem;
    font-weight: 500;
}

.dropdown-selected {
    padding: 12px 40px 12px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.6);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    user-select: none;

    /* Text Overflow Fix: Responsive Width */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: clamp(100px, 15vw, 160px);
    vertical-align: middle;
    text-align: left;
}

.custom-dropdown button.dropdown-selected {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}

.dropdown-selected::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a90e2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.custom-dropdown.open .dropdown-selected::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-selected:hover,
.custom-dropdown.open .dropdown-selected {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.15);
}

body.dark-mode .dropdown-selected {
    background-color: rgba(50, 50, 50, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .dropdown-selected:hover,
body.dark-mode .custom-dropdown.open .dropdown-selected {
    background-color: rgba(70, 70, 70, 0.95);
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(107, 163, 255, 0.3);
}

/* Active Filter State */
.dropdown-selected.active-filter {
    background-color: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

body.dark-mode .dropdown-selected.active-filter {
    background-color: rgba(107, 163, 255, 0.15);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 100%;
    width: max-content;
    /* Allow options to expand beyond button width */
    max-width: 300px;
    /* Safety cap */
    background: rgba(255, 255, 255, 1);
    /* Solid backround to prevent bleed */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    /* Stronger shadow */
    padding: 8px;
    display: none;
    z-index: 2000;
    /* High z-index */
    animation: slideDown 0.2s ease-out forwards;
}

body.dark-mode .dropdown-options {
    background: #1e1e1e;
    /* Solid color */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Profile Dropdown Styles (Migrated from JS) */
.profile-ui-container {
    position: relative;
    margin-left: 15px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-dropdown-menu.show {
    display: block !important;
    /* Force display */
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 220px;
    /* Increased slightly */
    z-index: 2000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideDown 0.2s ease-out forwards;
    overflow: hidden;
    /* Ensure content doesn't bleed */
}

body.dark-mode .profile-dropdown-menu {
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);

    /* Allow wrapping and break long email addresses */
    white-space: normal;
    overflow: visible;
    word-break: break-all;
    max-width: 100%;
    box-sizing: border-box;
}

body.dark-mode .profile-email {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-logout-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-logout-btn:hover {
    background: rgba(231, 76, 60, 0.1);
}

.custom-dropdown.open .dropdown-options {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-option {
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-color);
    display: flex;
    align-items: center;

    /* Truncate long options */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-option:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

body.dark-mode .dropdown-option:hover {
    background: rgba(107, 163, 255, 0.15);
    color: var(--primary-color);
}

.dropdown-option.selected {
    background: var(--primary-gradient);
    color: white;
}

.dropdown-option .icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

.dropdown-option .text {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    /* Allow it to take up available space and truncate */
}

/* Modal specific dropdown styles */
#modalCategoryDropdown .dropdown-selected {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 100%;
}

body.dark-mode #modalCategoryDropdown .dropdown-selected {
    background-color: #2a2a2a;
    border-color: #444;
    color: var(--text-color);
}

#modalCategoryDropdown .dropdown-options {
    border: 1px solid #ddd;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.dark-mode #modalCategoryDropdown .dropdown-options {
    background-color: #2a2a2a;
    border-color: #444;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background var(--transition-speed), color var(--transition-speed);
    color: var(--text-color);
}

.icon-btn:hover {
    background: rgba(74, 144, 226, 0.08);
    color: var(--primary-color);
}

body.dark-mode .icon-btn:hover {
    background: rgba(107, 163, 255, 0.15);
    color: var(--primary-color);
}

/* Copy button feedback state - shows checkmark briefly */
.icon-btn.copied-state {
    color: var(--success-color);
}

/* Paste Area */
.paste-area {
    padding: 24px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.paste-area textarea {
    flex-grow: 1;
    border: 2px solid transparent;
    /* Prepare for focus state */
    border-radius: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.85);
    resize: vertical;
    min-height: 85px;
    /* Increased height */
    font-family: inherit;
    font-size: 1.05rem;
    /* slightly clearer text */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.paste-area textarea:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15);
}


body.dark-mode .paste-area textarea {
    background: rgba(40, 40, 40, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

body.dark-mode .paste-area textarea:focus {
    background: rgba(40, 40, 40, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(107, 163, 255, 0.15);
}

.paste-area button {
    padding: 12px 28px;
    background: var(--primary-gradient);
    color: white;
    border: none !important;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paste-area button:hover {
    transform: translateY(-2px);
    background: var(--primary-gradient-hover);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.3);
}

/* Grid */
.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    min-height: 200px;
    /* Reserve space to prevent footer jump (CLS) */
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
}

/* Prompt Card */
.prompt-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, opacity 0.3s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s ease-out forwards;
    animation-delay: calc(var(--card-index) * 0.05s);
    contain: layout style;
    will-change: transform, opacity;
}

body.dark-mode .prompt-card {
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

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

.prompt-card:hover {
    transform: translateY(-4px);
    /* Subtle lift */
    box-shadow: var(--shadow-lg);
    /* Softer, deeper shadow */
    background: rgba(255, 255, 255, 1);
}

body.dark-mode .prompt-card:hover {
    background: rgba(40, 40, 40, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Pinned Guide Card - Premium Glassmorphism */
.pinned-guide-card {
    background: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: none !important;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1) !important;
    color: var(--text-color);
}

body.dark-mode .pinned-guide-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.pinned-guide-card:hover {
    background: rgba(255, 255, 255, 0.45) !important;
    transform: translateY(-5px);
}

body.dark-mode .pinned-guide-card:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.pinned-guide-card .card-title {
    color: var(--primary-color);
}

.pinned-guide-card .category-badge {
    background: rgba(74, 144, 226, 0.15);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 8px;
}

.pinned-guide-card .card-body {
    background: transparent !important;
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
    margin: 15px 0;
    font-family: inherit !important;
    font-size: 1rem !important;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    /* More space between header and body */
}

/* Recency Badge */
.badge-new {
    display: inline-block;
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--success-color);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

body.dark-mode .badge-new {
    background-color: rgba(46, 204, 113, 0.2);
}

.card-title {
    font-weight: 800;
    /* Bolder */
    font-size: 1.15rem;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.card-actions {
    display: flex;
    gap: 5px;
}

.card-body {
    background: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
    /* Slightly clearer code text */
    color: #444;
    opacity: 0.9;
    /* Slight de-emphasis for hierarchy */
    margin-bottom: 20px;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

body.dark-mode .card-body {
    background: rgba(0, 0, 0, 0.3);
    color: #ccc;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.85rem;
    gap: 12px;
}

.tags-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.age-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.04);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

body.dark-mode .age-text {
    background: rgba(255, 255, 255, 0.06);
}

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

.tag {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 12px;
}

.tag-more {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

body.dark-mode .tag {
    background: rgba(107, 163, 255, 0.15);
    color: var(--primary-color);
}

body.dark-mode .tag-more {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Subtle usage text - confidence signal without gamification */
.usage-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    /* Prevents overflow/pushing */
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.share-btn-footer {
    opacity: 0.6;
    padding: 4px !important;
    color: var(--text-secondary);
}

.share-btn-footer:hover {
    opacity: 1;
    color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.category-badge {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.fav-btn.active svg {
    fill: #f1c40f;
    color: #f1c40f;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: var(--primary-gradient);
    border: none !important;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 35px rgba(74, 144, 226, 0.45);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    will-change: transform;
    /* Performance: GPU Promotion */
}

body.dark-mode .fab {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body.dark-mode .fab:hover {
    background: var(--primary-gradient-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
}

.fab.up {
    transform: translateY(-80px);
    /* move up by footer height */
    animation: blowUp 0.5s ease-out forwards;
}

.fab.rectangular {
    width: 140px;
    border-radius: 12px;
    justify-content: flex-start;
    padding-left: 20px;
}

.fab.rectangular::after {
    content: 'Add New';
    margin-left: 10px;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes blowUp {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--primary-gradient-hover);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.5);
}

body.dark-mode .fab:hover {
    box-shadow: 0 6px 30px rgba(107, 163, 255, 0.7);
}

.fab.hide-fab {
    opacity: 0;
    pointer-events: none;
    transform: translateY(120px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    display: none;
    /* Helpers handle this via class toggle usually, but let's keep it safe */
}

/* When ACTIVE (not hidden) */
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Share Modal Specifics */
.share-modal {
    width: 600px;
    max-width: 95vw;
    padding: 24px;
    overflow: hidden;
    /* Contains scroll */
}

/* Close btn tweak */
.share-modal .close-btn {
    font-size: 1.5rem;
}

/* Carousel wrapper with potential scroll */
.share-carousel-wrapper {
    margin: 20px 0 30px 0;
    overflow-x: auto;
    padding-bottom: 10px;
    /* Hide scrollbar but keep functionality */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.share-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.share-carousel {
    display: flex;
    gap: 20px;
    padding: 0 5px;
    /* buffer */
}

.share-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 60px;
    cursor: pointer;
    background: none;
    border: none;
    transition: transform 0.2s;
}

.share-icon-btn:hover {
    transform: translateY(-3px);
}

.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
    background: #f0f0f0;
    /* Default fallback */
}

/* Brand Colors */
.whatsapp .icon-circle {
    background: #25D366;
}

.x-twitter .icon-circle {
    background: #000000;
}

.email .icon-circle {
    background: #888888;
    color: white;
}

.copy-generic .icon-circle {
    background: #f1f2f6;
    color: #333;
}

.linkedin .icon-circle {
    background: #0077b5;
}

body.dark-mode .copy-generic .icon-circle {
    background: #333;
    color: #ddd;
}

/* Notion-style / Youtube-style Copy Box */
.share-notion-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 6px 6px 6px 16px;
    /* p-left text, p-right button */
    gap: 10px;
}

body.dark-mode .share-notion-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

#shareInputLink {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-color);
    text-overflow: ellipsis;
    /* Readonly look */
}

#shareCopyBtnMain {
    padding: 8px 24px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}


.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transform: translateY(50px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--glass-shadow);
    will-change: transform;
    /* Performance: GPU Promotion */

    /* Scrollbar styling for a cleaner look */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
}

body.dark-mode .modal {
    background: rgba(25, 25, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-color);
}

.modal-overlay.visible .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label,
.label-style {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.primary-btn {
    padding: 12px 28px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: var(--primary-gradient-hover);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.35);
}

body.dark-mode .primary-btn {
    color: white;
}

body.dark-mode .primary-btn:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.secondary-btn:hover {
    background: rgba(74, 144, 226, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

body.dark-mode .secondary-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

body.dark-mode .secondary-btn:hover {
    background: rgba(107, 163, 255, 0.1);
    color: var(--primary-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
    /* Helper for non-animated hides if needed, though overlay uses opacity */
}

/* Override hidden for overlay to allow transition */
.modal-overlay.hidden {
    display: flex;
    opacity: 0;
    pointer-events: none;
}

/* Onboarding Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(74, 144, 226, 0.7);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(74, 144, 226, 0.4);
    }
}

.fab.pulse-animation {
    animation: pulse 2s infinite;
}

/* Highlight for Welcome Card */
.prompt-card[data-id="welcome-guide"] {
    border: 2px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    animation: fadeIn 0.8s ease-out forwards, pulse-border 3s infinite;
}

body.dark-mode .prompt-card[data-id="welcome-guide"] {
    background: rgba(30, 30, 30, 0.95);
}

@keyframes pulse-border {
    0% {
        border-color: var(--primary-color);
    }

    50% {
        border-color: rgba(74, 144, 226, 0.3);
    }

    100% {
        border-color: var(--primary-color);
    }
}

/* About Section */
.about-section {
    margin-top: 50px;
    padding: 30px;
    margin-bottom: 50px;
}

.about-section h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
}

.about-section p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px auto;
    color: var(--text-secondary);
    line-height: 1.8;
}

body.dark-mode .about-section p {
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-speed);
}

body.dark-mode .feature-item {
    background: rgba(255, 255, 255, 0.05);
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.8);
}

body.dark-mode .feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.feature-item h3 {
    margin-bottom: 10px;
    font-weight: 600;
}

/* Footer Styling */
.app-footer {
    position: relative;
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    padding: 24px 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 240, 0.9));
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px 24px 0 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    gap: 24px;
}

body.dark-mode .app-footer {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(10, 10, 10, 0.98));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    color: var(--text-secondary);
}

.footer-text {
    font-weight: 500;
}

.footer-text span {
    color: #e74c3c;
    animation: heartbeat 1.5s infinite;
    display: inline-block;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

.footer-right-content {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    padding-right: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-links a {
    color: var(--text-secondary);
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-links a:hover {
    transform: translateY(-3px);
    color: var(--primary-color);
}

.youtube-link:hover {
    color: #ff0000 !important;
}

.gmail-link:hover {
    color: #ea4335 !important;
}

.facebook-link:hover {
    color: #1877f2 !important;
}

@media (max-width: 768px) {
    .app-footer {
        flex-direction: column;
        gap: 20px;
        padding: 30px 20px;
    }

    .footer-right-content {
        padding-right: 0;
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   Responsive Overhaul (Phone, Tablet, Desktop)
   ========================================= */

/* Tablets (Portrait) - 768px */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }

    /* Header & Controls */
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .controls {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .search-box {
        width: 100%;
        order: -1;
        /* Ensure search is top */
    }

    .search-box input {
        width: 100%;
        height: 44px;
        font-size: 16px;
        /* Best for mobile inputs */
    }

    /* Sub-controls on one row */
    #customCategoryDropdown,
    #auth-profile-slot,
    #settingsDropdown {
        margin: 0;
    }

    .controls>div:not(.search-box) {
        flex: 1;
    }

    /* Target the bottom row items to share space */
    .controls {
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
    }

    .search-box {
        grid-column: 1 / -1;
    }

    .custom-dropdown {
        min-width: 0;
        /* Allow shrinking */
    }

    .dropdown-selected {
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Paste Area */
    .paste-area {
        flex-direction: column;
        padding: 20px;
    }

    .paste-area button {
        width: 100%;
    }

    /* Grid */
    .prompt-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }

    .prompt-card {
        padding: 18px;
    }

    /* Footer */
    .app-footer {
        flex-direction: column-reverse;
        text-align: center;
        padding: 30px 20px 100px 20px;
        /* Space for FAB */
    }

    .footer-links {
        justify-content: center;
        margin-top: 10px;
        gap: 20px;
    }
}

/* Small Tablets & Large Phones - 600px */
@media (max-width: 600px) {
    .controls {
        grid-template-columns: 1fr auto auto;
    }

    .search-box,
    .search-box input {
        width: 100%;
        grid-column: 1 / -1;
    }

    #auth-profile-slot,
    #settingsDropdown {
        width: auto;
    }

    .custom-dropdown {
        width: 100%;
    }

    /* Shared View Mobile Fixes */
    .shared-card-wrapper {
        padding: 25px;
    }

    .shared-header {
        margin-bottom: 15px;
    }

    /* Auth Card Mobile Fixes */
    .auth-card {
        padding: 30px 20px;
    }

    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Phones (Standard) - 480px */
@media (max-width: 480px) {

    /* 1 Column Grid */
    .prompt-grid {
        grid-template-columns: 1fr !important;
    }

    .prompt-card {
        padding: 16px;
    }

    /* Full-screen capable Modal */
    .modal {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
        margin: 10px auto;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions button {
        width: 100%;
    }

    /* Storage Select - Stack */
    .storage-selection {
        flex-direction: column;
    }

    /* Fabric Action Button - Mobile Adjust */
    .fab {
        bottom: 25px;
        right: 25px;
        width: 56px;
        height: 56px;
    }

    /* Logo Area */
    .logo-area h1 {
        font-size: 1.2rem;
    }
}

/* Ultra Small Phones - 360px */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }

    .logo-area svg {
        width: 20px;
        height: 20px;
    }
}

/* =========================================
   Premium Slider (Bookmarklet Onboarding)
   ========================================= */
.modal-bookmarklet {
    max-width: 550px;
    width: 90vw;
    padding: 30px;
}

.slider-container {
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    min-height: 400px;
    /* Slight bump for padding */
    display: flex;
    flex-direction: column;
}

.slider-viewport {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
    align-items: center;
    /* Center pages horizontally if needed, but flex basis is 100% */
}

.slider-page {
    min-width: 100%;
    flex-shrink: 0;
    padding: 20px;
    opacity: 0.4;
    transform: scale(0.92);
    transition: opacity 0.6s, transform 0.6s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.slider-page.active {
    opacity: 1;
    transform: scale(1);
}

.slider-page .illustration {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.slider-page h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.slider-page p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 440px;
}

.highlight-word {
    color: var(--primary-color);
    font-weight: 700;
}

.slider-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.slider-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

body.dark-mode .dot {
    background: rgba(255, 255, 255, 0.1);
}

.dot.active {
    width: 24px;
    background: var(--primary-gradient);
    border-radius: 4px;
}

.slider-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

body.dark-mode .slider-btn {
    background: rgba(255, 255, 255, 0.05);
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.slider-btn:disabled {
    opacity: 0;
    pointer-events: none;
}

.slider-btn.primary-btn {
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.25);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-btn.primary-btn:hover {
    transform: translateY(-3px);
    background: var(--primary-gradient-hover);
    box-shadow: 0 12px 25px rgba(74, 144, 226, 0.35);
}

/* Mobile Slider Adjustments */
@media (max-width: 600px) {
    .modal-bookmarklet {
        padding: 20px;
        width: 95vw;
    }

    .slider-container {
        min-height: 340px;
    }

    .slider-page .illustration {
        font-size: 3rem;
    }

    .slider-page h3 {
        font-size: 1.25rem;
    }

    .slider-page p {
        font-size: 0.95rem;
    }
}

.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    min-height: 46px;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
}

body.dark-mode .tag-input-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
    background: #fff;
}

body.dark-mode .tag-input-wrapper:focus-within {
    background: rgba(30, 30, 30, 0.9);
}

.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-chip {
    display: flex;
    align-items: center;
    background: rgba(74, 144, 226, 0.15);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    animation: fadeIn 0.2s ease-out;
}

body.dark-mode .tag-chip {
    background: rgba(74, 144, 226, 0.25);
    color: #8ab4f8;
}

.tag-chip-remove {
    margin-left: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tag-chip-remove:hover {
    opacity: 1;
}

#tagInput {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-color);
    flex: 1;
    min-width: 80px;
    padding: 4px 0;
}

/* Tag Suggestions */
.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    margin-top: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

body.dark-mode .tag-suggestions {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: background 0.15s ease;
}

.tag-suggestion-item:hover,
.tag-suggestion-item.selected {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

body.dark-mode .tag-suggestion-item:hover,
body.dark-mode .tag-suggestion-item.selected {
    background: rgba(74, 144, 226, 0.2);
}

/* =========================================
   AUTH UI
   ========================================= */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.auth-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .auth-card {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-header {
    margin-bottom: 30px;
}

.auth-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), #8e44ad);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    box-shadow: 0 10px 20px rgba(74, 144, 226, 0.3);
}

.auth-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-step.hidden {
    display: none;
}

.full-width {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.otp-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-input {
    width: 45px;
    height: 55px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.5);
}

.otp-input:focus {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
    outline: none;
}

body.dark-mode .otp-input {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

body.dark-mode .otp-input:focus {
    border-color: var(--primary-color);
}

.auth-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .auth-footer {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.8;
}

.link-btn:hover {
    opacity: 1;
    color: var(--primary-color);
}

.resend-link {
    margin-top: 15px;
    font-size: 0.85rem;
}

.resend-link a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Loader */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   TASK 1 & 3: Welcome Banner & Responsiveness
   ========================================= */

/* Welcome Banner Style */
#welcome-banner {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 32px 28px;
    /* Increased height/spaciousness */
    border-radius: var(--border-radius);
    /* Consistent 16px */
    /* Slightly rounder for premium feel */
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    /* Consistent lift */
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Smoother bezier */
}

#welcome-banner h2 {
    margin: 0;
    font-size: 1.8rem;
    /* Larger for hierarchy */
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

#welcome-banner div:first-child {
    flex: 1;
    min-width: 0;
    padding-right: 20px;
}

#welcome-banner p {
    margin: 8px 0 0;
    /* More breathing room */
    opacity: 0.95;
    font-size: 1.05rem;
    /* Readable premium size */
    font-weight: 500;
    line-height: 1.5;
}

/* Responsive Fixes (Mobile) */
@media (max-width: 768px) {

    /* Navbar Alignment */
    .logo-area h1 {
        font-size: 1.2rem;
    }

    .navbar-auth {
        margin-left: auto;
        /* Push to right */
    }

    /* Dropdown Overflow Fix */
    .dropdown-options {
        width: 200px;
        right: 0;
        left: auto;
    }

    /* Footer Layout */
    footer {
        text-align: center;
    }

    footer .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

/* Pinned Guide Card Style */
.pinned-guide-card {
    border-color: rgba(var(--primary-rgb), 0.4) !important;
    background: linear-gradient(to bottom right, var(--bg-card), rgba(var(--primary-rgb), 0.03));
}

/* Cleaned up redundant media queries - handled in Responsive Overhaul section */

/* Extra Small Screens (<= 400px) - Safety */
@media (max-width: 400px) {
    .prompt-grid {
        grid-template-columns: 1fr;
        /* Fallback to 1 col if TOO small */
    }
}

/* --- Mobile Dropdown Fixes (Task: Fix Overflow) --- */
@media (max-width: 600px) {

    /* Navbar Re-organization: Grid Layout */
    /* Removed header overrides to allow sticky behavior */

    /* Container */
    header .controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-rows: auto auto;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
        align-items: center;
    }

    /* 1. Search Bar: Default In-Flow */
    .search-box {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        position: relative;
        z-index: 2000;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Removed unused .mobile-floating styles */

    /* Dark Mode Search Bar */
    body.dark-mode .search-box {
        background: rgba(30, 30, 40, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .search-box input {
        width: 100%;
    }

    /* 2. Category Dropdown: Left column (Row 2) */
    #customCategoryDropdown {
        grid-column: 1 / 2;
        grid-row: 2;
        width: 100%;
    }

    #customCategoryDropdown .dropdown-selected {
        width: 100%;
        max-width: none;
    }

    /* 3. Settings Dropdown: Center column (Row 2) */
    #settingsDropdown {
        grid-column: 2 / 3;
        grid-row: 2;
        width: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 4. Auth Profile Slot: Right column (Row 2) */
    #auth-profile-slot {
        grid-column: 3 / 4;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        /* Align to right edge */
    }

    /* Dropdown Options Safety */
    .custom-dropdown .dropdown-options {
        min-width: unset;
        width: 100%;
        max-width: 90vw;
        left: 0;
        z-index: 2005;
        /* High z-index */
    }

    /* Profile/Settings Dropdown specific alignment */
    .profile-dropdown-menu,
    #settingsDropdown .dropdown-options {
        width: auto;
        min-width: 200px;
        right: 0;
        left: auto;
    }

    /* Email Truncation */
    .profile-email {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }
}

/* --- Premium Network Status UI --- */

/* Overlay with blur and smooth fade */
.network-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Visible State */
.network-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Card Design */
.network-card {
    background: rgba(255, 255, 255, 0.9);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    border-radius: 28px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    text-align: center;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 16px;
    /* Safe margin on mobile */
}

/* Animation Check: When overlay is visible, card animates in */
.network-overlay:not(.hidden) .network-card {
    transform: translateY(0) scale(1);
}

/* Responsive Dark Mode */
body.dark-mode .network-card {
    background: rgba(30, 30, 35, 0.95);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    color: #fff;
}

/* Icon */
.network-icon-container {
    width: 64px;
    height: 64px;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
}

/* Typography */
.network-card h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.network-msg {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
    font-size: 1rem;
}

/* Buttons */
.network-actions button {
    margin-bottom: 12px;
    height: 48px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.network-actions button:active {
    transform: scale(0.98);
}

.safe-action {
    background: var(--primary-gradient) !important;
    color: white;
    border: none !important;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.safe-action:hover {
    background: var(--primary-gradient-hover) !important;
    transform: translateY(-2px);
}

.retry-action {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.small-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-top: 8px;
    opacity: 0.8;
}

.small-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .network-card {
        padding: 32px 24px;
        width: calc(100% - 32px);
    }
}

/* Folder Stream System */
.folder-stream-container {
    margin: 20px 0;
    padding: 5px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 60;

    /* Edge Fade Effect */
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent 100%);
}

.folder-stream-container::-webkit-scrollbar {
    display: none;
}

.folder-stream {
    display: inline-flex;
    gap: 10px;
    padding: 10px 20px;
    align-items: center;
}

.folder-pill {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-pill:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.folder-pill.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.folder-pill.active:hover {
    background: var(--primary-gradient-hover);
    color: white;
    transform: translateY(-2px);
}

body.dark-mode .folder-pill {
    background: rgba(40, 40, 40, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .folder-pill:hover {
    background: rgba(60, 60, 60, 0.6);
    color: #fff;
}

body.dark-mode .folder-pill.active {
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .folder-pill.active:hover {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
}

.folder-add-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 5px;
}

.folder-add-pill:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: rotate(90deg);
}

.folder-rename-input {
    min-width: 100px;
    padding: 6px 12px !important;
    outline: none !important;
    border: 1px solid var(--primary-color) !important;
}

/* Inline Input */
.folder-rename-input {
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    outline: none;
    min-width: 60px;
    max-width: 120px;
    text-align: center;
}

/* Storage Selection */
.storage-selection {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.storage-option {
    flex: 1;
    cursor: pointer;
}

.storage-option input[type="radio"] {
    display: none;
}

.storage-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed);
}

.storage-box .icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.storage-box .text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.storage-option input[type="radio"]:checked+.storage-box {
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

.storage-option input[type="radio"]:checked+.storage-box .text {
    color: var(--primary-color);
}

body.dark-mode .storage-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .storage-option input[type="radio"]:checked+.storage-box {
    background: rgba(107, 163, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(107, 163, 255, 0.2);
}

/* Variable Fill Modal (The Template Space) */
.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.variable-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 12px;
    padding-bottom: 8px;
}

.variable-fields::-webkit-scrollbar {
    width: 4px;
}

.variable-fields::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 10px;
}

.variable-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variable-field label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    opacity: 0.7;
}

.variable-field input {
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    outline: none;
}

.variable-field input:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
}

.variable-field input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.08);
}

body.dark-mode .variable-field input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .variable-field input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
}

.copy-final-btn {
    margin-top: 10px;
    height: 52px;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

/* ============================================
   Template Choice Modal (Bottom Toast-like)
   ============================================ */
.template-choice-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    justify-content: center;
    padding: 20px;
    animation: slideUpFadeIn 0.3s ease-out;
}

.template-choice-overlay.hidden {
    display: none;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    text-align: center;
}

.template-choice-card p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.template-choice-card strong {
    color: var(--primary-color);
}

.template-choice-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.small-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    border-radius: 10px;
}

/* ============================================
   Variable Selection Modal
   ============================================ */
/* ============================================
   Variable Selection Modal
   ============================================ */
.var-select-modal {
    max-width: 650px;
}

.var-select-preview {
    background: rgba(15, 15, 20, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 2.2;
    font-size: 1.1rem;
    color: var(--text-color);
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

body.dark-mode .var-select-preview {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.4);
}

.var-select-preview .word-token {
    display: inline-block;
    padding: 4px 10px;
    margin: 4px 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: 1px solid transparent;
    position: relative;
    font-weight: 500;
}

.var-select-preview .word-token:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateY(-1px);
}

/* Vibrant Blue Selection (Glow Effect) */
.var-select-preview .word-token.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

body.dark-mode .var-select-preview .word-token.selected {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    /* Brighter blue in dark mode */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5), inset 0 0 10px rgba(59, 130, 246, 0.1);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Faint Yellow Suggestion */
.var-select-preview .word-token.suggested {
    border: 1px dashed rgba(255, 193, 7, 0.5);
    background: rgba(255, 193, 7, 0.05);
}

/* Ensure selected state overrides suggested state aesthetics */
.var-select-preview .word-token.suggested.selected {
    border-style: solid;
    /* other properties inherited from .selected */
}

.var-select-preview .word-token.suggested:hover {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.8);
}

.var-select-preview .punctuation {
    display: inline;
    margin: 0;
    cursor: default;
}

.var-select-preview .newline {
    display: block;
    height: 8px;
}

/* --- Show More / Row Limitation --- */
.show-more-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 50px;
    width: 100%;
}

.show-more-container.hidden {
    display: none;
}

.load-more-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 25px;
    padding: 14px 32px;
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.load-more-btn:hover {
    transform: scale(1.05) translateY(-2px);
    background: var(--primary-gradient-hover);
    box-shadow: 0 12px 30px rgba(74, 144, 226, 0.4);
}

body.dark-mode .load-more-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
}

body.dark-mode .load-more-btn:hover {
    background: var(--primary-gradient-hover);
    transform: scale(1.05) translateY(-2px);
}

.load-more-btn svg {
    transition: transform 0.3s ease;
}


/* Theme Switcher (Desktop) */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.04);
    padding: 3px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

body.dark-mode .theme-switch-wrapper {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-switch-btn {
    background: none;
    border: none;
    padding: 6px;
    width: 30px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.theme-switch-btn:hover {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.08);
}

body.dark-mode .theme-switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.theme-switch-btn.active {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

body.dark-mode .theme-switch-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: none;
}

.theme-switch-btn svg {
    z-index: 1;
    transition: transform 0.3s ease;
}

.theme-switch-btn:hover svg {
    transform: scale(1.1);
}

/* Hide on Mobile */
@media (max-width: 768px) {
    .theme-switch-wrapper.desktop-only {
        display: none !important;
    }
}

/* Confirmation Modal */
.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.modal-body-pushed {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.checkbox-container:hover {
    opacity: 1;
}

.checkbox-container input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.danger-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5253) !important;
    box-shadow: 0 4px 15px rgba(238, 82, 83, 0.3) !important;
}

.danger-btn:hover {
    background: linear-gradient(135deg, #ee5253, #d63031) !important;
    transform: translateY(-2px);
}