/* CSS Variables & Design System */
:root {
    --bg-dark: #000000;
    --bg-gradient: radial-gradient(circle at top left, #111111 0%, #000000 100%);

    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.05);

    --primary-accent: #ff6a00;
    --secondary-accent: #ff9d00;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);

    --font-family: 'Outfit', sans-serif;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    position: relative;
    line-height: 1.6;
}

/* Dynamic Background */
.background-gradients {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-gradient);
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-accent);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-accent);
    bottom: -50px;
    right: -50px;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h1 {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, var(--primary-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    font-size: 1.5rem;
}

.date-display {
    font-weight: 300;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 0;
    /* Important for scroll */
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.icon-btn {
    background: var(--glass-highlight);
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--primary-accent);
    transform: rotate(90deg);
}

.task-input-container {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.task-input-container.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#new-task-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    font-family: inherit;
}

#new-task-input:focus {
    outline: none;
    border-color: var(--primary-accent);
}

.primary-btn {
    background: var(--primary-accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.primary-btn:hover {
    filter: brightness(1.2);
}

/* Task List */
.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    /* padding for focus outline/shadows */
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.task-list::-webkit-scrollbar {
    width: 4px;
}

.task-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 2rem;
    font-style: italic;
}

.task-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: grab;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-card:hover {
    background: rgba(255, 106, 0, 0.08);
    border-color: var(--glass-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.task-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.5;
    border: 1px dashed var(--text-muted);
}

.delete-task-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0 4px;
}

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

.delete-task-btn:hover {
    color: var(--secondary-accent);
}

/* Timeline */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.timeline-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.timeline-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.timeline-scroll-area::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    /* Gap for separator lines */
}

.time-slot {
    display: grid;
    grid-template-columns: 80px 1fr;
    min-height: 80px;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s;
}

.time-slot:last-child {
    border-bottom: none;
}

.time-slot:hover {
    background: rgba(255, 255, 255, 0.02);
}

.time-label {
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: right;
}

.slot-content {
    padding: 0.5rem;
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drag-over {
    background: rgba(255, 106, 0, 0.15) !important;
    box-shadow: inset 0 0 10px rgba(255, 106, 0, 0.2) !important;
}

/* Responsive */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 400px 1fr;
    }
}