/* ===== RESET & CUSTOM PROPERTIES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme palette */
    --bg-primary: #070600;
    --bg-secondary: #0e0e0c;
    --bg-card: rgba(12, 12, 10, 0.72);
    --bg-card-solid: #121210;
    --bg-hover: rgba(20, 20, 18, 0.85);
    --bg-input: rgba(10, 10, 8, 0.75);

    /* Text */
    --text-primary: #f7f7ff;
    --text-secondary: #a8b0c4;
    --text-tertiary: #5c6278;
    --text-muted: #3a3f50;

    /* Accent gradients */
    --accent-1: #279af1;
    /* Bright blue */
    --accent-2: #23b5d3;
    /* Teal */
    --accent-3: #ea526f;
    /* Coral pink */
    --accent-4: #1e7ed4;
    /* Deeper blue */

    /* Functional colors */
    --study-accent: #ea526f;
    --study-accent-light: rgba(234, 82, 111, 0.12);
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.12);
    --danger: #ea526f;
    --danger-light: rgba(234, 82, 111, 0.12);
    --warning: #23b5d3;

    /* Borders & Glass */
    --border: rgba(247, 247, 255, 0.06);
    --border-hover: rgba(247, 247, 255, 0.14);
    --glass-bg: rgba(247, 247, 255, 0.03);
    --glass-border: rgba(247, 247, 255, 0.08);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 40px rgba(39, 154, 241, 0.18);
    --shadow-glow-study: 0 0 40px rgba(234, 82, 111, 0.12);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== ANIMATED BACKGROUND ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem 0;
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(39, 154, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(35, 181, 211, 0.10), transparent),
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(234, 82, 111, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 64px 64px;
    pointer-events: none;
    z-index: 0;
}

.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(39, 154, 241, 0.3), transparent 70%);
    top: -100px;
    right: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(35, 181, 211, 0.25), transparent 70%);
    bottom: -50px;
    left: -50px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(234, 82, 111, 0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-40px, 60px) scale(1.1);
    }

    66% {
        transform: translate(30px, -30px) scale(0.95);
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -40px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 30px) scale(0.9);
    }
}

@keyframes orbFloat3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-40%, -60%) scale(1.15);
    }
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    animation: pageEnter 0.8s var(--ease-smooth) both;
    width: 100%;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER ===== */
header {
    margin-bottom: 3rem;
    animation: fadeSlideDown 0.8s var(--ease-smooth) 0.1s both;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, rgba(39, 154, 241, 0.15), rgba(35, 181, 211, 0.10));
    border: 1px solid rgba(39, 154, 241, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s var(--ease-spring);
}

.logo-icon:hover {
    transform: rotate(-8deg) scale(1.05);
    border-color: var(--accent-1);
    box-shadow: 0 0 24px rgba(39, 154, 241, 0.25);
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, var(--accent-2) 50%, var(--accent-1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    margin-top: 0.15rem;
}

/* ===== LAYOUT ===== */
.layout-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 720px;
    width: 100%;
}

