/* === components.css - Modular segment of 8eacher design system === */

/* Standard Tactile Buttons */
.btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    box-shadow: inset 0 -2px 0 var(--border-color);
    color: var(--text-primary);
    padding: 12px var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    user-select: none;
}
.btn:hover { 
    background: var(--bg-secondary); 
    transform: scale(1.02); /* Premium scale expansion */
}
.btn:active {
    transform: scale(0.98) translateY(2px); /* Satisfying tactile depress */
    box-shadow: none;
}
.btn.primary { 
    background: var(--accent); 
    border-color: var(--accent); 
    box-shadow: inset 0 -2px 0 var(--btn-primary-shadow);
    color: var(--btn-primary-text) !important; 
}
.btn.primary:hover { 
    background: var(--accent-hover); 
    color: var(--btn-primary-text) !important; 
    transform: scale(1.02); /* Primary button hover pop */
}
.btn.primary:active {
    transform: scale(0.98) translateY(2px);
}
.btn.secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: inset 0 -2px 0 var(--border-color);
    color: var(--text-primary) !important;
}
.btn.secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary) !important;
    transform: scale(1.02);
}
.btn.secondary:active {
    transform: scale(0.98) translateY(2px);
    box-shadow: none;
}
.btn-icon { 
    background: transparent; 
    border: none; 
    color: var(--text-secondary); 
    cursor: pointer; 
    transition: var(--transition-smooth); 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}
.btn-icon:hover { 
    color: var(--text-primary); 
    background-color: var(--bg-secondary);
}
.full-width { width: 100%; }

.btn-google {
    background: #ffffff;
    color: #000000;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 -2px 0 var(--border-color);
}
.btn-google:hover {
    background: #fafafa;
}



/* Tactile Forms */
.form-container { 
    width: 100%; 
    padding: var(--space-lg); 
}
.centered { 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}
.auth-box { 
    max-width: 450px; 
    width: 100%; 
    padding: var(--space-xl) var(--space-lg); 
    margin: var(--space-lg) auto 0 auto; 
}
.auth-box h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: var(--space-sm); }

.form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); }
.form-header h2 { font-size: 1.6rem; font-weight: 700;}

.input-group { margin-bottom: var(--space-lg); text-align: left; width: 100%; }
.input-group label { 
    display: block; 
    margin-bottom: var(--space-sm); 
    font-weight: 700; 
    color: var(--text-secondary); 
    font-size: var(--font-xs); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}
.input-group textarea,
.input-group select,
#practice-type-select {
    width: 100%; 
    padding: 12px var(--space-md); 
    border-radius: var(--radius-md);
    background: var(--bg-card); 
    border: 2px solid var(--border-color);
    color: var(--text-primary); 
    font-family: inherit; 
    font-size: 0.95rem; 
    font-weight: 400;
    transition: border-color 0.2s; 
    line-height: 1.5;
}
.input-group textarea:focus,
.input-group select:focus,
#practice-type-select:focus,
#manage-type-select:focus,
#incorrect-sentence-input:focus,
#create-new-sentence:focus,
#edit-new-sentence:focus,
#settings-new-type-input:focus { 
    outline: none; 
    border-color: var(--text-primary); 
    box-shadow: 0 0 0 3px var(--border-color); /* Premium focus ring overlay */
}
.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.file-input-hidden {
    display: none !important;
}
.file-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.file-input-button {
    background: var(--bg-secondary); 
    border: 2px solid var(--border-color); 
    box-shadow: inset 0 -2px 0 var(--border-color);
    color: var(--text-primary); 
    padding: 8px 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600;
    transition: var(--transition-fast); 
    display: inline-block;
    user-select: none;
}
.file-input-button:hover { 
    background: var(--bg-tertiary); 
    transform: scale(1.02);
}
.file-input-button:active {
    transform: scale(0.98) translateY(2px);
    box-shadow: none;
}
.file-input-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



/* User Profile Dropdown Styles */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1100;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: top right;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
}
.user-dropdown.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}
.user-dropdown-header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.user-email-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.user-email {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-all;
}
.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}
.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background 0.1s ease, color 0.1s ease;
}
.user-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--accent);
}
body.dark-theme .user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.2s ease;
}
.modal-backdrop.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.modal-body {
    padding: 20px;
}
.modal-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

/* Settings & Profile Specific Modal Elements */
.profile-info-section {
    display: flex;
    align-items: center;
    gap: 16px;
}
.profile-avatar-large {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--btn-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
}
.profile-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.profile-email {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}
.profile-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 10px;
    align-self: flex-start;
}
body.dark-theme .profile-stat-badge {
    background: rgba(255, 255, 255, 0.03);
}
.profile-stat-badge .stat-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}
.profile-stat-badge .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.settings-section h4 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.settings-subtext {
    margin: 0 0 10px 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}



/* Custom Alerts and Confirms Modals */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.custom-modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    padding: 24px;
    box-sizing: border-box;
}



