/* ==========================================================================
   TODO App - Multi-Theme Styles
   Supports: minimal, dark, glass, neumorphism, retro
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600&family=Galmuri11&display=swap');

/* Korean Pixel Font - Galmuri (갈무리) */
@font-face {
    font-family: 'Galmuri11';
    src: url('https://cdn.jsdelivr.net/gh/quiple/galmuri/dist/Galmuri11.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* ==========================================================================
   Theme Variables
   ========================================================================== */

/* Default/Retro Theme (8-bit Pixel Style) */
:root,
[data-theme="retro"] {
    --color-bg: #1a1c2c;
    --color-bg-secondary: #29366f;
    --color-primary: #41a6f6;
    --color-secondary: #73eff7;
    --color-success: #38b764;
    --color-danger: #b13e53;
    --color-warning: #ffcd75;
    --color-white: #f4f4f4;
    --color-dark: #333c57;
    --color-darker: #29366f;
    --color-border: #5d275d;
    --color-text: #f4f4f4;
    --color-text-muted: #94b0c2;
    --color-completed: #566c86;
    --color-card-bg: #29366f;
    --color-input-bg: #1a1c2c;

    --font-family: 'Press Start 2P', 'Galmuri11', cursive;
    --font-size-base: 14px;
    --font-size-small: 11px;
    --font-size-large: 16px;
    --font-size-title: 20px;

    --border-width: 4px;
    --border-radius: 0px;
    --shadow: 8px 8px 0px 0px var(--color-dark);
    --shadow-hover: 0 0 20px rgba(115, 239, 247, 0.5);
    --transition: 0.1s;

    /* Theme specific */
    --scanline-display: block;
    --grid-display: block;
    --blur-value: 0;
    --glass-opacity: 1;
}

/* Minimal Theme (Notion-like Clean Style) */
[data-theme="minimal"] {
    --color-bg: #ffffff;
    --color-bg-secondary: #ffffff;
    --color-primary: #2eaadc;
    --color-secondary: #0f7b6c;
    --color-success: #0f7b6c;
    --color-danger: #e03e3e;
    --color-warning: #dfab01;
    --color-white: #ffffff;
    --color-dark: #f1f1ef;
    --color-darker: #f7f7f5;
    --color-border: #e9e9e7;
    --color-text: #37352f;
    --color-text-muted: #9b9a97;
    --color-completed: #9b9a97;
    --color-card-bg: #ffffff;
    --color-input-bg: #ffffff;

    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif;
    --font-size-base: 14px;
    --font-size-small: 12px;
    --font-size-large: 16px;
    --font-size-title: 32px;

    --border-width: 1px;
    --border-radius: 3px;
    --shadow: none;
    --shadow-hover: none;
    --transition: 0.1s;

    --scanline-display: none;
    --grid-display: none;
    --blur-value: 0;
    --glass-opacity: 1;
}

/* Dark Theme (Neon Style) */
[data-theme="dark"] {
    --color-bg: #0d1117;
    --color-bg-secondary: #161b22;
    --color-primary: #58a6ff;
    --color-secondary: #79c0ff;
    --color-success: #3fb950;
    --color-danger: #f85149;
    --color-warning: #d29922;
    --color-white: #f0f6fc;
    --color-dark: #21262d;
    --color-darker: #161b22;
    --color-border: #30363d;
    --color-text: #c9d1d9;
    --color-text-muted: #8b949e;
    --color-completed: #484f58;
    --color-card-bg: #161b22;
    --color-input-bg: #0d1117;

    /* Neon glow colors */
    --neon-cyan: #00ffff;
    --neon-purple: #bd00ff;
    --neon-pink: #ff00ff;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 14px;
    --font-size-small: 12px;
    --font-size-large: 16px;
    --font-size-title: 28px;

    --border-width: 1px;
    --border-radius: 8px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 0 20px rgba(88, 166, 255, 0.4);
    --transition: 0.2s;

    --scanline-display: none;
    --grid-display: none;
    --blur-value: 0;
    --glass-opacity: 1;
}

/* Terminal Theme (Hacker Style) */
[data-theme="terminal"] {
    --color-bg: #0a0a0a;
    --color-bg-secondary: #111111;
    --color-primary: #00ff00;
    --color-secondary: #00cc00;
    --color-success: #00ff00;
    --color-danger: #ff0000;
    --color-warning: #ffff00;
    --color-white: #00ff00;
    --color-dark: #1a1a1a;
    --color-darker: #0a0a0a;
    --color-border: #00ff00;
    --color-text: #00ff00;
    --color-text-muted: #008800;
    --color-completed: #005500;
    --color-card-bg: #0a0a0a;
    --color-input-bg: #000000;

    --font-family: 'Courier New', 'Lucida Console', monospace;
    --font-size-base: 14px;
    --font-size-small: 12px;
    --font-size-large: 16px;
    --font-size-title: 24px;

    --border-width: 1px;
    --border-radius: 0px;
    --shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    --shadow-hover: 0 0 20px rgba(0, 255, 0, 0.5);
    --transition: 0.1s;

    --scanline-display: block;
    --grid-display: none;
    --blur-value: 0;
    --glass-opacity: 1;
}

/* Gameboy Theme (Green LCD) */
[data-theme="gameboy"] {
    --color-bg: #9bbc0f;
    --color-bg-secondary: #8bac0f;
    --color-primary: #0f380f;
    --color-secondary: #306230;
    --color-success: #0f380f;
    --color-danger: #306230;
    --color-warning: #0f380f;
    --color-white: #9bbc0f;
    --color-dark: #306230;
    --color-darker: #0f380f;
    --color-border: #0f380f;
    --color-text: #0f380f;
    --color-text-muted: #306230;
    --color-completed: #306230;
    --color-card-bg: #8bac0f;
    --color-input-bg: #9bbc0f;

    --font-family: 'Press Start 2P', 'Galmuri11', monospace;
    --font-size-base: 12px;
    --font-size-small: 10px;
    --font-size-large: 14px;
    --font-size-title: 16px;

    --border-width: 4px;
    --border-radius: 0px;
    --shadow: 4px 4px 0px 0px #306230;
    --shadow-hover: 2px 2px 0px 0px #306230;
    --transition: 0s;

    --scanline-display: block;
    --grid-display: none;
    --blur-value: 0;
    --glass-opacity: 1;
}

/* Windows 98 Theme */
[data-theme="win98"] {
    --color-bg: #008080;
    --color-bg-secondary: #c0c0c0;
    --color-primary: #000080;
    --color-secondary: #1084d0;
    --color-success: #008000;
    --color-danger: #ff0000;
    --color-warning: #ffff00;
    --color-white: #ffffff;
    --color-dark: #808080;
    --color-darker: #404040;
    --color-border: #dfdfdf;
    --color-text: #000000;
    --color-text-muted: #808080;
    --color-completed: #808080;
    --color-card-bg: #c0c0c0;
    --color-input-bg: #ffffff;

    /* Windows 98 3D border colors */
    --win98-light: #dfdfdf;
    --win98-dark: #808080;
    --win98-darker: #404040;

    --font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
    --font-size-base: 14px;
    --font-size-small: 12px;
    --font-size-large: 16px;
    --font-size-title: 14px;

    --border-width: 2px;
    --border-radius: 0px;
    --shadow: none;
    --shadow-hover: none;
    --transition: 0s;

    --scanline-display: none;
    --grid-display: none;
    --blur-value: 0;
    --glass-opacity: 1;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    padding: 24px;
    transition: background var(--transition), color var(--transition);
}

/* ==========================================================================
   Theme-Specific Body Styles
   ========================================================================== */

/* Retro: Scanline Effect */
[data-theme="retro"] body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    display: var(--scanline-display);
}

/* Retro: Grid Background */
[data-theme="retro"] body {
    background-image:
        linear-gradient(rgba(65, 166, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(65, 166, 246, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    image-rendering: pixelated;
}

/* Dark: Gradient overlay */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

/* Terminal: CRT effect */
[data-theme="terminal"] body {
    background: #0a0a0a;
}

[data-theme="terminal"] body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.2) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Gameboy: LCD scanlines */
[data-theme="gameboy"] body {
    background: #9bbc0f;
    image-rendering: pixelated;
}

[data-theme="gameboy"] body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(15, 56, 15, 0.1),
        rgba(15, 56, 15, 0.1) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Windows 98: Teal background */
[data-theme="win98"] body {
    background: #008080;
}

/* ==========================================================================
   App Container
   ========================================================================== */

.app-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   Header
   ========================================================================== */

.app-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 16px;
}

.app-header h1 {
    font-family: var(--font-family);
    font-size: var(--font-size-title);
    color: var(--color-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: color var(--transition);
}

/* Retro: Special header styling */
[data-theme="retro"] .app-header h1 {
    color: var(--color-warning);
    text-shadow:
        4px 4px 0px var(--color-danger),
        -2px -2px 0px var(--color-primary);
    letter-spacing: 2px;
    animation: rainbow 3s infinite;
}

[data-theme="retro"] .app-header h1::after {
    content: "_";
    animation: blink 1s infinite;
}

/* Dark: Neon glow header */
[data-theme="dark"] .app-header h1 {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
}

/* Terminal: Glowing header */
[data-theme="terminal"] .app-header h1 {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
}

[data-theme="terminal"] .app-header h1::before {
    content: "> ";
}

[data-theme="terminal"] .app-header h1::after {
    content: "_";
    animation: blink 1s infinite;
}

/* Gameboy: Pixel header */
[data-theme="gameboy"] .app-header h1 {
    color: #0f380f;
    text-shadow: 2px 2px 0px #306230;
    font-size: 16px;
}

/* Windows 98: Title bar style */
[data-theme="win98"] .app-header {
    background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
    padding: 4px 8px;
    margin-bottom: 16px;
}

[data-theme="win98"] .app-header h1 {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
}

/* ==========================================================================
   Theme Selector
   ========================================================================== */

.theme-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.theme-btn {
    padding: 8px 12px;
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    background: var(--color-card-bg);
    color: var(--color-text);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.theme-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-hover);
}

/* Retro: Pixel button style */
[data-theme="retro"] .theme-btn {
    box-shadow: 4px 4px 0px 0px var(--color-dark);
}

[data-theme="retro"] .theme-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

/* Dark: Neon button style */
[data-theme="dark"] .theme-btn:hover,
[data-theme="dark"] .theme-btn.active {
    box-shadow: 0 0 15px var(--neon-cyan);
    border-color: var(--neon-cyan);
}

/* Terminal: Green glow button */
[data-theme="terminal"] .theme-btn:hover,
[data-theme="terminal"] .theme-btn.active {
    box-shadow: 0 0 10px #00ff00;
    border-color: #00ff00;
}

/* Gameboy: Pixel button */
[data-theme="gameboy"] .theme-btn {
    box-shadow: 2px 2px 0px 0px #306230;
}

[data-theme="gameboy"] .theme-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Windows 98: 3D button */
[data-theme="win98"] .theme-btn {
    background: #c0c0c0;
    border: none;
    box-shadow: inset -1px -1px 0px #404040, inset 1px 1px 0px #ffffff, inset -2px -2px 0px #808080, inset 2px 2px 0px #dfdfdf;
}

[data-theme="win98"] .theme-btn:active {
    box-shadow: inset 1px 1px 0px #404040, inset -1px -1px 0px #ffffff, inset 2px 2px 0px #808080, inset -2px -2px 0px #dfdfdf;
}

[data-theme="win98"] .theme-btn.active {
    background: #000080;
    color: #ffffff;
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.app-main {
    background-color: var(--color-card-bg);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    transition: all var(--transition);
}

/* Retro: Special main styling */
[data-theme="retro"] .app-main {
    border-color: var(--color-secondary);
    box-shadow:
        8px 8px 0px 0px var(--color-dark),
        inset 0 0 20px rgba(115, 239, 247, 0.1);
}

[data-theme="retro"] .app-main::before {
    content: "QUEST LOG";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-darker);
    padding: 0 8px;
    font-size: var(--font-size-small);
    color: var(--color-secondary);
}

/* Terminal: Green border glow */
[data-theme="terminal"] .app-main {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3), inset 0 0 20px rgba(0, 255, 0, 0.05);
}

[data-theme="terminal"] .app-main::before {
    content: "root@todo:~$";
    position: absolute;
    top: -20px;
    left: 10px;
    font-size: 12px;
    color: #00ff00;
}

/* Gameboy: Pixel border */
[data-theme="gameboy"] .app-main {
    border: 4px solid #0f380f;
    box-shadow: 4px 4px 0px 0px #306230;
}

[data-theme="gameboy"] .app-main::before {
    content: "TASKS";
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #8bac0f;
    padding: 0 8px;
    font-size: 10px;
    color: #0f380f;
}

/* Windows 98: 3D window */
[data-theme="win98"] .app-main {
    background: #c0c0c0;
    border: none;
    box-shadow: inset -1px -1px 0px #404040, inset 1px 1px 0px #ffffff, inset -2px -2px 0px #808080, inset 2px 2px 0px #dfdfdf;
}

/* ==========================================================================
   Todo Input Section
   ========================================================================== */

.todo-input-section {
    padding: 24px;
    border-bottom: var(--border-width) dashed var(--color-border);
    transition: all var(--transition);
}

/* Retro: Gradient input section */
[data-theme="retro"] .todo-input-section {
    background: linear-gradient(180deg, rgba(65, 166, 246, 0.1) 0%, transparent 100%);
    border-bottom: 4px dashed var(--color-border);
}

/* Minimal: Clean input section */
[data-theme="minimal"] .todo-input-section {
    border-bottom: 1px solid var(--color-border);
}

/* ==========================================================================
   Minimal Theme - Notion-like Table Styles
   ========================================================================== */

[data-theme="minimal"] .app-container {
    max-width: 900px;
}

[data-theme="minimal"] .app-header {
    text-align: left;
    padding: 40px 0 24px 0;
    margin-bottom: 0;
}

[data-theme="minimal"] .app-header h1 {
    font-weight: 700;
    font-size: 40px;
    color: #37352f;
    letter-spacing: -0.03em;
}

[data-theme="minimal"] .theme-selector {
    justify-content: flex-start;
    margin-top: 20px;
    gap: 6px;
}

[data-theme="minimal"] .theme-btn {
    background: transparent;
    border: none;
    color: #9b9a97;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

[data-theme="minimal"] .theme-btn:hover {
    background: #f1f1ef;
    color: #37352f;
}

[data-theme="minimal"] .theme-btn.active {
    background: #2eaadc;
    color: #ffffff;
}

[data-theme="minimal"] .app-main {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Notion-like Table */
[data-theme="minimal"] .todo-table {
    border-collapse: collapse;
}

[data-theme="minimal"] .todo-table thead {
    background: transparent;
}

[data-theme="minimal"] .todo-table th {
    padding: 8px 8px;
    font-weight: 500;
    font-size: 12px;
    color: #9b9a97;
    border-bottom: 1px solid #e9e9e7;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

[data-theme="minimal"] .todo-table tbody tr {
    border-bottom: 1px solid #f1f1ef;
}

[data-theme="minimal"] .todo-table tbody tr:hover {
    background: #f7f7f5;
}

[data-theme="minimal"] .todo-table tbody td {
    padding: 8px;
}

/* Notion-like inline inputs */
[data-theme="minimal"] .todo-table .inline-input {
    background: transparent;
    border: none;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 14px;
    color: #37352f;
    transition: background 0.1s;
}

[data-theme="minimal"] .todo-table .inline-input:hover {
    background: #f1f1ef;
    border: none;
}

[data-theme="minimal"] .todo-table .inline-input:focus {
    background: #e9e9e7;
    border: none;
    box-shadow: none;
    outline: none;
}

[data-theme="minimal"] .todo-table .inline-input::placeholder {
    color: #c4c4c4;
}

[data-theme="minimal"] .todo-table .inline-input.time-input {
    width: 55px;
    text-align: center;
    color: #9b9a97;
    font-size: 13px;
}

[data-theme="minimal"] .todo-table .inline-input.estimated-input {
    width: 55px;
    color: #9b9a97;
    font-size: 13px;
}

/* Input row styling */
[data-theme="minimal"] .input-row {
    background: transparent;
}

[data-theme="minimal"] .input-row td {
    padding: 6px 8px;
    border-bottom: 1px solid #e9e9e7;
}

[data-theme="minimal"] .input-row td.col-skimming {
    white-space: nowrap;
}

[data-theme="minimal"] .input-row input,
[data-theme="minimal"] .input-row textarea {
    background: transparent;
    border: none;
    padding: 8px;
    font-size: 14px;
    border-radius: 3px;
}

[data-theme="minimal"] .input-row input:hover,
[data-theme="minimal"] .input-row textarea:hover {
    background: #f1f1ef;
}

[data-theme="minimal"] .input-row input:focus,
[data-theme="minimal"] .input-row textarea:focus {
    background: #e9e9e7;
    box-shadow: none;
    border: none;
    outline: none;
}

[data-theme="minimal"] .input-row input::placeholder,
[data-theme="minimal"] .input-row textarea::placeholder {
    color: #c4c4c4;
}

[data-theme="minimal"] .input-row textarea {
    resize: none;
    overflow: hidden;
    min-height: 32px;
    line-height: 1.4;
}

[data-theme="minimal"] .input-row .time-input {
    width: 50px;
    display: inline-block;
}

[data-theme="minimal"] .input-row .time-separator {
    color: #c4c4c4;
    display: inline-block;
    margin: 0 2px;
}

/* Add button - Notion style */
[data-theme="minimal"] .input-row .btn-add {
    background: #2eaadc;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    font-size: 18px;
    font-weight: 400;
    border-radius: 3px;
    box-shadow: none;
}

[data-theme="minimal"] .input-row .btn-add:hover {
    background: #2496c4;
    transform: none;
}

/* Checkbox - Notion style */
[data-theme="minimal"] .todo-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid #c4c4c4;
    border-radius: 3px;
    margin-right: 0;
}

[data-theme="minimal"] .todo-checkbox:hover {
    border-color: #2eaadc;
}

[data-theme="minimal"] .todo-checkbox:checked {
    background: #2eaadc;
    border-color: #2eaadc;
}

[data-theme="minimal"] .todo-checkbox:checked::after {
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border-width: 0 1.5px 1.5px 0;
}

/* Delete button */
[data-theme="minimal"] .todo-table .btn-delete {
    border: none;
    color: #c4c4c4;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 3px;
}

[data-theme="minimal"] .todo-table .btn-delete:hover {
    background: #f1f1ef;
    color: #e03e3e;
}

/* Completed row */
[data-theme="minimal"] .todo-table tbody tr.completed {
    opacity: 1;
}

[data-theme="minimal"] .todo-table tbody tr.completed .inline-input.text-input {
    text-decoration: line-through;
    color: #9b9a97;
}

/* Stats - Notion style */
[data-theme="minimal"] .todo-stats {
    background: transparent;
    border-top: none;
    padding: 16px 0;
    justify-content: flex-start;
    gap: 16px;
}

[data-theme="minimal"] .todo-stats span {
    background: transparent;
    padding: 0;
    font-size: 12px;
    color: #9b9a97;
}

[data-theme="minimal"] #total-count,
[data-theme="minimal"] #completed-count,
[data-theme="minimal"] #pending-count {
    color: #9b9a97;
}

/* History toggle */
[data-theme="minimal"] .history-toggle-section {
    border-top: none;
    text-align: left;
    padding: 8px 0;
}

[data-theme="minimal"] .btn-history {
    border: none;
    color: #9b9a97;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 3px;
}

[data-theme="minimal"] .btn-history:hover {
    background: #f1f1ef;
    color: #37352f;
}

/* Drag and drop */
[data-theme="minimal"] .todo-table tbody tr.drag-over {
    border-top: 2px solid #2eaadc;
}

/* Empty state */
[data-theme="minimal"] .empty-state {
    color: #c4c4c4;
}

[data-theme="minimal"] .empty-state::before {
    content: "✓";
    opacity: 0.3;
}

.todo-form {
    display: flex;
    gap: 8px;
}

.todo-input {
    flex: 1;
    padding: 16px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background-color: var(--color-input-bg);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    outline: none;
    transition: all var(--transition);
}

.todo-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

.todo-input::placeholder {
    color: var(--color-text-muted);
}

/* Retro: Pixel input */
[data-theme="retro"] .todo-input {
    box-shadow:
        inset 4px 4px 0px 0px rgba(0,0,0,0.3),
        0 0 10px rgba(65, 166, 246, 0.3);
}

[data-theme="retro"] .todo-input:focus {
    border-color: var(--color-secondary);
    box-shadow:
        inset 4px 4px 0px 0px rgba(0,0,0,0.3),
        0 0 20px rgba(115, 239, 247, 0.5);
}

/* Dark: Neon glow input */
[data-theme="dark"] .todo-input:focus {
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.3);
}

/* Terminal: Green glow input */
[data-theme="terminal"] .todo-input {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
}

[data-theme="terminal"] .todo-input:focus {
    box-shadow: 0 0 10px #00ff00;
}

[data-theme="terminal"] .todo-input::placeholder {
    color: #008800;
}

/* Gameboy: Pixel input */
[data-theme="gameboy"] .todo-input {
    border: 3px solid #0f380f;
    box-shadow: inset 2px 2px 0px #306230;
}

/* Windows 98: Sunken input */
[data-theme="win98"] .todo-input {
    background: #ffffff;
    border: none;
    box-shadow: inset 1px 1px 0px #404040, inset -1px -1px 0px #ffffff, inset 2px 2px 0px #808080, inset -2px -2px 0px #dfdfdf;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    padding: 16px 24px;
    border: var(--border-width) solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    font-weight: 600;
}

.btn-add {
    background: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.btn-add:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Retro: Pixel button */
[data-theme="retro"] .btn-add {
    border: 4px solid var(--color-white);
    box-shadow:
        4px 4px 0px 0px #257942,
        inset -4px -4px 0px 0px #257942,
        inset 4px 4px 0px 0px #5dde7f;
}

[data-theme="retro"] .btn-add:hover {
    background: #5dde7f;
    transform: none;
}

[data-theme="retro"] .btn-add:active {
    transform: translate(4px, 4px);
    box-shadow:
        0px 0px 0px 0px #257942,
        inset -4px -4px 0px 0px #257942,
        inset 4px 4px 0px 0px #5dde7f;
}

/* Dark: Neon button */
[data-theme="dark"] .btn-add:hover {
    box-shadow: 0 0 20px var(--color-success);
}

/* Terminal: Green button */
[data-theme="terminal"] .btn-add {
    background: transparent;
    color: #00ff00;
    border: 1px solid #00ff00;
}

[data-theme="terminal"] .btn-add:hover {
    background: #00ff00;
    color: #000000;
    box-shadow: 0 0 15px #00ff00;
}

/* Gameboy: Pixel button */
[data-theme="gameboy"] .btn-add {
    background: #9bbc0f;
    color: #0f380f;
    border: 3px solid #0f380f;
    box-shadow: 2px 2px 0px 0px #306230;
}

[data-theme="gameboy"] .btn-add:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Windows 98: 3D button */
[data-theme="win98"] .btn-add {
    background: #c0c0c0;
    color: #000000;
    border: none;
    box-shadow: inset -1px -1px 0px #404040, inset 1px 1px 0px #ffffff, inset -2px -2px 0px #808080, inset 2px 2px 0px #dfdfdf;
}

[data-theme="win98"] .btn-add:active {
    box-shadow: inset 1px 1px 0px #404040, inset -1px -1px 0px #ffffff, inset 2px 2px 0px #808080, inset -2px -2px 0px #dfdfdf;
}

/* Delete Button */
.btn-delete {
    background: transparent;
    color: var(--color-danger);
    padding: 8px;
    font-size: 0;
    border: none;
    opacity: 0.5;
}

.btn-delete:hover {
    opacity: 1;
}

.btn-delete::before {
    content: "\00d7";
    font-size: 20px;
}

/* Retro: Pixel delete */
[data-theme="retro"] .btn-delete:hover {
    text-shadow: 0 0 10px var(--color-danger);
}

/* Dark: Neon delete */
[data-theme="dark"] .btn-delete:hover {
    text-shadow: 0 0 10px var(--color-danger);
}

/* ==========================================================================
   Todo Table
   ========================================================================== */

.todo-table-section {
    min-height: 200px;
    padding: 0;
}

.todo-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
}

.todo-table thead {
    background: var(--color-bg-secondary);
}

.todo-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    border-bottom: var(--border-width) solid var(--color-border);
    white-space: nowrap;
}

