/* ============================================================
   GLOBAL BASE
============================================================ */

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    /* Light gray hatched background pattern */
    background-color: #f0f0f0;
    background-image: repeating-linear-gradient(45deg,
            #e0e0e0 0px,
            #e0e0e0 1px,
            #f0f0f0 1px,
            #f0f0f0 10px);
    color: #000;
}

* {
    box-sizing: border-box;
}


/* ============================================================
   16-WEEKS OVERZICHT — 4x4 CARD SYSTEM
============================================================ */

#weeks-overview {
    max-width: 1800px;
    margin: 10px auto;
    padding: 0 20px;
}

#weeks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 3px solid #000;
    padding-bottom: 5px;
    background: #fff;
    /* Ensure readability over pattern */
    padding: 10px;
    border: 3px solid #000;
}

#weeks-header h2 {
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.week-card-preview-item {
    margin-bottom: 4px;
    padding: 4px;
    background: #f7f7f7;
    border: 2px solid #000;
    flex: 0 0 auto;
}

.week-card-preview-item:last-child {
    margin-bottom: 0;
}

.week-card-preview-label {
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
}

.week-card-preview-content {
    font-size: 11px;
    line-height: 1.3;
}

.week-card-preview-content ul {
    margin: 2px 0 0 0;
    padding-left: 14px;
}

.week-card-preview-content li {
    margin-bottom: 1px;
}

/* Tools preview styling */
.week-card-preview-item[data-type="tools"] {
    background: #cfe6ff;
}

/* Theory preview styling */
.week-card-preview-item[data-type="theory"] {
    background: #e0f0ff;
}

/* Expandable section */
.week-card-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 3px solid #000;
    background: #fff;
}

.week-card.expanded .week-card-expanded {
    max-height: 2000px;
}

.week-card-expanded-content {
    padding: 16px;
    font-size: 12px;
}

.week-card-expanded-content h3 {
    margin-top: 0;
    font-size: 14px;
    font-weight: bold;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.week-card-expanded-content p {
    margin-bottom: 6px;
    line-height: 1.4;
}

.week-card-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.week-card.expanded .week-card-arrow {
    transform: rotate(180deg);
}

@media (max-width: 1200px) {
    #weeks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #weeks-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   EDIT MODE TOPBAR
============================================================ */

#topbar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    background: #000;
    padding: 12px 20px;
    border-bottom-left-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#topbar.hidden {
    display: none !important;
}

#topbar button {
    background: #fff;
    border: 3px solid #000;
    padding: 6px 14px;
    cursor: pointer;
    font-weight: bold;
}

.topbar-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}


/* ============================================================
   HERO BANNER
============================================================ */

#hero {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    height: 240px;
    border: 6px solid #000;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1);
}

#hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#hero-title {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    background: #fff;
    font-size: 30px;
    font-weight: bold;
    border: 6px solid #000;
    box-shadow: 6px 6px 0 #000;
}


/* ============================================================
   3-COLUMN LAYOUT
============================================================ */

#layout {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 30px;
    max-width: 1800px;
    margin: 40px auto;
    padding: 0 20px;
}


/* ============================================================
   AGENDA (LEFT SIDEBAR)
============================================================ */

#agenda {
    position: sticky;
    top: 20px;
    background: #f4f4f4;
    /* Light gray background */
    border: 4px solid #000;
    /* Thinner border */
    padding: 16px;
    height: fit-content;
}

.agenda-item {
    padding: 10px 10px;
    margin-bottom: 10px;
    border: 2px solid #000;
    /* Thinner border */
    cursor: pointer;
    font-weight: bold;
    background: #fff;
    font-size: 14px;
}

/* Agenda Item Colors */
.agenda-item.goals {
    background: #d4edda;
}

.agenda-item.tools {
    background: #d1ecf1;
}

.agenda-item.theory {
    background: #fff3cd;
}

.agenda-item.task {
    background: #ffe5b4;
}

.agenda-item.final {
    background: #f8d7da;
}

.agenda-item:hover {
    background: #e0e0e0;
}

