:root {
    --bg-dark: #0b0f19;
    --bg-dark-rgb: 11, 15, 25;
    --bg-light: #ffffff;
    --bg-light-rgb: 255, 255, 255;

    
    --primary: #43a047;
    --primary-rgb: 67, 160, 71;
    --primary-hover: #388e3c;
    --primary-active: #2e7d32;

    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-light: #ffffff;
    --border-light: #f1f5f9;

    
    --header-height: 75px;

    
    --blue: #60a5fa;
    --blue-rgb: 96, 165, 250;
    --green: #43a047;
    --green-rgb: 67, 160, 71;
    --orange: #fb923c;
    --orange-rgb: 251, 146, 60;
    --pink: #f472b6;
    --pink-rgb: 244, 114, 182;
    --purple: #a78bfa;
    --purple-rgb: 167, 139, 250;
    --blue-accent: #3b82f6;
    --blue-accent-rgb: 59, 130, 246;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

html {
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-light);
    color: var(--bg-dark);
    line-height: 1.5;
    margin-top: var(--header-height);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000000;
    background-color: var(--bg-dark);
    box-shadow: 0 0 0 100vmax var(--bg-dark);
    clip-path: inset(0 -100vmax);
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    height: var(--header-height);
}

.header-items {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-items a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    background: var(--bg-dark);
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 12px 24px;
    font-size: 1.05em;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-items a:hover {
    color: var(--text-light);
    background: rgba(var(--bg-light-rgb), 0.05);
}

.header-items a.active {
    color: var(--text-light);
    background: rgba(var(--bg-light-rgb), 0.1);
    border-color: rgba(var(--bg-light-rgb), 0.15);
}

.btn-gradient {
    background: var(--primary);
    color: var(--text-light) !important;
    border: none;
    padding: 12px 28px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-gradient:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: -0.5px;
    text-decoration: none;
    cursor: pointer;
}

.glass-panel {
    background: rgba(var(--bg-dark-rgb), 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--bg-light-rgb), 0.08);
}

footer,
quizy-footer {
    display: block;
    background-color: var(--bg-dark);
    color: var(--text-muted);
    padding: 40px 24px;
    border-top: 1px solid rgba(var(--bg-light-rgb), 0.05);
    margin-top: auto;
}


body:has(.learn-overlay.active) quizy-footer,
body:has(.flashcards-overlay.active) quizy-footer,
body:has(.mc-overlay.active) quizy-footer,
body:has(.sp-overlay.active) quizy-footer,
.learn-overlay.active ~ quizy-footer,
.flashcards-overlay.active ~ quizy-footer,
.mc-overlay.active ~ quizy-footer,
.sp-overlay.active ~ quizy-footer {
    display: none !important;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-brand {
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.2em;
    letter-spacing: -0.5px;
}

.footer-credit {
    font-size: 0.95em;
    opacity: 0.8;
    border-left: 1px solid rgba(var(--bg-light-rgb), 0.15);
    padding-left: 16px;
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--primary);
}



#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999999 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: #1e293b; 
    color: var(--text-light);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--primary);
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-info {
    border-left-color: var(--blue);
}

.toast-content {
    flex: 1;
    font-size: 0.95em;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5em;
    cursor: pointer;
    padding-left: 12px;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-light);
}


.dashboard-wrapper, .set-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 40px 24px;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
}


quizy-delete-modal:not(.active) {
    opacity: 0;
    pointer-events: none;
    position: fixed;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 16, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: 90%;
    max-width: 760px;
    max-height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-light);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(85vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 20px 24px 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 10px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.04);
}


.set-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-action {
    background: rgba(var(--bg-light-rgb), 0.05);
    border: 1px solid rgba(var(--bg-light-rgb), 0.05);
    color: var(--text-light);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-action:hover {
    background: rgba(var(--bg-light-rgb), 0.1);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.btn-icon-action.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}


.btn-speak {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.btn-speak:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
    transform: scale(1.1);
}


quizy-settings-panel {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: rgba(22, 22, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px;
    box-sizing: border-box;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    opacity: 0;
    transform: scale(0);
    transform-origin: calc(100% - 60px) 0px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, visibility 0.3s;
}

quizy-settings-panel.active {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transform: scale(1);
}

quizy-settings-panel::-webkit-scrollbar {
    width: 6px;
}

quizy-settings-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

quizy-settings-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

quizy-settings-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

quizy-settings-panel .settings-panel-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

quizy-settings-panel .settings-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

quizy-settings-panel .setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

quizy-settings-panel .setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

quizy-settings-panel .setting-label {
    cursor: pointer;
    color: var(--text-light);
    font-weight: 500;
}

quizy-settings-panel .setting-description {
    font-size: 0.85em;
    color: var(--text-muted);
}

quizy-settings-panel .settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

quizy-settings-panel .settings-actions button {
    flex: 1;
}