.todo-table th.col-num {
    width: 40px;
    text-align: center;
}

.todo-table th.col-todo {
    min-width: 200px;
}

.todo-table th.col-skimming {
    width: 160px;
    min-width: 160px;
    text-align: center;
    white-space: nowrap;
}

.todo-table th.col-estimated {
    width: 70px;
    text-align: center;
}

.todo-table th.col-finish {
    width: 60px;
    text-align: center;
}

.todo-table th.col-actions {
    width: 50px;
}

/* Input Row */
.input-row {
    background: var(--color-bg-secondary);
}

.input-row td {
    padding: 8px;
    border-bottom: var(--border-width) solid var(--color-border);
}

.input-row input,
.input-row textarea {
    width: 100%;
    padding: 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    outline: none;
    transition: all var(--transition);
}

.input-row input:focus,
.input-row textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(var(--color-primary), 0.3);
}

.input-row input::placeholder,
.input-row textarea::placeholder {
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}

/* Textarea specific styles for input row */
.input-row textarea {
    resize: none;
    overflow: hidden;
    min-height: 36px;
    line-height: 1.4;
}

.input-row td.col-skimming {
    white-space: nowrap;
}

.input-row .time-input {
    width: 50px;
    text-align: center;
    padding: 8px 4px;
    display: inline-block;
}