.agenda-pauze {
    padding: 10px 10px;
    margin: 15px 0;
    background: #333;
    /* Dark gray instead of black */
    color: #fff;
    border: 2px solid #000;
    text-align: center;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 13px;
}

/* ============================================================
   SHORTCUTS (RIGHT SIDEBAR)
============================================================ */

#shortcuts {
    position: sticky;
    top: 20px;
    background: #f4f4f4;
    /* Light gray background */
    border: 4px solid #000;
    /* Thinner border */
    padding: 16px;
    height: fit-content;
}

.shortcut-item {
    border: 2px solid #000;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fff;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.shortcut-key {
    font-family: monospace;
    font-weight: bold;
    background: #eee;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
    color: #333;
}

.shortcut-label {
    font-weight: 600;
    color: #000;
}


/* ============================================================
   MAIN CONTENT SECTIONS
============================================================ */

#sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section {
    background: #fff;
    border: 6px solid #000;
    padding: 25px;
    position: relative;
    transition: background 0.1s ease;
    /* Strong shadow to pop out */
    top: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

/* Section Colors */
.section.goals {
    background: #d4edda;
    /* Light Green */
}

.section.tools {
    background: #d1ecf1;
    /* Light Blue */
}

.section.theory {
    background: #fff3cd;
    /* Light Yellow */
}

.section.task {
    background: #ffe5b4;
    /* Light Orange */
}

.section.final {
    background: #f8d7da;
    /* Light Red */
}

.section-delete {
    left: 10px;
}

.section-duplicate {
    left: 40px;
}

/* Editable outline */
[contenteditable="true"] {
    outline: 3px solid #ffd54f;
}


/* ============================================================
   DRAG & DROP
============================================================ */

.draggable {
    transition: transform 0.15s ease;
}

.dragging {
    opacity: 0.7;
    transform: scale(0.98);
}

