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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
}

/* Landing Screen Styles */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 229, 0, 0.3);
    border-radius: 0;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 229, 0, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.option-card:hover {
    border-color: #ffe500;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 229, 0, 0.15);
}

.option-card:hover::before {
    opacity: 1;
}

.card-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.option-card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 600;
}

.option-card p {
    color: #b0b0b0;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-btn {
    background: #ffe500;
    color: #000;
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.card-btn svg { pointer-events: none; }

.card-btn:hover {
    background: #ffcc00;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 229, 0, 0.3);
}


/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #ffe500;
    color: #ffe500;
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: rgba(255, 229, 0, 0.1);
    transform: translateY(-1px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.logo {
    display: inline-flex;
    justify-content: center;
    margin-bottom: 20px;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffe500 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #b0b0b0;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Section */
.upload-section {
    display: flex;
    justify-content: center;
}

.upload-box {
    border: 2px solid #ffe500;
    padding: 60px 40px;
    background: rgba(255, 229, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-box:hover {
    border-color: #ffcc00;
    background: rgba(255, 229, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 229, 0, 0.2);
}

.upload-box.dragover {
    border-color: #ffcc00;
    background: rgba(255, 229, 0, 0.15);
}

.upload-content {
    text-align: center;
}

.upload-icon {
    margin-bottom: 20px;
    opacity: 0.8;
}

.upload-box h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ffffff;
}

.upload-box p {
    color: #b0b0b0;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.upload-btn {
    background: #ffe500;
    color: #000;
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-btn:hover {
    background: #ffcc00;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 229, 0, 0.3);
}

/* URL Loader – integrated in edit card */
.option-card--edit {
    cursor: default;
}

.card-url-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
    color: #444;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.card-url-divider::before,
.card-url-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.card-url-row {
    display: flex;
    gap: 0;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0;
    overflow: hidden;
    transition: border-color 0.2s;
    width: 100%;
}

.card-url-row:focus-within {
    border-color: rgba(255,229,0,0.45);
}

.card-url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ddd;
    font-size: 0.82rem;
    padding: 9px 12px;
    min-width: 0;
}

.card-url-input::placeholder { color: #3a3a3a; }

.card-url-go {
    flex-shrink: 0;
    background: #ffe500;
    color: #000;
    border: none;
    padding: 0 16px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

.card-url-go:hover:not(:disabled) { background: #ffcc00; }
.card-url-go:disabled { opacity: 0.65; cursor: wait; }

@keyframes spin { to { transform: rotate(360deg); } }
.url-spinner { animation: spin 0.8s linear infinite; transform-origin: center; }

/* Base buttons */
.btn {
    padding: 7px 16px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #ffe500;
    color: #000;
}

.btn-primary:hover {
    background: #ffcc00;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,229,0,0.35);
}

.btn-secondary {
    background: transparent;
    color: #ffe500;
    border: 1px solid rgba(255,229,0,0.5);
}

.btn-secondary:hover {
    background: rgba(255,229,0,0.08);
    border-color: #ffe500;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,229,0,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ffe500; }

/* ============================
   EDITOR – split layout
   ============================ */

/* Full-viewport wrapper */
.editor-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header strip */
.editor-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    background: rgba(0,0,0,0.65);
    border-bottom: 1px solid rgba(255,229,0,0.15);
    flex-shrink: 0;
    backdrop-filter: blur(16px);
}

.editor-header .back-btn {
    margin-bottom: 0;
    flex-shrink: 0;
}

.editor-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffe500 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.editor-header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Body – two columns */
.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---- LEFT PANEL ---- */
.panel-left {
    width: 340px;
    min-width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
}

.panel-section {
    padding: 14px 18px;
}

.panel-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffe500;
    margin-bottom: 12px;
}

.panel-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 0 16px;
}

/* Form fields */
.field-group {
    margin-bottom: 9px;
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #999;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.field-optional {
    font-weight: 400;
    color: #666;
}

.field-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    padding: 7px 10px;
    color: #fff;
    font-size: 0.85rem;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    border-radius: 3px;
}

.field-input:focus {
    border-color: #ffe500;
    background: rgba(255,229,0,0.06);
    box-shadow: 0 0 0 2px rgba(255,229,0,0.12);
}

.field-input::placeholder { color: #555; }

.field-input--mono {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 0.82rem;
}

/* Channel empty state */
.channel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 0;
    color: #444;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Channel form actions */
.channel-form-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 10px;
}

.btn--full {
    width: 100%;
    justify-content: center;
}

.btn-danger {
    background: transparent;
    color: #ff4c4c;
    border: 1px solid rgba(255,76,76,0.6);
    padding: 7px 14px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-danger:hover {
    background: rgba(255, 76, 76, 0.12);
}

/* ---- RIGHT PANEL ---- */
.panel-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(0,0,0,0.15);
}

.channel-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.channel-list-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
}

.channel-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.channel-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ccc;
    font-size: 0.9rem;
}

.channel-search::placeholder { color: #555; }

/* Channel list scroll area */
.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Individual channel row */
.channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

.channel-item:hover {
    background: rgba(255,255,255,0.04);
}

.channel-item.selected {
    background: rgba(255,229,0,0.07);
    border-left-color: #ffe500;
}

.channel-item-logo {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: contain;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.channel-item-logo-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #555;
    overflow: hidden;
}

.channel-item-info {
    flex: 1;
    min-width: 0;
}

.channel-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item-meta {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.channel-item-group {
    font-size: 0.72rem;
    color: #ffe500;
    background: rgba(255,229,0,0.1);
    padding: 2px 6px;
    flex-shrink: 0;
}

/* Empty / loading state for channel list */
.channel-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #444;
    gap: 14px;
    font-size: 0.9rem;
    text-align: center;
    padding: 40px;
}

.channel-list-empty svg { opacity: 0.25; }

/* Responsive */
@media (max-width: 768px) {
    .editor-body { flex-direction: column; }
    .panel-left {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
}

/* ============================
   CHANNEL PANEL – tabs & fields
   ============================ */

.ch-tabs {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ch-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 4px 8px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
    letter-spacing: 0.02em;
}

.ch-tab:hover { color: #ccc; }

.ch-tab.active {
    color: #ffe500;
    border-bottom-color: #ffe500;
}

.field-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.adv-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4a4a4a;
    margin: 10px 0 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.field-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

.field-select option {
    background: #1a1a1a;
    color: #fff;
}

.channel-form-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

/* ============================
   DRAG & DROP – channel list
   ============================ */

.drag-handle {
    flex-shrink: 0;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s;
    margin-right: 2px;
}

.channel-item:hover .drag-handle {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.channel-item.dragging {
    opacity: 0.35;
    background: rgba(255,229,0,0.04);
}

.drag-drop-indicator {
    height: 2px;
    background: #ffe500;
    margin: 0 20px;
    position: relative;
    pointer-events: none;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255,229,0,0.6);
}

.drag-drop-indicator::before,
.drag-drop-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffe500;
}

.drag-drop-indicator::before { left: -3px; }
.drag-drop-indicator::after  { right: -3px; }

/* Footer Styles */
.footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    margin-top: auto;
}

.info-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.info-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-section p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* ============================
   MULTI-SELECT – bulk panel
   ============================ */

/* Channel list header actions (select-all + count) */
.channel-list-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-select-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #888;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 9px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.btn-select-all:hover {
    border-color: rgba(255,229,0,0.4);
    color: #ffe500;
    background: rgba(255,229,0,0.05);
}

/* Multi-selected item highlight */
.channel-item.selected {
    background: rgba(255,229,0,0.07);
    border-left-color: #ffe500;
}

/* Bulk edit panel */
.channel-bulk {
    padding: 8px 0 4px;
}

.bulk-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffe500;
    border-bottom: 1px solid rgba(255,229,0,0.15);
    margin-bottom: 10px;
}

.bulk-clear-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    margin-top: 2px;
}

.bulk-clear-btn:hover {
    border-color: rgba(255,255,255,0.25);
    color: #aaa;
}

/* Selection hint */
.selection-hint {
    font-size: 0.68rem;
    color: #444;
    text-align: center;
    padding: 4px 0 8px;
    letter-spacing: 0.01em;
}