.input-row .time-separator {
    color: var(--color-text-muted);
    margin: 0 2px;
    display: inline-block;
}

.input-row .estimated-input {
    width: 100%;
    text-align: center;
}

.input-row .btn-add {
    padding: 8px 16px;
    font-size: var(--font-size-large);
    font-weight: bold;
    min-width: 40px;
}

/* Table Body Rows */
.todo-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}

.todo-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

.todo-table tbody tr.completed {
    opacity: 0.6;
}

.todo-table tbody td {
    padding: 10px 8px;
    vertical-align: middle;
}

.todo-table tbody td.col-num {
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}

.todo-table tbody td.col-todo {
    word-break: break-word;
}

.todo-table tbody td.col-skimming {
    text-align: center;
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Skimming column inputs inline */
.todo-table td.col-skimming {
    white-space: nowrap !important;
}

.todo-table td.col-skimming .time-input,
.todo-table td.col-skimming .inline-input.time-input {
    display: inline-block !important;
    width: 55px !important;
    min-width: 55px;
    max-width: 55px;
    padding: 4px 2px !important;
    text-align: center;
    font-size: 12px !important;
}

.todo-table td.col-skimming .time-separator {
    display: inline-block !important;
    margin: 0 2px;
    vertical-align: middle;
}

.todo-table tbody td.col-estimated {
    text-align: center;
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
}

.todo-table tbody td.col-finish {
    text-align: center;
}

.todo-table tbody td.col-actions {
    text-align: center;
}

/* Completed Row Styling */
.todo-table tbody tr.completed td.col-todo {
    text-decoration: line-through;
    color: var(--color-completed);
}

/* Always-editable inline inputs in table rows */
.todo-table .inline-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    padding: 4px 6px;
    transition: all var(--transition);
    outline: none;
}