.side-panel {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    animation: slideInRight 0.8s var(--ease-smooth) 0.3s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(32px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== GLASSMORPHISM CARD BASE ===== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ===== INPUT SECTION ===== */
.input-section {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    animation: slideInUp 0.6s var(--ease-smooth) 0.15s both;
    position: relative;
    overflow: hidden;
}

.input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(39, 154, 241, 0.35), transparent);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.input-section-icon {
    font-size: 1rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-wrapper {
    position: relative;
}

input[type="text"] {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.35s var(--ease-smooth);
    outline: none;
    width: 100%;
    box-shadow: none;
}

input[type="text"]:focus {
    border-color: var(--accent-1);
    background: rgba(12, 12, 10, 0.92);
    box-shadow: 0 0 0 3px rgba(39, 154, 241, 0.12), 0 4px 16px rgba(0, 0, 0, 0.35);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

.input-glow {
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.35s ease;
    filter: blur(8px);
}

input[type="text"]:focus~.input-glow {
    opacity: 0.15;
}

/* ===== CHECKBOX ===== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.custom-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--text-muted);
    border-radius: 6px;
    background: transparent;
    transition: all 0.3s var(--ease-spring);
    cursor: pointer;
}

.custom-checkbox input:checked~.checkmark {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(39, 154, 241, 0.3);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.study-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    background: var(--study-accent-light);
    color: var(--study-accent);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(234, 82, 111, 0.15);
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--study-accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* ===== BUTTONS ===== */
.button-group {
    display: flex;
    gap: 0.75rem;
}

button {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.35s var(--ease-spring);
    outline: none;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-4), var(--accent-2));
    color: white;
    box-shadow: 0 4px 16px rgba(39, 154, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(39, 154, 241, 0.4);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    font-size: 1.2rem;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.btn-primary span:last-child {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ===== TASKS SECTION ===== */
.tasks-section {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    animation: slideInUp 0.6s var(--ease-smooth) 0.25s both;
    position: relative;
    overflow: hidden;
}

.tasks-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(35, 181, 211, 0.25), transparent);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title-icon {
    font-size: 1.1rem;
}

.task-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 100px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* ===== TASK ITEM ===== */
.task-item {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.35s var(--ease-smooth);
    animation: taskAppear 0.5s var(--ease-spring) both;
    position: relative;
    overflow: hidden;
}

@keyframes taskAppear {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-1), var(--accent-3));
    opacity: 0;
    transition: opacity 0.35s ease;
    border-radius: 0 2px 2px 0;
}

.task-item.study-task::before {
    background: linear-gradient(180deg, var(--study-accent), #ef4444);
}

.task-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.task-item:hover::before {
    opacity: 1;
}

.task-item.completed {
    opacity: 0.55;
}

.task-item.editing {
    background: rgba(39, 154, 241, 0.06);
    border-color: rgba(39, 154, 241, 0.2);
}

.task-item.editing::before {
    opacity: 1;
}

/* ===== TASK EDIT ===== */
.task-edit-input {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--accent-1);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: none;
}

.task-edit-input:focus {
    box-shadow: 0 0 0 3px rgba(39, 154, 241, 0.12);
}

.task-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-small {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    border: none;
    outline: none;
}

.btn-save {
    background: linear-gradient(135deg, var(--accent-4), var(--accent-2));
    color: white;
}

.btn-save:hover {
    box-shadow: 0 4px 12px rgba(39, 154, 241, 0.3);
    transform: translateY(-1px);
}

.btn-cancel {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-cancel:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* ===== TASK CHECKBOX ===== */
.task-checkbox {
    flex-shrink: 0;
    padding: 0.25rem;
    margin: -0.25rem;
}

.task-checkbox .checkmark {
    border-color: var(--accent-1);
    border-radius: 50%;
    width: 22px;
    height: 22px;
}

.task-item.study-task .task-checkbox .checkmark {
    border-color: var(--study-accent);
}

.task-checkbox input:checked~.checkmark {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    border-color: transparent;
}

.task-item.study-task .task-checkbox input:checked~.checkmark {
    background: linear-gradient(135deg, var(--study-accent), #d4304c);
    border-color: transparent;
}

/* ===== TASK CONTENT ===== */
.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.task-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-weight: 450;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-tertiary);
    font-weight: 400;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.task-date {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.task-date::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-1);
    opacity: 0.5;
}

.repetition-info {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: rgba(39, 154, 241, 0.1);
    color: var(--accent-1);
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid rgba(39, 154, 241, 0.15);
}

.task-item.study-task .repetition-info {
    background: var(--study-accent-light);
    color: var(--study-accent);
    border-color: rgba(234, 82, 111, 0.15);
}

/* ===== TASK ACTIONS ===== */
.task-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.icon-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    padding: 0;
    font-size: 0.95rem;
    color: var(--text-tertiary);
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
    transform: scale(1.08);
}

.icon-btn.edit:hover {
    background: rgba(35, 181, 211, 0.1);
    border-color: rgba(35, 181, 211, 0.3);
    color: var(--study-accent);
}

