:root {
    --bg: #0b0e14;
    --panel: #141823;
    --panel-soft: #1a1f2e;
    --card: #0f131c;

    --text: #e5e7eb;
    --muted: #9ca3af;

    --accent: #6d6af8;

    --green: #22c55e;
    --yellow: #fbbf24;
    --red: #ef4444;

    --border: #2a2f42;
}

/* ---------- Base ---------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1 { margin-bottom: 24px; }
h3 { color: var(--muted); font-size: 14px; }

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Layout ---------- */

.dashboard {
    display: flex;
    gap: 24px;
}

.main-panel {
    flex: 3;
    background: var(--panel);
    padding: 24px;
    border-radius: 14px;
}

.notifications-panel {
    flex: 1.2;
    background: var(--panel-soft);
    padding: 20px;
    border-radius: 14px;
}

/* ---------- Form ---------- */

form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--muted);
}

input {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0b0e14;
    color: var(--text);
}

form button {
    margin-top: 12px;
    padding: 12px;
    width: 100%;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: white;
}

/* ---------- Cards ---------- */

.card {
    margin-top: 18px;
    padding: 14px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* ---------- Notifications ---------- */

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }

.recall-text {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.done-btn {
    width: auto;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 999px;
}

.notification.removing {
    animation: fadeOut 0.35s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(12px);
    }
}

/* ---------- Countdown ---------- */

.countdown-warning { color: var(--yellow); }
.countdown-danger { color: var(--red); font-weight: 700; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .dashboard { flex-direction: column; }
}

/* ---------- Loading Overlay ---------- */

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-card {
    background: #111827;
    padding: 28px 36px;
    border-radius: 14px;
    text-align: center;
    color: #e5e7eb;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #374151;
    border-top: 3px solid #6d6af8;
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    padding: 18px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.muted {
    color: #9ca3af;
}

/* ---------- Toasts ---------- */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: #111827;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(10px);
    animation: toast-in 0.25s ease forwards;
}

.toast.success {
    border-left: 4px solid #22c55e;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.removing {
    animation: toast-out 0.25s ease forwards;
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Logout Button Polish */

/* ---------- Logout Button ---------- */

#logout-btn {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #374151;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    top: 24px;
    right: 24px;
}

#logout-btn i {
    font-size: 13px;
}

#logout-btn:hover {
    background: #1f2933;
    color: #e5e7eb;
    border-color: #6d6af8;
}

#logout-btn:active {
    transform: scale(0.97);
}

/* ---------- History Table ---------- */

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #e5e7eb;
}

.history-table thead {
    background: #111827;
}

.history-table th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    color: #9ca3af;
    border-bottom: 1px solid #374151;
}

.history-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #1f2933;
}

.history-table tbody tr:hover {
    background: #1f2933;
}

/* ---------- History Page Layout ---------- */

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-link {
    color: #8b5cf6;
    font-size: 14px;
    text-decoration: none;
    width: fit-content;
}

.back-link:hover {
    text-decoration: underline;
}

/* ---------- History Card ---------- */

.history-card {
    background: linear-gradient(
        180deg,
        #0f172a,
        #020617
    );
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* ---------- History Table ---------- */

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.history-table thead {
    background: #020617;
}

.history-table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: #9ca3af;
    border-bottom: 1px solid #1f2937;
}

.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #111827;
    color: #e5e7eb;
}

.history-table tbody tr:hover {
    background: #020617;
}

/* ---------- Difficulty Pill ---------- */

.difficulty-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #111827;
    color: #fbbf24;
    font-weight: 600;
    font-size: 12px;
}

/* ---------- Empty State ---------- */

.empty-state {
    text-align: center;
    padding: 32px;
    color: #9ca3af;
    font-size: 14px;
}