.todo-table .inline-input:hover {
    border-color: var(--color-border);
    background: var(--color-input-bg);
}

.todo-table .inline-input:focus {
    border-color: var(--color-primary);
    background: var(--color-input-bg);
    box-shadow: 0 0 5px rgba(var(--color-primary), 0.3);
}

.todo-table .inline-input.text-input {
    width: 100%;
    resize: none;
    overflow: hidden;
    min-height: 24px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.todo-table .inline-input.time-input {
    width: 50px;
    text-align: center;
    padding: 4px 2px;
}

.todo-table .inline-input.estimated-input {
    width: 55px;
    text-align: center;
}

/* Completed row inline inputs */
.todo-table tbody tr.completed .inline-input {
    text-decoration: line-through;
    color: var(--color-completed);
}

.todo-table tbody tr.completed .inline-input.text-input {
    text-decoration: line-through;
}

.todo-table tbody tr.completed .inline-input.time-input,
.todo-table tbody tr.completed .inline-input.estimated-input {
    text-decoration: none;
}

/* Delete button in table */
.todo-table .btn-delete {
    padding: 4px 8px;
    font-size: var(--font-size-small);
    background: transparent;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    border-radius: var(--border-radius);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition);
}

.todo-table tbody tr:hover .btn-delete {
    opacity: 1;
}

