/**
 * Premium Dark Mode UI properties and utility classes
 */
:root,
[data-theme="nocturne"] {
    /* Nocturne Theme (Deep space, stark neon accents) */
    --bg-base: #0a0b10;
    --bg-surface: #13151c;
    --bg-surface-hover: #1c1f2a;

    --primary: #9d4edd;
    --primary-hover: #c77dff;
    --primary-glow: rgba(157, 78, 221, 0.5);

    --accent: #00f5d4;
    --accent-glow: rgba(0, 245, 212, 0.4);

    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-muted: #495057;

    --border-color: #2b2d42;
    --border-light: rgba(255, 255, 255, 0.03);
}

[data-theme="aurora"] {
    /* Aurora Glass (Translucent, icy, holographic) */
    --bg-base: #ebf4f5;
    /* Light mode base, but we use dark cards */
    --bg-surface: rgba(255, 255, 255, 0.6);
    --bg-surface-hover: rgba(255, 255, 255, 0.8);

    --primary: #5390d9;
    --primary-hover: #4ea8de;
    --primary-glow: rgba(83, 144, 217, 0.3);

    --accent: #5e60ce;
    --accent-glow: rgba(94, 96, 206, 0.3);

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #868e96;

    --border-color: rgba(255, 255, 255, 0.2);
    --border-light: rgba(255, 255, 255, 0.5);

    /* Specific overrides for Glassmorphism */
    --shadow-md: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

[data-theme="obsidian"] {
    /* Obsidian Gold (Rich, luxurious black and gold) */
    --bg-base: #111111;
    --bg-surface: #1a1a1a;
    --bg-surface-hover: #222222;

    --primary: #d4af37;
    /* Metallic Gold */
    --primary-hover: #f1c40f;
    --primary-glow: rgba(212, 175, 55, 0.3);

    --accent: #c0c0c0;
    /* Silver Accent */
    --accent-glow: rgba(192, 192, 192, 0.2);

    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;

    --border-color: #333333;
    --border-light: rgba(212, 175, 55, 0.1);
}

[data-theme="monochrome"] {
    /* Hyper Monochrome (Brutalist, stark white on black, minimalist) */
    --bg-base: #000000;
    --bg-surface: #0a0a0a;
    --bg-surface-hover: #141414;

    --primary: #ffffff;
    --primary-hover: #cccccc;
    --primary-glow: rgba(255, 255, 255, 0.2);

    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #444444;

    --border-color: #333333;
    --border-light: rgba(255, 255, 255, 0.05);
}

:root {
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Radius & Shadows */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Basics */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Utilities */
.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
}

/* Authentication Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-base);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-md);
    text-align: center;
    animation: fadeIn var(--transition-normal);
}

.auth-header {
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Password Strength Meter */
.password-strength-container {
    margin-top: 0.75rem;
    text-align: left;
    animation: fadeIn var(--transition-fast);
}

.password-strength-container.hidden {
    display: none;
}

.strength-meter-bar {
    height: 6px;
    background: var(--bg-modifier-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.strength-meter-fill {
    height: 100%;
    width: 0%;
    background: var(--danger);
    transition: width var(--transition-normal), background-color var(--transition-normal);
}

.strength-meter-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    z-index: 10;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed {
    margin-left: -280px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sprint-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sprint-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sprint-item-content {
    flex: 1;
    min-width: 0;
    /* allows text truncation */
}

.sprint-item-actions {
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.sprint-item:hover .sprint-item-actions {
    opacity: 1;
}

.delete-sprint-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.delete-sprint-btn:hover {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.1);
}

.sprint-item:hover {
    background-color: var(--bg-surface-hover);
    transform: translateX(2px);
}

.sprint-item.active {
    background-color: var(--bg-surface);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.sprint-item-title {
    font-weight: 500;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sprint-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Workspace */
.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 0 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Header */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-dropdown {
    position: relative;
}

.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 180px;
    box-shadow: var(--shadow-md);
    z-index: 50;
    animation: fadeIn var(--transition-fast);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-menu.hidden {
    display: none;
}

.theme-option {
    text-align: left;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.theme-option:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.theme-option.active {
    color: var(--primary);
    font-weight: 500;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 1.75rem;
    -webkit-text-fill-color: var(--primary);
    /* Fallback */
    color: var(--primary);
}

/* Inputs & Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: all var(--transition-fast);
}

.icon-btn {
    color: var(--text-secondary);
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-full);
}

.icon-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface);
}

.primary-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.primary-btn:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.primary-btn:active {
    transform: translateY(0);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

input[type="text"],
input[type="password"],
select {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Goal Section */
.goal-section {
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.goal-section h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

/* loading */
.loading {
    margin-top: 1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.loading.hidden {
    display: none;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.column {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.column-header h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-count {
    background-color: var(--bg-base);
    padding: 0.1rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
}

.task-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 150px;
    /* target for drag/drop */
}

/* Task Item (Card) */
.task-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: grab;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    user-select: none;
}

.task-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.task-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary);
}

.task-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-checkbox {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
    /* alignment tweak */
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.task-checkbox:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.task-checkbox.checked {
    color: var(--success);
}

.task-title {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.task-title.completed-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-size {
    background-color: var(--bg-surface-hover);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-weight: 600;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-actions button {
    opacity: 0;
    color: var(--text-muted);
}

.task-card:hover .task-actions button {
    opacity: 1;
}

.task-actions button:hover {
    color: var(--danger);
}


/* Modal Settings Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.modal-content.glass-panel {
    background: rgba(30, 33, 40, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideUp var(--transition-normal);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}