/* ============================================================
   FOTOBOX CONTROL CENTER - STYLES
   ============================================================
   
   Farben:
   - Primary (Pink): #c82451
   - Background: #050509
   - Text: #fff
   - Muted: #bbb
   - Success (Grün): #4caf50
   - Warning (Orange): #ff9800
   
   ============================================================ */

:root {
    --key: #c82451;
    --bg: #050509;
    --text: #fff;
    --muted: #bbb;
    --success: #4caf50;
    --warning: #ff9800;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top, #1f1f2f 0, #050509 55%, #000 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Layout ─── */

.wrapper {
    width: 100%;
    max-width: 540px;
    padding: 20px;
}

.card {
    background: rgba(10, 10, 20, 0.95);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
    padding: 24px 18px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hidden {
    display: none !important;
}

/* ─── Typografie ─── */

h1 {
    margin: 0 0 8px;
    font-size: 1.4rem;
}

.sub, .subtext {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 20px;
}

.headline {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.section-title {
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.status {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--muted);
    min-height: 1.2em;
}

/* ─── Inputs ─── */

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #05050b;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}

input:focus {
    border-color: var(--key);
}

/* ─── Buttons ─── */

.btn {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: var(--key);
    box-shadow: 0 10px 25px rgba(200, 36, 81, 0.5);
    transition: transform 0.08s, box-shadow 0.08s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(200, 36, 81, 0.65);
}

.btn.secondary {
    background: #272736;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.btn.secondary:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.75);
}

.btn:disabled, .btn.disabled {
    opacity: 0.25;
    pointer-events: none;
}

.btn-small {
    display: inline-block;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    background: #272736;
    color: var(--text);
    transition: background 0.1s;
}

.btn-small:hover {
    background: #363648;
}

/* ─── Select ─── */

.select {
    width: 100%;
    padding: 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #05050b;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    appearance: none;
    margin: 12px 0;
}

.select:disabled {
    opacity: 0.4;
}

/* ─── Badges ─── */

.override-badge {
    display: inline-block;
    background: var(--key);
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.override-badge.secondary {
    background: var(--warning);
}

/* ─── Box Liste (Dashboard) ─── */

.box-list {
    margin: 20px 0;
    text-align: left;
}

.box-card {
    display: flex;
    align-items: center;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: background 0.15s;
}

.box-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.box-card.not-online {
    opacity: 0.7;
}

.box-link {
    flex: 1;
    display: block;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
}

.box-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.box-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-left: 8px;
    vertical-align: middle;
}

.box-status-badge.online {
    background: var(--success);
}

.box-status-badge.unstable {
    background: var(--warning);
}

.box-status-badge.offline {
    background: #666;
}

.box-info {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.btn-delete {
    padding: 10px 14px;
    margin-right: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.3;
    transition: opacity 0.15s;
    border-radius: 8px;
}

.btn-delete:hover {
    opacity: 1;
    background: rgba(255, 100, 100, 0.2);
}

.loading, .empty {
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.no-boxes {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

.no-boxes-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* ─── Info Box ─── */

.info-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    font-size: 0.85rem;
}

.info-box code {
    display: block;
    background: #05050b;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    word-break: break-all;
    color: var(--success);
}

.info-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 8px;
}

/* ─── Modals ─── */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(20, 20, 35, 0.98);
    border-radius: 18px;
    padding: 25px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 {
    margin: 0 0 15px;
    font-size: 1.2rem;
}

.modal p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons .btn {
    flex: 1;
    margin: 0;
    padding: 14px;
}

.token-display {
    display: block;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    word-break: break-all;
    margin: 15px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Override/Autoactivator Liste ─── */

.override-list {
    text-align: left;
    margin: 15px 0;
}

.override-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s;
}

.override-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.override-item.config-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.override-item input {
    width: 22px;
    height: 22px;
    accent-color: var(--success);
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.override-item input:disabled {
    cursor: not-allowed;
}

.override-item label {
    flex: 1;
    cursor: pointer;
}

.override-item .title {
    font-size: 0.95rem;
    font-weight: 500;
}

.override-item .id {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: 'Courier New', monospace;
}

.override-item .config-note {
    color: var(--warning);
    font-size: 0.7rem;
    margin-top: 4px;
}

/* ─── Separators ─── */

.secondary-seperator {
    width: 20%;
    border-style: dashed;
    border-color: #272736;
    border-width: 1px;
    margin: 1.5em auto 1em;
}

.primary-seperator {
    width: 35%;
    border-style: solid;
    border-color: #4b4b4e;
    border-width: 1px;
    margin: 1.5em auto 1.7em;
}

/* ─── Connection Info (Box Seite) ─── */

.connection-info {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.connection-info #boxStatus {
    font-weight: 500;
}

.connection-info #lastSeen {
    opacity: 0.7;
}

.connection-info #lastSeen:before {
    content: " • ";
}

.connection-info #lastSeen:empty:before {
    content: "";
}

/* ─── Aktiver Screen Anzeige ─── */

.active-screen-display {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.active-screen-display.hidden {
    display: none;
}

.active-screen-icon {
    font-size: 1.2rem;
}

.active-screen-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--success);
}

/* ─── Status Bar (oben) ─── */

.status-bar {
    font-size: 0.85rem;
    color: var(--muted);
    min-height: 1.4em;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.status-bar:not(:empty) {
    background: rgba(255, 255, 255, 0.05);
}

.status-bar.error {
    background: rgba(255, 100, 100, 0.15);
    color: #ff8a80;
}

.status-bar.success {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

/* ─── Offline State ─── */

.offline-mode .btn:not(.always-enabled),
.offline-mode .select {
    opacity: 0.3;
    pointer-events: none;
}

.offline-mode .section-title {
    opacity: 0.5;
}

/* ─── Scrollbar ─── */

.modal::-webkit-scrollbar {
    width: 8px;
}

.modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal::-webkit-scrollbar-thumb {
    background: var(--key);
    border-radius: 10px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: #a01d41;
}