.todo-table .btn-delete:hover {
    background: var(--color-danger);
    color: var(--color-white);
}

/* Edit Input in Table */
.todo-table .todo-edit-input {
    width: 100%;
    padding: 6px 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background: var(--color-input-bg);
    color: var(--color-text);
    border: 2px solid var(--color-warning);
    border-radius: var(--border-radius);
    outline: none;
}

/* Edit mode inline inputs */
.todo-table .edit-time-input {
    width: 50px;
    padding: 4px;
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    background: var(--color-input-bg);
    color: var(--color-text);
    border: 2px solid var(--color-warning);
    border-radius: var(--border-radius);
    text-align: center;
    outline: none;
}

.todo-table .edit-estimated-input {
    width: 60px;
    padding: 4px;
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    background: var(--color-input-bg);
    color: var(--color-text);
    border: 2px solid var(--color-warning);
    border-radius: var(--border-radius);
    text-align: center;
    outline: none;
}

/* Editing row highlight */
.todo-table tbody tr.editing {
    background: rgba(255, 205, 117, 0.1);
}

/* Drag and drop styles for table rows */
.todo-table tbody tr {
    cursor: grab;
}

.todo-table tbody tr:active {
    cursor: grabbing;
}

.todo-table tbody tr.dragging {
    opacity: 0.5;
    background: var(--color-bg-secondary);
}

.todo-table tbody tr.drag-over {
    border-top: 3px solid var(--color-primary);
}

/* Theme-specific drag styles */
[data-theme="retro"] .todo-table tbody tr.drag-over {
    border-top: 4px solid var(--color-secondary);
    box-shadow: 0 -5px 15px rgba(115, 239, 247, 0.3);
}

