/* Premium Font Import is now in index.html */

:root {
    --bg-app: #f4f4f7; /* Studio Gray */
    --card-main: #1C1C1E; 
    --card-inner: #252528; 
    --border-inner: rgba(255, 255, 255, 0.08); 
    --text-muted: #A1A1AA;
    --radius-outer: 32px;
    --radius-inner: 16px;
    --accent-blue: #3b82f6;
}

html {
    scroll-behavior: smooth;
}

body {
    background: 
        radial-gradient(circle at 50% 0%, #ffffff 0%, var(--bg-app) 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Cfilter id='noiseFilter'%3%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3%3C/filter%3%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3%3C/svg%3");
    background-blend-mode: overlay;
    background-attachment: fixed;
    font-family: 'Evolventa', sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Natural Header Layout */
header {
    background: transparent;
    padding-top: 80px; 
    padding-bottom: 60px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

#headerRow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    gap: 20px;
}

#categoriesContainer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100vw;
    justify-content: flex-start;
}

#categoriesContainer::-webkit-scrollbar {
    display: none;
}

/* Side fades for scrollable categories on mobile */
#headerRow::after, #headerRow::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 5;
    pointer-events: none;
    display: none;
}

@media (max-width: 768px) {
    #headerRow::after {
        display: block;
        right: 0;
        background: linear-gradient(to left, var(--bg-app), transparent);
    }
    #headerRow::before {
        display: block;
        left: 0;
        background: linear-gradient(to right, var(--bg-app), transparent);
    }
    #categoriesContainer {
        justify-content: flex-start;
    }
}

@media (min-width: 769px) {
    #categoriesContainer {
        justify-content: center;
        width: auto;
        flex-wrap: wrap;
    }
}

/* Premium Main Card */
.premium-card {
    background-color: var(--card-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 
        inset 0 1px 0 var(--border-inner),
        0 40px 100px rgba(0, 0, 0, 0.45);   
    border-radius: var(--radius-outer);
    padding: 60px;
    width: 100%;
    min-height: 650px;
    max-width: 900px;
    position: relative;
    z-index: 10;
    margin-bottom: 5rem;
    overflow: hidden;
}

@media (max-width: 640px) {
    header {
        padding-top: 40px;
        padding-bottom: 30px;
    }
    .premium-card {
        padding: 24px;
        border-radius: 24px;
    }
    .premium-modal {
        padding: 24px !important;
        border-radius: 24px !important;
    }
    .task-strike-line {
        left: -20px;
        right: -20px;
    }
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--card-bg, none);
    background-size: cover;
    background-position: center;
    opacity: var(--bg-opacity, 0); /* Controlled by JS for smooth fade-in */
    filter: brightness(0.6) grayscale(1) contrast(1.1) brightness(0.7) blur(1px);
    z-index: 1;
    pointer-events: none;
    transition: opacity 1s ease; /* Longer transition for a premium feel */
}

/* Inner Block Area */
.inner-block {
    background-color: transparent; /* Let card bg show through slightly */
    position: relative;
    z-index: 2;
    margin-top: 10px;
}

/* Task Row for Full Strike */
.task-row-container {
    position: relative;
    width: 100%;
}

.task-strike-line {
    position: absolute;
    top: 14px; /* Perfectly centered for 16px font */
    left: -32px;
    right: -32px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 40;
    pointer-events: none;
}

.task-row--completed .task-strike-line {
    transform: scaleX(1);
}

.task-row--completed .task-content-inner {
    opacity: 0.3;
}

/* Expensive Modal Design */
.premium-modal {
    background: radial-gradient(circle at top left, rgba(45, 45, 50, 0.8), rgba(28, 28, 30, 0.95)) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 
        0 50px 120px rgba(0, 0, 0, 0.9),
        inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

.input-expensive {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.input-expensive:focus {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05) !important;
}

/* Custom Checkbox on the Right */
.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(255, 255, 255, 0.05);
}

.custom-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
}

.custom-checkbox.checked {
    background: #fff;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.custom-checkbox.checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 7px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Premium Links & Media */
.task-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.task-link-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-link-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.video-preview-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    margin-top: 30px;
    border-radius: 24px;
    overflow: hidden;
    background: #000;
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.video-preview-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
}

.video-preview-container:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.15);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

.video-play-button svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-left: 4px;
}

.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.video-preview-container:hover .video-cover {
    opacity: 0.8;
}

/* Category Icons */
.cat-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cat-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2.5;
}

.footer-icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    background: var(--card-inner);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.footer-icon svg {
    width: 20px;
    height: 20px;
}

/* Board Layout & Transitions */
#tasksBoard {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-bottom: 120px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.board-animate-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}

/* Control Hub (Fused Buttons) */
.control-hub {
    display: flex;
    background: #ffffff;
    border: 1px solid #f3f3f3;
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.control-hub:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #94a3b8;
}

.control-btn:hover {
    background: #f8fafc;
    color: #000;
}

.control-btn.active {
    background: #000;
    color: #fff;
}

/* Category Manage UI */
.category-item {
    position: relative;
    /* overflow: visible !important; */
}

.category-tools {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 50;
}

.management-mode .category-tools {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.tool-mini-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.tool-mini-btn:hover {
    transform: scale(1.15);
}

.tool-mini-btn.delete:hover {
    background: #ef4444;
}

/* Modals Overlay */
.fixed.inset-0 { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}
.overlay-hidden { pointer-events: none; }
.modal-open { opacity: 1 !important; pointer-events: auto !important; }
.modal-open > div { transform: scale(1) !important; opacity: 1 !important; }

/* Custom Scrollbar for list container */
.no-scrollbar::-webkit-scrollbar { display: none; }

.bg-app-premium {
    background: 
        radial-gradient(circle at 50% 0%, #ffffff 0%, var(--bg-app) 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-blend-mode: overlay;
    background-attachment: fixed;
}
/* Custom Dropdown Styling */
#dropdownOptions.dropdown-visible {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.dropdown-option {
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #a1a1aa;
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(4px);
}

.dropdown-option.selected {
    background: linear-gradient(to right, #f43f5e, #fb7185);
    color: #fff;
    box-shadow: 0 10px 20px rgba(244, 63, 94, 0.2);
}

.dropdown-option .check-icon {
    display: none;
}

.dropdown-option.selected .check-icon {
    display: block;
}

footer {
    position: relative;
    z-index: 5;
}