.icon-btn.delete:hover {
    background: var(--danger-light);
    border-color: rgba(234, 82, 111, 0.3);
    color: var(--danger);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-tertiary);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.35;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.empty-state-text {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ===== SIDE PANEL ===== */
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md), var(--shadow-glow-study);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(234, 82, 111, 0.25), transparent);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.refresh-btn {
    width: 38px;
    height: fit-content;
    min-width: 38px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    padding: 0;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.refresh-btn:hover {
    background: transparent;
    border-color: transparent;
    color: var(--study-accent);
    transform: rotate(90deg);
}

.refresh-btn:active {
    transform: rotate(180deg);
}

.refresh-btn.spinning {
    animation: spin 0.6s var(--ease-smooth);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.panel-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(234, 82, 111, 0.12), rgba(213, 48, 76, 0.08));
    border: 1px solid rgba(234, 82, 111, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.panel-title-group {
    flex: 1;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.panel-subtitle {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ===== TODAY TASKS LIST ===== */
.today-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.today-task-item {
    padding: 0.9rem;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--study-accent);
    transition: all 0.3s var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--study-accent);
}

.today-task-item.completed {
    opacity: 0.5;
}

.today-task-item.completed .today-task-text {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.today-task-checkbox {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.today-task-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.today-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--study-accent);
    border-radius: 5px;
    background: transparent;
    transition: all 0.3s var(--ease-spring);
    display: flex;
    align-items: center;
    justify-content: center;
}

.today-task-checkbox input:checked~.today-checkmark {
    background: linear-gradient(135deg, var(--study-accent), #ef4444);
    border-color: transparent;
}

.today-task-checkbox input:checked~.today-checkmark::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: bold;
}

.today-task-content {
    flex: 1;
    cursor: pointer;
}

.today-task-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.today-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.today-task-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.today-task-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    background: var(--study-accent-light);
    color: var(--study-accent);
    border-radius: 100px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 0.5rem;
    border: 1px solid rgba(234, 82, 111, 0.15);
}

.today-task-time {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.today-task-time::before {
    content: '🕐';
    font-size: 0.8rem;
}

.empty-today {
    text-align: center;
    padding: 2rem 0.75rem;
    color: var(--text-tertiary);
}

.empty-today-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

.empty-today-text {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: center;
    padding: 0.85rem 0.6rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease-spring);
}

.stat-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 0.2rem;
    transition: all 0.3s var(--ease-spring);
}