[data-theme="dark"] .todo-table tbody tr.drag-over {
    border-top: 3px solid var(--neon-cyan);
    box-shadow: 0 -5px 10px rgba(0, 255, 255, 0.3);
}

[data-theme="terminal"] .todo-table tbody tr.drag-over {
    border-top: 2px solid #00ff00;
    box-shadow: 0 -5px 10px rgba(0, 255, 0, 0.3);
}

[data-theme="win98"] .todo-table tbody tr.drag-over {
    border-top: 2px solid #000080;
}

/* Theme-specific inline input styles */
[data-theme="terminal"] .todo-table .inline-input {
    color: #00ff00;
}

[data-theme="terminal"] .todo-table .inline-input:focus {
    border-color: #00ff00;
    background: #000000;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

[data-theme="gameboy"] .todo-table .inline-input {
    color: #0f380f;
}

[data-theme="gameboy"] .todo-table .inline-input:focus {
    border-color: #0f380f;
    background: #9bbc0f;
}

[data-theme="win98"] .todo-table .inline-input:focus {
    background: #ffffff;
    box-shadow: inset 1px 1px 0px #808080;
}

/* Theme-specific table styles */
[data-theme="retro"] .todo-table th {
    border-bottom: 3px dotted var(--color-border);
}

[data-theme="retro"] .input-row input,
[data-theme="retro"] .input-row textarea {
    box-shadow: inset 2px 2px 0px 0px rgba(0,0,0,0.2);
}

/* Retro theme - smaller font and proper wrapping for text-input */
[data-theme="retro"] .todo-table .inline-input.text-input {
    font-size: 12px;
    line-height: 1.4;
    overflow: visible;
    min-height: 20px;
}

[data-theme="retro"] .todo-table td.col-todo {
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="retro"] .todo-table tbody tr:hover {
    background: rgba(65, 166, 246, 0.1);
}

[data-theme="dark"] .todo-table tbody tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

[data-theme="dark"] .input-row input:focus,
[data-theme="dark"] .input-row textarea:focus {
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

[data-theme="terminal"] .todo-table th {
    color: #00ff00;
    border-bottom: 1px solid #00ff00;
}

[data-theme="terminal"] .todo-table tbody tr:hover {
    background: rgba(0, 255, 0, 0.1);
}

[data-theme="terminal"] .input-row input,
[data-theme="terminal"] .input-row textarea {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
}

[data-theme="terminal"] .input-row input::placeholder,
[data-theme="terminal"] .input-row textarea::placeholder {
    color: #008800;
}

[data-theme="terminal"] .input-row input:focus,
[data-theme="terminal"] .input-row textarea:focus {
    box-shadow: 0 0 10px #00ff00;
}

/* Terminal theme - smaller font and proper wrapping */
[data-theme="terminal"] .todo-table .inline-input.text-input {
    font-size: 12px;
    line-height: 1.4;
    overflow: visible;
    min-height: 20px;
}

[data-theme="terminal"] .todo-table td.col-todo {
    max-width: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="gameboy"] .todo-table th {
    border-bottom: 2px solid #0f380f;
}

[data-theme="gameboy"] .input-row input,
[data-theme="gameboy"] .input-row textarea {
    border: 2px solid #0f380f;
    background: #9bbc0f;
    color: #0f380f;
}

[data-theme="gameboy"] .todo-table tbody tr:hover {
    background: #9bbc0f;
}

[data-theme="win98"] .todo-table th {
    background: #c0c0c0;
    border-bottom: 2px solid #808080;
}

[data-theme="win98"] .input-row input,
[data-theme="win98"] .input-row textarea {
    background: #ffffff;
    border: none;
    box-shadow: inset 1px 1px 0px #404040, inset -1px -1px 0px #ffffff, inset 2px 2px 0px #808080;
}

[data-theme="win98"] .todo-table tbody tr:hover {
    background: #000080;
    color: #ffffff;
}

[data-theme="win98"] .todo-table tbody tr:hover td {
    color: #ffffff;
}

/* ==========================================================================
   Todo List (Legacy - keeping for reference)
   ========================================================================== */

.todo-list-section {
    min-height: 200px;
    padding: 8px 0;
    display: none; /* Hidden - using table now */
}

.todo-list {
    list-style: none;
}

/* ==========================================================================
   Todo Item
   ========================================================================== */

.todo-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
    position: relative;
}

.todo-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Retro: Pixel item */
[data-theme="retro"] .todo-item {
    border-bottom: 2px dotted var(--color-border);
}

[data-theme="retro"] .todo-item::before {
    content: "\25B6";
    color: var(--color-warning);
    margin-right: 8px;
    font-size: var(--font-size-small);
    animation: bounce 0.5s infinite alternate;
}

[data-theme="retro"] .todo-item:hover {
    background: rgba(65, 166, 246, 0.1);
}

[data-theme="retro"] .todo-item:hover::before {
    color: var(--color-secondary);
}

[data-theme="retro"] .todo-item.completed::before {
    content: "\2713";
    color: var(--color-success);
    animation: none;
}

/* Dark: Hover glow */
[data-theme="dark"] .todo-item:hover {
    background: rgba(88, 166, 255, 0.05);
}

/* Terminal: Green hover */
[data-theme="terminal"] .todo-item:hover {
    background: rgba(0, 255, 0, 0.1);
}

[data-theme="terminal"] .todo-item::before {
    content: "$ ";
    color: #00ff00;
    margin-right: 8px;
}

/* Gameboy: Pixel hover */
[data-theme="gameboy"] .todo-item:hover {
    background: #9bbc0f;
}

[data-theme="gameboy"] .todo-item::before {
    content: ">";
    color: #0f380f;
    margin-right: 8px;
}

/* Windows 98: List hover */
[data-theme="win98"] .todo-item:hover {
    background: #000080;
    color: #ffffff;
}

[data-theme="win98"] .todo-item:hover .todo-text {
    color: #ffffff;
}

/* ==========================================================================
   Checkbox
   ========================================================================== */

.todo-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-right: 16px;
    background: var(--color-input-bg);
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition);
}

.todo-checkbox:hover {
    border-color: var(--color-secondary);
}