.drop-target {
    border: 6px dashed #000 !important;
    background: #fafafa !important;
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1150px) {
    #layout {
        grid-template-columns: 1fr 260px;
    }

    3-COLUMN LAYOUT============================================================*/ #layout {
        display: grid;
        grid-template-columns: 260px 1fr 260px;
        gap: 30px;
        max-width: 1800px;
        margin: 40px auto;
        padding: 0 20px;
    }


    /* ============================================================
   AGENDA (LEFT SIDEBAR)
============================================================ */

    #agenda {
        position: sticky;
        top: 20px;
        background: #f4f4f4;
        /* Light gray background */
        border: 4px solid #000;
        /* Thinner border */
        padding: 16px;
        height: fit-content;
    }

    .agenda-item {
        padding: 10px 10px;
        margin-bottom: 10px;
        border: 2px solid #000;
        /* Thinner border */
        cursor: pointer;
        font-weight: bold;
        background: #fff;
        font-size: 14px;
    }

    /* Agenda Item Colors */
    .agenda-item.goals {
        background: #d4edda;
    }

    .agenda-item.tools {
        background: #d1ecf1;
    }

    .agenda-item.theory {
        background: #fff3cd;
    }

    .agenda-item.task {
        background: #ffe5b4;
    }

    .agenda-item.final {
        background: #f8d7da;
    }

    .agenda-item:hover {
        background: #e0e0e0;
    }

    .agenda-pauze {
        padding: 10px 10px;
        margin: 15px 0;
        background: #333;
        /* Dark gray instead of black */
        color: #fff;
        border: 2px solid #000;
        text-align: center;
        font-weight: bold;
        letter-spacing: 1px;
        font-size: 13px;
    }


    /* ============================================================
   SHORTCUTS (RIGHT SIDEBAR)
============================================================ */

    #shortcuts {
        position: sticky;
        top: 20px;
        background: #f4f4f4;
        /* Light gray background */
        border: 4px solid #000;
        /* Thinner border */
        padding: 16px;
        height: fit-content;
    }

    .shortcut-item {
        border: 2px solid #000;
        /* Thinner border */
        padding: 10px;
        margin-bottom: 10px;
        font-weight: bold;
        background: #fff;
        font-size: 14px;
    }


    /* ============================================================
   MAIN CONTENT SECTIONS
============================================================ */

    #sections {
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .section {
        background: #fff;
        border: 6px solid #000;
        padding: 25px;
        position: relative;
        transition: background 0.1s ease;
        /* Strong shadow to pop out */
        top: 10px;
        font-size: 18px;
        font-weight: bold;
        cursor: pointer;
    }

    /* Section Colors */
    .section.goals {
        background: #d4edda;
        /* Light Green */
    }

    .section.tools {
        background: #d1ecf1;
        /* Light Blue */
    }

    .section.theory {
        background: #fff3cd;
        /* Light Yellow */
    }

    .section.task {
        background: #ffe5b4;
        /* Light Orange */
    }

    .section.final {
        background: #f8d7da;
        /* Light Red */
    }

    .section-delete {
        left: 10px;
    }

    .section-duplicate {
        left: 40px;
    }

    /* Editable outline */
    [contenteditable="true"] {
        outline: 3px solid #ffd54f;
    }


    /* ============================================================
   DRAG & DROP
============================================================ */

    .draggable {
        transition: transform 0.15s ease;
    }

    .dragging {
        opacity: 0.7;
        transform: scale(0.98);
    }

    .drop-target {
        border: 6px dashed #000 !important;
        background: #fafafa !important;
    }


    /* ============================================================
   RESPONSIVE
============================================================ */

    @media (max-width: 1150px) {
        #layout {
            grid-template-columns: 1fr 260px;
        }

        #agenda {
            display: none;
        }
    }

    @media (max-width: 900px) {
        #layout {
            grid-template-columns: 1fr;
        }

        #shortcuts {
            display: none;
        }

        #hero-title {
            font-size: 22px;
            padding: 10px 20px;
        }
    }


    /* ============================================================
   CONTROL BAR
============================================================ */

    #controlbar {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 9998;
        display: flex;
        gap: 10px;
        background: #fff;
        border: 4px solid #000;
        padding: 10px;
        box-shadow: 4px 4px 0 #000;
    }

    #controlbar button {
        background: #fff;
        border: 3px solid #000;
        padding: 10px 14px;
        cursor: pointer;
        font-size: 18px;
        transition: all 0.2s ease;
    }

    #controlbar button:hover {
        background: #000;
        transform: translateY(-2px);
    }


    /* ============================================================
   SEARCH PALETTE
============================================================ */

    .search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 100px;
    }

    .search-palette {
        background: #fff;
        border: 6px solid #000;
        width: 90%;
        max-width: 600px;
        box-shadow: 10px 10px 0 #000;
    }

    .search-input {
        width: 100%;
        border: none;
        border-bottom: 4px solid #000;
        padding: 20px;
        font-size: 18px;
        font-weight: bold;
        outline: none;
    }

    .search-results {
        max-height: 400px;
        overflow-y: auto;
    }

    .search-result-item {
        padding: 15px 20px;
        border-bottom: 2px solid #e0e0e0;
        cursor: pointer;
        transition: background 0.1s ease;
    }

    .search-result-item:hover,
    .search-result-item.active {
        background: #f0f0f0;
    }

    .search-week-badge {
        display: inline-block;
        background: #000;
        color: #fff;
        padding: 3px 8px;
        font-size: 11px;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .search-week-badge.goals {
        background: #d4edda;
        color: #000;
    }

    .search-week-badge.tools {
        background: #d1ecf1;
        color: #000;
    }

    .search-week-badge.theory {
        background: #fff3cd;
        color: #000;
    }

    .search-week-badge.task {
        background: #ffe5b4;
        color: #000;
    }

    .search-week-badge.final {
        background: #f8d7da;
        color: #000;
    }

    .search-result-title {
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 5px;
    }

    .search-result-preview {
        font-size: 13px;
        color: #666;
        line-height: 1.4;
    }

    .search-empty {
        padding: 40px;
        text-align: center;
        color: #999;
        font-size: 16px;
    }


    /* ============================================================
   DARK MODE (Premiere Pro Inspired)
============================================================ */

    body.dark-mode {
        background-color: #1e1e1e;
        background-image: repeating-linear-gradient(45deg,
                #2a2a2a 0px,
                #2a2a2a 1px,
                #1e1e1e 1px,
                #1e1e1e 10px);
        color: #e0e0e0;
    }

    body.dark-mode #weeks-header,
    body.dark-mode .week-card,
    body.dark-mode #hero-title,
    body.dark-mode #agenda,
    body.dark-mode #shortcuts,
    body.dark-mode .section,
    body.dark-mode #controlbar,
    body.dark-mode .search-palette {
        background: #2a2a2a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }

    body.dark-mode .week-card-header {
        background: #3a3a3a;
        border-color: #4a4a4a;
    }

    body.dark-mode .agenda-item,
    body.dark-mode .shortcut-item,
    body.dark-mode .week-card-preview-item {
        background: #323232;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }

    body.dark-mode .agenda-item:hover {
        background: #3a3a3a;
    }

    body.dark-mode .agenda-pauze {
        background: #1a1a1a;
        border-color: #4a4a4a;
    }

    /* Dark Mode Section Colors (darker, more subtle) */
    body.dark-mode .section.goals,
    body.dark-mode .agenda-item.goals {
        background: #2d3e2d;
    }

    body.dark-mode .section.tools,
    body.dark-mode .agenda-item.tools {
        background: #2d3a3e;
    }

    body.dark-mode .section.theory,
    body.dark-mode .agenda-item.theory {
        background: #3e3a2d;
    }

    body.dark-mode .section.task,
    body.dark-mode .agenda-item.task {
        background: #3e322d;
    }

    body.dark-mode .section.final,
    body.dark-mode .agenda-item.final {
        background: #3e2d2d;
    }

    body.dark-mode .search-input {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #4a4a4a;
    }

    body.dark-mode .search-result-item {
        border-color: #3a3a3a;
    }

    body.dark-mode .search-result-item:hover,
    body.dark-mode .search-result-item.active {
        background: #323232;
    }

    body.dark-mode .search-result-preview {
        color: #999;
    }

    body.dark-mode #controlbar button {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }

    body.dark-mode #controlbar button:hover {
        background: #4a4a4a;
    }

    body.dark-mode #topbar {
        background: #2a2a2a;
    }

    body.dark-mode #topbar button {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }


    /* ============================================================
   PRESENTATION MODE
============================================================ */

    body.presentation-mode #weeks-overview,
    body.presentation-mode #agenda,
    body.presentation-mode #shortcuts,
    body.presentation-mode #controlbar,
    body.presentation-mode #topbar {
        display: none !important;
    }

    body.presentation-mode #layout {
        grid-template-columns: 1fr;
        max-width: none;
        padding: 40px;
    }

    body.presentation-mode #sections {
        gap: 60px;
    }

    body.presentation-mode .section {
        font-size: 24px;
        padding: 40px;
        border-width: 8px;
    }

    body.presentation-mode #hero {
        height: 400px;
        max-width: none;
    }

    body.presentation-mode #hero-title {
        font-size: 48px;
        padding: 20px 50px;
    }

    .presentation-exit-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10001;
        background: #000;
        color: #fff;
        border: 4px solid #fff;
        padding: 12px 24px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
    }

    .presentation-exit-btn:hover {
        background: #fff;
        color: #000;
        border-color: #000;
    }


    /* ============================================================
   PRINT MODE
============================================================ */

    @media print {

        #weeks-overview,
        #agenda,
        #shortcuts,
        #controlbar,
        #topbar,
        #hero {
            display: none !important;
        }

        body {
            background: #fff !important;
            background-image: none !important;
        }

        #layout {
            grid-template-columns: 1fr !important;
            max-width: none !important;
        }

        .section {
            page-break-inside: avoid;
            border: 2px solid #000 !important;
            margin-bottom: 20px;
        }
    }