/* Premium Floating Explanation Tooltip */
.node-explanation-tooltip {
    position: absolute;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    max-width: 220px;
    text-align: center;
    z-index: 100000 !important;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    animation: tooltip-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.node-explanation-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(20, 20, 20, 0.9) transparent;
    display: block;
    width: 0;
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -90%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -100%);
    }
}

/* Premium Custom Dropdown Component Styles */
.custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 0;
    font-family: 'Outfit', sans-serif;
    user-select: none;
    z-index: 15;
}

.custom-dropdown.open {
    z-index: 99;
}

.custom-dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    box-sizing: border-box;
    height: 48px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: inset 0 -2px 0 var(--border-color);
}

.custom-dropdown-trigger:hover {
    border-color: var(--text-secondary);
    background: var(--bg-secondary);
}

.custom-dropdown-trigger:focus {
    border-color: var(--warning);
    outline: none;
}

.custom-dropdown-arrow {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
    transition: transform 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: visible;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.open .custom-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.custom-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.custom-dropdown-item.active {
    background: var(--warning);
    color: var(--bg-card);
    font-weight: 700;
}

.custom-dropdown-item.active:hover {
    background: var(--warning);
    color: var(--bg-card);
}

/* Premium Multi-Select Dropdown overrides & checkbox visuals */
.custom-dropdown.multi-select .custom-dropdown-item {
    justify-content: flex-start;
    gap: 12px;
}

.custom-dropdown.multi-select .custom-dropdown-item.active {
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
}

.custom-dropdown.multi-select .custom-dropdown-item.active:hover {
    background: var(--bg-secondary);
}

.custom-dropdown-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: transparent;
}

.custom-dropdown-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--btn-primary-text);
}

/* Premium Search Input Focus State */
#manage-search-input:focus {
    border-color: var(--warning) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}



/* Profile Preset Avatars styling */
.avatar-preset {
    box-sizing: border-box;
}
.avatar-preset:hover {
    transform: scale(1.15);
}
.avatar-preset.active {
    border-color: var(--accent) !important;
    transform: scale(1.1);
}



/* Premium Dynamic Sync Status Indicator */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    margin-right: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.sync-indicator.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    display: none !important;
}

.spin-icon {
    animation: rotate-sync 1.5s linear infinite;
}