.todo-checkbox:checked {
    background: var(--color-success);
    border-color: var(--color-success);
}

.todo-checkbox:checked::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 6px;
    width: 4px;
    height: 10px;
    border: solid var(--color-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Retro: Pixel checkbox */
[data-theme="retro"] .todo-checkbox {
    border-radius: 0;
    border-width: 3px;
}

[data-theme="retro"] .todo-checkbox:hover {
    box-shadow: 0 0 10px rgba(115, 239, 247, 0.5);
}

/* Dark: Neon checkbox */
[data-theme="dark"] .todo-checkbox:hover {
    box-shadow: 0 0 10px var(--color-primary);
}

/* Terminal: Green checkbox */
[data-theme="terminal"] .todo-checkbox {
    border-color: #00ff00;
    background: #000000;
}

[data-theme="terminal"] .todo-checkbox:checked {
    background: #00ff00;
    border-color: #00ff00;
}

[data-theme="terminal"] .todo-checkbox:hover {
    box-shadow: 0 0 10px #00ff00;
}

/* Gameboy: Pixel checkbox */
[data-theme="gameboy"] .todo-checkbox {
    border: 3px solid #0f380f;
    border-radius: 0;
}

[data-theme="gameboy"] .todo-checkbox:checked {
    background: #0f380f;
}

/* Windows 98: 3D checkbox */
[data-theme="win98"] .todo-checkbox {
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: inset 1px 1px 0px #404040, inset -1px -1px 0px #ffffff, inset 2px 2px 0px #808080;
}

[data-theme="win98"] .todo-checkbox:checked {
    background: #ffffff;
}

[data-theme="win98"] .todo-checkbox:checked::after {
    border-color: #000000;
}

/* ==========================================================================
   Todo Text
   ========================================================================== */

.todo-text {
    flex: 1;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    word-break: break-word;
    cursor: pointer;
    line-height: 1.6;
    transition: color var(--transition);
}

.todo-text:hover {
    color: var(--color-primary);
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--color-completed);
}

/* Retro: Hover glow */
[data-theme="retro"] .todo-text:hover {
    color: var(--color-secondary);
    text-shadow: 0 0 10px rgba(115, 239, 247, 0.5);
}

/* Dark: Neon hover */
[data-theme="dark"] .todo-text:hover {
    text-shadow: 0 0 5px var(--color-primary);
}

/* ==========================================================================
   Edit Input
   ========================================================================== */

.todo-edit-input {
    flex: 1;
    padding: 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background: var(--color-input-bg);
    color: var(--color-text);
    border: 2px solid var(--color-warning);
    border-radius: var(--border-radius);
    outline: none;
    transition: all var(--transition);
}

/* Retro: Pixel edit */
[data-theme="retro"] .todo-edit-input {
    border-width: 3px;
    box-shadow: 0 0 15px rgba(255, 205, 117, 0.3);
}

/* Terminal: Green edit */
[data-theme="terminal"] .todo-edit-input {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Gameboy: Pixel edit */
[data-theme="gameboy"] .todo-edit-input {
    border: 3px solid #0f380f;
    background: #9bbc0f;
    color: #0f380f;
}

/* Windows 98: Sunken edit */
[data-theme="win98"] .todo-edit-input {
    background: #ffffff;
    border: none;
    color: #000000;
    box-shadow: inset 1px 1px 0px #404040, inset -1px -1px 0px #ffffff, inset 2px 2px 0px #808080;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--color-text-muted);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    gap: 16px;
    text-align: center;
    line-height: 1.8;
}

.empty-state::before {
    content: "\2714";
    font-size: 48px;
    opacity: 0.3;
}

/* Retro: Game style empty */
[data-theme="retro"] .empty-state::before {
    content: "\1F3AE";
    animation: float 2s ease-in-out infinite;
}

/* Dark: Neon empty */
[data-theme="dark"] .empty-state::before {
    content: "\1F31F";
}

/* Terminal: Hacker empty */
[data-theme="terminal"] .empty-state::before {
    content: "[ ]";
    font-size: 24px;
    color: #00ff00;
}

[data-theme="terminal"] .empty-state {
    color: #00ff00;
}

/* Gameboy: Pixel empty */
[data-theme="gameboy"] .empty-state::before {
    content: "...";
    font-size: 24px;
}

/* Windows 98: Classic empty */
[data-theme="win98"] .empty-state::before {
    content: "\1F4C1";
    font-size: 32px;
}

.empty-state.hidden {
    display: none;
}

/* ==========================================================================
   Todo Stats
   ========================================================================== */

.todo-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px 24px;
    background: var(--color-bg-secondary);
    border-top: var(--border-width) solid var(--color-border);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-size-small);
}

.todo-stats span {
    padding: 8px 16px;
    background: var(--color-card-bg);
    border-radius: var(--border-radius);
    transition: all var(--transition);
}

#total-count {
    color: var(--color-warning);
}

#completed-count {
    color: var(--color-success);
}

#pending-count {
    color: var(--color-primary);
}

/* Retro: Pixel stats */
[data-theme="retro"] .todo-stats {
    border-top: 4px solid var(--color-border);
    font-size: 9px;
}

[data-theme="retro"] .todo-stats span {
    border: 2px solid var(--color-dark);
    padding: 6px 10px;
}

[data-theme="retro"] #total-count::before { content: "\1F4CA "; }
[data-theme="retro"] #completed-count::before { content: "\2B50 "; }
[data-theme="retro"] #pending-count::before { content: "\2694\FE0F "; }

/* Terminal: Green stats */
[data-theme="terminal"] .todo-stats {
    background: #0a0a0a;
    border-top: 1px solid #00ff00;
}

[data-theme="terminal"] .todo-stats span {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
}

/* Gameboy: Pixel stats */
[data-theme="gameboy"] .todo-stats {
    background: #8bac0f;
    border-top: 3px solid #0f380f;
}

[data-theme="gameboy"] .todo-stats span {
    background: #9bbc0f;
    border: 2px solid #0f380f;
    color: #0f380f;
}

/* Windows 98: Classic stats */
[data-theme="win98"] .todo-stats {
    background: #c0c0c0;
    border-top: none;
    box-shadow: inset 0 1px 0 #808080;
}