.stat-item:hover .stat-number {
    transform: scale(1.08);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* ===== PROGRESS ===== */
.progress-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-4), var(--accent-2), var(--study-accent));
    background-size: 200% 100%;
    border-radius: 100px;
    transition: width 0.6s var(--ease-smooth);
    width: 0%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-text {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1024px) {
    .layout-wrapper {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }

    .side-panel {
        width: 100%;
        max-width: 720px;
        position: static;
        order: -1;
    }

    .main-content {
        width: 100%;
    }

    .panel-card {
        margin-bottom: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 640px) {
    body {
        padding: 1rem 0;
    }

    .container {
        max-width: 100%;
        padding: 0 0.75rem;
    }

    h1 {
        font-size: 1.7rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    header {
        margin-bottom: 1.75rem;
    }

    .logo-icon {
        width: 42px;
        height: 42px;
    }

    .logo-icon svg {
        width: 24px;
        height: 24px;
    }

    .layout-wrapper {
        gap: 1.25rem;
    }

    .side-panel {
        margin-bottom: 0;
    }

    .panel-card {
        padding: 1.15rem;
        border-radius: var(--radius-md);
    }

    .panel-header {
        margin-bottom: 0.9rem;
        padding-bottom: 0.8rem;
    }

    .panel-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .panel-title {
        font-size: 1rem;
    }

    .panel-subtitle {
        font-size: 0.72rem;
    }

    .today-task-item {
        padding: 0.8rem;
        gap: 0.5rem;
    }

    .today-task-checkbox {
        width: 16px;
        height: 16px;
    }

    .today-checkmark {
        width: 16px;
        height: 16px;
    }

    .today-task-checkbox input:checked~.today-checkmark::after {
        font-size: 10px;
    }

    .today-task-text {
        font-size: 0.82rem;
        -webkit-line-clamp: 3;
    }

    .today-task-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }

    .today-task-time {
        font-size: 0.68rem;
    }

    .stats-grid {
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .stat-item {
        padding: 0.6rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .empty-today {
        padding: 1.5rem 0.5rem;
    }

    .empty-today-icon {
        font-size: 1.8rem;
    }

    .empty-today-text {
        font-size: 0.78rem;
    }

    .input-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
        border-radius: var(--radius-md);
    }

    input[type="text"] {
        font-size: 0.92rem;
        padding: 0.85rem 1rem;
    }

    .checkbox-label {
        font-size: 0.85rem;
    }

    .study-badge {
        font-size: 0.65rem;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        padding: 0.85rem 1.25rem;
        font-size: 0.88rem;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .task-count {
        font-size: 0.72rem;
    }

    .task-item {
        padding: 0.95rem 1rem;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .task-content {
        width: 100%;
    }

    .task-text {
        font-size: 0.9rem;
    }

    .task-meta {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .task-date {
        font-size: 0.75rem;
    }

    .repetition-info {
        font-size: 0.65rem;
        padding: 0.15rem 0.45rem;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.15rem;
        opacity: 1;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }

    .task-edit-input {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .task-edit-actions {
        flex-wrap: wrap;
    }

    .btn-small {
        flex: 1;
        min-width: 80px;
    }

    .empty-state {
        padding: 2.5rem 1rem;
    }

    .empty-state-icon {
        font-size: 2rem;
    }

    .empty-state-text {
        font-size: 0.88rem;
    }

    .tasks-section {
        border-radius: var(--radius-lg);
        padding: 1.25rem;
    }

    .orb-1,
    .orb-2,
    .orb-3 {
        opacity: 0.25;
    }

    .input-section-title {
        font-size: 0.75rem;
    }
}

/* ===== RESPONSIVE: TABLET RANGE ===== */
@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    .input-section {
        padding: 1.5rem;
    }

    .task-item {
        padding: 1rem 1.15rem;
    }

    .panel-card {
        padding: 1.35rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .main-content {
        max-width: 100%;
    }

    .side-panel {
        max-width: 100%;
    }
}

/* ===== RESPONSIVE: SMALL PHONE ===== */
@media (max-width: 380px) {
    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
    }

    .logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .input-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .task-item {
        padding: 0.85rem;
        border-radius: 10px;
    }

    .icon-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        font-size: 0.85rem;
    }

    .panel-card {
        padding: 1rem;
    }

    .panel-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .panel-title {
        font-size: 0.95rem;
    }

    .today-task-item {
        padding: 0.7rem;
    }

    .today-task-text {
        font-size: 0.78rem;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .task-item:hover {
        transform: none;
        box-shadow: none;
    }

    .task-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .today-task-item:hover {
        transform: none;
        background: var(--glass-bg);
    }

    .today-task-content:active {
        transform: scale(0.98);
    }

    .icon-btn:hover {
        transform: none;
    }

    .icon-btn:active {
        transform: scale(0.92);
    }

    button:hover {
        transform: none;
    }

    button:active {
        transform: scale(0.97);
    }

    input[type="text"]:focus {
        transform: none;
    }

    .stat-item:hover .stat-number {
        transform: none;
    }

    .stat-item:hover {
        transform: none;
    }

    .task-actions {
        opacity: 1;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .orb {
        display: none;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 1rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    header {
        margin-bottom: 1.25rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .side-panel {
        position: static;
    }

    .layout-wrapper {
        gap: 1rem;
    }

    .input-section {
        padding: 1rem;
    }

    .panel-card {
        padding: 1rem;
    }

    .task-item {
        padding: 0.8rem 1rem;
    }
}

/* ===== PRINT ===== */
@media print {
    body {
        background: white;
        color: black;
    }

    .bg-gradient,
    .bg-grid,
    .bg-orbs,
    .input-section,
    .task-actions,
    .side-panel {
        display: none;
    }

    .task-item {
        break-inside: avoid;
        page-break-inside: avoid;
        background: white;
        border: 1px solid #ddd;
    }

    .tasks-section {
        background: white;
        border: 1px solid #ddd;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(39, 154, 241, 0.3);
    color: white;
}