@keyframes rotate-sync {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Vocabulary Word Types Badges */
.word-types-container {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.word-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-box: trim-both cap alphabetic;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.word-type-badge:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

/* Custom Tooltip Styling */
.custom-tooltip {
    position: absolute;
    z-index: 99999;
    pointer-events: none;
    /* Light Mode Default */
    background: rgba(250, 250, 247, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: pre-line;
    max-width: 280px;
    line-height: 1.4;
    text-align: left;
}

/* Dark Mode Overrides */
body.dark-theme .custom-tooltip {
    background: rgba(34, 34, 32, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.custom-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Manage Sentences Inline Edit styles */
.manage-sentence-item {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.manage-sentence-item:hover:not(.editing) {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--accent) !important;
    cursor: pointer;
}

/* ==========================================================================
   Tactile & Professional Outline Icon SVG System
   ========================================================================== */

/* Target all icon-like SVGs in the application to enforce the same elegant, thin-stroke aesthetic language */
.icon-svg,
.nav-icon svg,
.nav-btn svg,
.btn svg,
.btn-icon svg,
.header-icon-btn svg,
.scramble-header svg,
.scramble-feedback svg,
.stats-mini-card svg,
.custom-dropdown-trigger svg,
.card-header svg,
.attack-title svg,
.feedback-result-title svg,
.illustration-text svg,
.manage-card-content svg,
.node-btn svg,
.edit-btn svg,
.delete-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease, opacity 0.15s ease;
}

/* Specific size adjustments to keep visual hierarchy consistent and clean */
.nav-icon svg,
.nav-btn svg {
    width: 18px;
    height: 18px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-icon svg,
.header-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Ensure colored icons or canvases are not broken by the general outline override rules */
.btn-google svg {
    fill: initial !important;
    stroke: none !important;
    stroke-width: 0 !important;
}

/* Palette inner dots should retain their color fills */
svg.icon-svg circle[fill="currentColor"],
svg.icon-svg path[fill="currentColor"] {
    fill: currentColor !important;
}

/* Card Score Badge with Muted Gold Lightning Bolt Icon */
.card-score-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: help;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.card-score-badge:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.card-score-badge .icon-svg {
    color: var(--warning) !important;
    width: 14px;
    height: 14px;
}/* Premium desaturated Duolingo-style sliding switch-toggles */
.switch-control {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border-color);
    border-radius: 34px;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: var(--bg-card);
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.switch-control input:checked + .switch-slider {
    background-color: var(--accent);
}

.switch-control input:checked + .switch-slider::before {
    transform: translateX(20px);
    background-color: var(--btn-primary-text);
}

.switch-control input:disabled + .switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Premium Game Card Component */
.game-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    background: var(--bg-secondary) !important;
}

.game-card:hover .game-card-icon {
    transform: scale(1.05);
}

.game-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.game-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
}

.game-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.game-card h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.game-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.game-card .btn {
    margin-top: 20px;
    width: 100%;
    font-weight: 700;
}

/* Recall Decks Theme Colors (Muted Blue-Gray) */
[data-game-id="collection"] .game-card-badge {
    background: rgba(79, 110, 138, 0.15);
    color: #5c7890;
}
body.dark-theme [data-game-id="collection"] .game-card-badge {
    background: rgba(125, 145, 161, 0.15);
    color: #8fa3b3;
}
[data-game-id="collection"] .game-card-icon {
    background: linear-gradient(135deg, #5c7080, #4a5a6a);
}
body.dark-theme [data-game-id="collection"] .game-card-icon {
    background: linear-gradient(135deg, #7d91a1, #5e7080);
}

/* Word Scramble Theme Colors (Muted Gold) */
[data-game-id="scramble"] .game-card-badge {
    background: rgba(171, 147, 81, 0.15);
    color: #ab9351;
}
body.dark-theme [data-game-id="scramble"] .game-card-badge {
    background: rgba(184, 152, 88, 0.15);
    color: #c7b06d;
}
[data-game-id="scramble"] .game-card-icon {
    background: linear-gradient(135deg, #ab9351, #947f43);
}
body.dark-theme [data-game-id="scramble"] .game-card-icon {
    background: linear-gradient(135deg, #b89858, #947b47);
}

/* Card Type Drag & Subcategory Submenu Styles */
.custom-dropdown-item {
    position: relative;
}

.custom-dropdown-item[draggable="true"] {
    cursor: grab;
}

.custom-dropdown-item.dragging {
    opacity: 0.4;
    border: 1px dashed var(--accent);
}

.custom-dropdown-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    color: var(--text-tertiary);
    cursor: grab;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.custom-dropdown-item:hover .custom-dropdown-grip {
    opacity: 1;
}

.custom-dropdown-submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    width: 200px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 6px 0;
    z-index: 10001;
    overflow: hidden;
}

.custom-dropdown-item:hover .custom-dropdown-submenu {
    display: block;
}

.custom-dropdown.dragging-active .custom-dropdown-submenu {
    display: none !important;
}

.custom-dropdown-submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-dropdown-submenu-item:hover {
    background: var(--bg-secondary);
}

.custom-dropdown-submenu-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.custom-dropdown-submenu-add:hover {
    background: var(--bg-secondary);
}

.responsive-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    /* Prevent iOS browser auto-zoom by forcing minimum 16px font-size on form controls */
    .input-field,
    textarea,
    select,
    .custom-dropdown-trigger {
        font-size: 1rem !important; /* 16px */
    }

    /* Modal Backdrop mobile optimizations */
    .modal-backdrop,
    .custom-modal-overlay {
        padding: var(--space-sm) !important; /* Extremely small margin to maximize space */
    }

    /* Expand modals to use maximum screen width on mobile */
    .modal-content,
    .custom-modal-content {
        max-width: 96% !important;
        width: 96% !important;
        border-radius: var(--radius-md) !important;
        padding: var(--space-md) !important;
    }

    /* Accordion style for mobile dropdown submenus */
    .custom-dropdown-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }
    
    .custom-dropdown-item-content {
        padding: 12px 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Prevent hover from showing submenu on mobile */
    .custom-dropdown-item:hover .custom-dropdown-submenu {
        display: none;
    }
    
    .custom-dropdown-submenu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        display: none;
        z-index: auto;
    }
    
    /* Show only when class submenu-open is present */
    .custom-dropdown-item.submenu-open .custom-dropdown-submenu,
    .custom-dropdown-item.submenu-open:hover .custom-dropdown-submenu {
        display: block;
    }
    
    /* Indent subcategory items and add a subtle background */
    .custom-dropdown-submenu-item {
        padding: 10px 14px 10px 32px; /* Indent to show hierarchy */
        background: rgba(0, 0, 0, 0.02);
    }
    body.dark-theme .custom-dropdown-submenu-item {
        background: rgba(255, 255, 255, 0.02);
    }
    
    .custom-dropdown-submenu-add {
        padding: 8px 14px 8px 32px;
        background: rgba(0, 0, 0, 0.02);
    }
    body.dark-theme .custom-dropdown-submenu-add {
        background: rgba(255, 255, 255, 0.02);
    }
    
    /* Rotate indicator arrow when submenu is open */
    span.custom-dropdown-arrow {
        display: inline-block;
    }
    
    .custom-dropdown-item.submenu-open .custom-dropdown-item-content span.custom-dropdown-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    /* Stack settings grid vertically on very small screens */
    .responsive-settings-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
}

.file-input-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
}
.file-input-row .file-input-container {
    flex: 1;
    margin-top: 0;
}
.file-input-row .file-input-button {
    width: 155px; /* Symmetrical size */
    text-align: center;
    flex-shrink: 0;
    font-size: 0.82rem;
}

@media (max-width: 600px) {
    .file-input-row {
        flex-direction: column;
        gap: 8px;
    }
    .file-input-row .file-input-button {
        width: 100%;
    }
}