[data-theme="win98"] .todo-stats span {
    background: #c0c0c0;
    box-shadow: inset 1px 1px 0px #808080, inset -1px -1px 0px #ffffff;
    color: #000000;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes rainbow {
    0%, 100% { color: var(--color-warning); }
    33% { color: var(--color-secondary); }
    66% { color: #e06f8b; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes bounce {
    from { transform: translateX(0); }
    to { transform: translateX(4px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Power-up Animation for new items */
.todo-item {
    animation: powerUp 0.3s ease-out;
}

@keyframes powerUp {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Editing state */
.todo-item.editing {
    background: rgba(255, 205, 117, 0.1);
}

[data-theme="retro"] .todo-item.editing {
    box-shadow: inset 0 0 20px rgba(255, 205, 117, 0.2);
}

/* ==========================================================================
   Drag and Drop Styles
   ========================================================================== */

.todo-item {
    cursor: grab;
}

.todo-item:active {
    cursor: grabbing;
}

.todo-item.dragging {
    opacity: 0.5;
    background: var(--color-bg-secondary);
}

.todo-item.drag-over {
    border-top: 3px solid var(--color-primary);
    padding-top: 13px;
}

/* Theme-specific drag styles */
[data-theme="retro"] .todo-item.drag-over {
    border-top: 4px solid var(--color-secondary);
    box-shadow: 0 0 15px rgba(115, 239, 247, 0.5);
}

[data-theme="dark"] .todo-item.drag-over {
    border-top: 3px solid var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

[data-theme="terminal"] .todo-item.drag-over {
    border-top: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

[data-theme="win98"] .todo-item.drag-over {
    border-top: 2px solid #000080;
    background: #c0c0c0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .app-header h1 {
        font-size: calc(var(--font-size-title) * 0.8);
    }

    .todo-form {
        flex-direction: column;
    }

    .btn-add {
        width: 100%;
    }

    .todo-stats {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        text-align: center;
    }

    .theme-selector {
        gap: 4px;
    }

    .theme-btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    [data-theme="retro"] .todo-item::before {
        display: none;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn:focus-visible,
.todo-input:focus-visible,
.todo-checkbox:focus-visible,
.theme-btn:focus-visible {
    outline: 3px solid var(--color-warning);
    outline-offset: 2px;
}

/* Dark theme focus adjustment */
[data-theme="dark"] .btn:focus-visible,
[data-theme="dark"] .todo-input:focus-visible,
[data-theme="dark"] .todo-checkbox:focus-visible,
[data-theme="dark"] .theme-btn:focus-visible {
    outline-color: var(--neon-cyan);
}

/* ==========================================================================
   History Section
   ========================================================================== */

.history-toggle-section {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px dashed var(--color-border);
}

.btn-history {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-small);
    transition: all var(--transition);
}

.btn-history:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(var(--color-primary), 0.05);
}

.history-icon {
    font-size: 16px;
}

.history-count {
    opacity: 0.7;
}

/* Theme-specific history button */
[data-theme="retro"] .btn-history {
    border: 2px dashed var(--color-border);
}

[data-theme="retro"] .btn-history:hover {
    box-shadow: 0 0 10px rgba(115, 239, 247, 0.3);
}

[data-theme="terminal"] .btn-history {
    border: 1px dashed #00ff00;
    color: #008800;
}

[data-theme="terminal"] .btn-history:hover {
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

[data-theme="win98"] .btn-history {
    background: #c0c0c0;
    border: none;
    box-shadow: inset -1px -1px 0px #404040, inset 1px 1px 0px #ffffff;
    color: #000000;
}

/* ==========================================================================
   History Modal
   ========================================================================== */

.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.history-modal.hidden {
    display: none;
}

.history-modal-content {
    background: var(--color-card-bg);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: var(--border-width) solid var(--color-border);
    background: var(--color-bg-secondary);
}

.history-modal-header h2 {
    font-family: var(--font-family);
    font-size: var(--font-size-large);
    color: var(--color-primary);
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    transition: color var(--transition);
}

.btn-close:hover {
    color: var(--color-danger);
}

.history-stats {
    padding: 12px 24px;
    background: var(--color-bg-secondary);
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    display: flex;
    justify-content: space-around;
    border-bottom: 1px solid var(--color-border);
}

.history-stats span {
    padding: 4px 8px;
}

.history-list {
    overflow-y: auto;
    padding: 16px 0;
    flex: 1;
}

/* Date Group */
.history-date-group {
    margin-bottom: 16px;
}

.history-date-header {
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    color: var(--color-primary);
    padding: 8px 24px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--color-border);
    gap: 12px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item-text {
    flex: 1;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-completed);
    text-decoration: line-through;
    word-break: break-word;
}

.history-item-time {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.btn-restore {
    background: transparent;
    color: var(--color-success);
    border: 1px solid var(--color-success);
    padding: 4px 8px;
    font-size: var(--font-size-small);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-restore:hover {
    background: var(--color-success);
    color: var(--color-white);
}

/* History Empty State */
.history-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}

.history-empty::before {
    content: "📭";
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Theme-specific modal styles */
[data-theme="retro"] .history-modal-content {
    box-shadow: 8px 8px 0px 0px var(--color-dark);
}

[data-theme="retro"] .history-modal-header h2 {
    color: var(--color-warning);
}

[data-theme="terminal"] .history-modal-content {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

[data-theme="terminal"] .history-modal-header h2 {
    color: #00ff00;
}

[data-theme="terminal"] .history-modal-header h2::before {
    content: "> ";
}

[data-theme="win98"] .history-modal-content {
    border: none;
    box-shadow: inset -1px -1px 0px #404040, inset 1px 1px 0px #ffffff, inset -2px -2px 0px #808080, inset 2px 2px 0px #dfdfdf;
}

[data-theme="win98"] .history-modal-header {
    background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
}

[data-theme="win98"] .history-modal-header h2 {
    color: #ffffff;
    font-size: 14px;
}

[data-theme="win98"] .btn-close {
    background: #c0c0c0;
    color: #000000;
    font-size: 14px;
    padding: 2px 6px;
    box-shadow: inset -1px -1px 0px #404040, inset 1px 1px 0px #ffffff;
}
