/* ===== ROOT & THEME ===== */
:root {
    --text: #000;
    --bg: #eee;
    --bg2: #f4f4f4;
    --accent: #ff5555;
    --hover: #ffaaaa;
    --button: #fff;
    --border: #ccc;
    --shadow: 0 4px 12px rgba(0,0,0,0.2)
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #fff;
        --bg: #222;
        --bg2: #333;
        --button: #444;
        --border: #555;
        --shadow: 0 4px 16px rgba(0,0,0,0.4);
    }
}

* {
    box-sizing: border-box;
    font-family: "Courier New", Courier, monospace;
}


/* ===== BASE ELEMENTS ===== */
body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100vh;

    background: var(--bg);
    color: var(--text);

    text-align: center;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover { color: var(--hover) }

hr { color: var(--border) }

button {
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
    border-radius: 6px;
    border: none;

    background: var(--button);
    color: var(--text);
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);


    font-family: inherit;
    font-size: 1rem;

    cursor: pointer;
}

details {
    width: 100%;
    max-width: 600px;
    align-items: center;
}

details > summary {
    margin: 8px 0;
    cursor: pointer;
}

input {
    background: var(--bg2);
    color: var(--text);
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

.input-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

header {
    display: flex;
    justify-content: right;
    width: 100%;
}

video {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: 8px;
    background: #000;
}

.channel-box {
    display: grid;
    width: 100%;
    padding: 12px;
    background: var(--bg2);
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: var(--shadow);
}

.channel-content {
    display: flex;
    gap: 8px;
    align-items: center;
}

.channel-name {
    flex: 1;
    text-align: left;
    font-size: 20px;
    word-break: break-word;
}

.channel + .channel {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 8px;
}


/* ===== DIALOG/MODAL =====*/
dialog {
    width: min(80vw, 320px);
    max-height: 90vh;
    background: var(--bg);
    color: inherit;
    border: none;
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow);
}

dialog::backdrop {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    word-break: break-word;
    text-align: left;
}

dialog h3 {
    margin: 0;
    padding-bottom: 4px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

#channelModal.add-mode .edit-title,
#channelModal.add-mode .delete-btn { display: none }

#channelModal.edit-mode .add-title { display: none }
#channelModal.edit-mode .delete-btn { display: block }