
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0b0b0f;
    color: white;
    text-align: center;
}

h1 {
    margin-top: 120px;
    font-size: 64px;
    letter-spacing: -3px;
}

p {
    color: #999;
    font-size: 18px;
}

/* ========================================
HEADER
======================================== */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    border-bottom: 1px solid #1d1d24;
}

.logo {
    font-size: 22px;
    font-weight: bold;
}

.logo span {
    color: #7c5cff;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: #aaa;
    text-decoration: none;
    font-size: 15px;
}

nav a:hover {
    color: white;
}

.login-button {
    background: #7c5cff;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.25s ease;
}

.login-button:hover {
    background: #6948ee;
}

/* ========================================
PREMIUM LOGIN BUTTON
======================================== */

/*
   Dein script.js setzt automatisch:
   data-plan="premium"
   auf den Login-Button.
*/

.login-button[data-plan="premium"] {
    background: linear-gradient(
        135deg,
        #ffd86b,
        #ffb52e
    );

    color: #17120a;

    font-weight: 800;

    border: 1px solid rgba(255, 216, 107, 0.8);

    box-shadow:
        0 0 12px rgba(255, 194, 62, 0.35),
        0 0 30px rgba(255, 194, 62, 0.12);

    position: relative;
}

.login-button[data-plan="premium"]::before {
    content: "★";
    margin-right: 6px;
}

.login-button[data-plan="premium"]:hover {
    background: linear-gradient(
        135deg,
        #ffe58e,
        #ffc34d
    );

    transform: translateY(-1px);

    box-shadow:
        0 0 18px rgba(255, 194, 62, 0.55),
        0 0 40px rgba(255, 194, 62, 0.18);
}

/* ========================================
UPLOAD
======================================== */

.upload-area {
    width: 80%;
    max-width: 700px;
    margin: 50px auto;
    padding: 45px 30px;
    border: 1px dashed #444;
    border-radius: 18px;
    background: #111118;
}

.upload-icon {
    font-size: 45px;
    color: #7c5cff;
}

.upload-area h2 {
    margin-bottom: 8px;
}

.upload-area small {
    display: block;
    margin-top: 15px;
    color: #777;
}

input[type="file"] {
    display: none;
}

.upload-button {
    display: inline-block;
    margin-top: 20px;
    padding: 13px 25px;
    background: #7c5cff;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.upload-button:hover {
    background: #6948ee;
}

/* ========================================
VIDEO
======================================== */

video {
    display: block;
    width: 80%;
    max-width: 800px;
    margin: 50px auto;
    border-radius: 15px;
}

#videoWrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 40px auto;
}

#videoContainer {
    width: 100%;
}

#videoContainer video {
    width: 100%;
    max-width: 100%;
    display: block;
    margin: 0;
    border-radius: 15px;
}

/* ========================================
SUBTITLE PREVIEW
======================================== */

#subtitleOverlay {
    position: absolute;
    left: 50%;
    width: 85%;
    max-width: 85%;
    bottom: 10%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: bold;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;

    text-shadow:
        -2px -2px 0 #000,
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000,
         0 3px 6px rgba(0, 0, 0, 0.8);

    pointer-events: none;
    z-index: 10;
    white-space: pre-line;

    transition:
        color 0.15s ease,
        font-size 0.15s ease;
}

/* ========================================
BUTTONS
======================================== */

.subtitle-controls {
    text-align: center;
    margin-top: 20px;
}

.subtitle-language-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.subtitle-language-control label {
    font-weight: 600;
}

.subtitle-language-control select {
    padding: 9px 12px;
    border: 1px solid #d7d1ff;
    border-radius: 9px;
    background: white;
    color: #222;
    font: inherit;
    cursor: pointer;
}

.subtitle-language-control select:focus {
    outline: none;
    border-color: #7c5cff;
}

#createSubtitles {
    background: #7c5cff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    min-width: 260px;
    white-space: nowrap;
    transition: 0.2s;
}

#createSubtitles:hover {
    background: #6948ee;
}

#createSubtitles:disabled {
    opacity: 0.6;
    cursor: wait;
}

#saveSubtitle {
    display: block;
    margin: 15px auto 0;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #7c5cff;
    color: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

#saveSubtitle:hover {
    background: #6948ee;
}

#exportVideo {
    display: block;
    margin: 15px auto 0;
    padding: 14px 25px;
    border: none;
    border-radius: 10px;
    background: #22222d;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

#exportVideo:hover {
    background: #30303d;
}

#exportVideo:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ========================================
SUBTITLE EDITOR
======================================== */

.subtitle-editor {
    max-width: 700px;
    margin: 40px auto;
    text-align: left;
    padding: 20px;
}

.subtitle-editor h2 {
    margin-bottom: 15px;
}

.subtitle-editor textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #30303a;
    background: #111118;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
    resize: vertical;
}

.hidden {
    display: none;
}

/* ========================================
SUBTITLE SETTINGS
======================================== */

#subtitleSettings {
    margin-top: 22px;
    padding: 22px;
    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            #202124,
            #111214
        );

    border: 1px solid #3b3d42;
    color: white;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);
}

#subtitleSettings h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: white;
}

#subtitleSettings .setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

#subtitleSettings .setting-row:last-child {
    margin-bottom: 0;
}

#subtitleSettings label {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

#subtitleSettings select {
    min-width: 180px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid #555;
    background: #292b30;
    color: white;
    font-size: 14px;
    outline: none;
}

#subtitleSettings select:focus {
    border-color: #7c5cff;
}

#subtitleSettings input[type="range"] {
    width: 180px;
    accent-color: #7c5cff;
    cursor: pointer;
}

#subtitleSettings input[type="color"] {
    width: 48px;
    height: 32px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid #555;
    background: #292b30;
    cursor: pointer;
}

.size-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

#subtitleSettings .size-value {
    display: inline-block;
    min-width: 38px;
    text-align: right;
    color: white;
    font-weight: 700;
}

.size-unit {
    color: #999;
    font-size: 13px;
}

/* ========================================
PREMIUM SUBTITLE SETTINGS
======================================== */

#subtitleSettings:has(#subtitleColor:not(:disabled)),
#subtitleSettings:has(#subtitleFont:not(:disabled)) {
    border-color: rgba(255, 194, 62, 0.45);

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.35),
        0 0 25px rgba(255, 194, 62, 0.08);
}

#subtitleSettings:has(#subtitleColor:not(:disabled))::before {
    content: "★ PREMIUM";

    display: block;

    width: fit-content;

    margin: -8px auto 18px;

    padding: 5px 12px;

    border-radius: 999px;

    background: rgba(255, 194, 62, 0.1);

    border: 1px solid rgba(255, 194, 62, 0.35);

    color: #ffd86b;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1px;
}

/* ========================================
EXPORT HINT
======================================== */

.export-hint {
    margin-top: 8px;
    color: #888;
    font-size: 14px;
    text-align: center;
}

/* ========================================
FOOTER
======================================== */

footer {
    margin-top: 100px;
    padding: 30px;
    color: #666;
    font-size: 14px;
}

/* ========================================
RESPONSIVE
======================================== */

@media (max-width: 700px) {

    header {
        padding: 15px 20px;
    }

    nav {
        display: none;
    }

    h1 {
        font-size: 42px;
        margin-top: 70px;
    }

    #videoWrapper {
        width: 95%;
    }

    .subtitle-editor {
        width: 95%;
        padding: 10px;
    }

    #subtitleSettings .setting-row {
        flex-direction: column;
        align-items: flex-start;
    }

    #subtitleSettings select {
        width: 100%;
    }

    #subtitleSettings input[type="range"] {
        width: 100%;
    }

    .size-control {
        width: 100%;
    }

    .size-control input[type="range"] {
        flex: 1;
    }

    #subtitleOverlay {
        width: 90%;
        max-width: 90%;
    }
}

/* ========================================
SUPABASE AUTH
======================================== */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);

    backdrop-filter: blur(8px);
}

.auth-modal.hidden {
    display: none;
}

.auth-box {
    position: relative;

    width: 100%;
    max-width: 420px;

    padding: 35px;

    border-radius: 20px;

    background: #111118;

    border: 1px solid #30303a;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.55);

    text-align: center;
}

.auth-box h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 26px;
}

.auth-box p {
    margin-bottom: 25px;
    font-size: 15px;
}

.auth-box input {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #33333d;
    background: #191920;
    color: white;
    font-size: 15px;
    outline: none;
}

.auth-box input:focus {
    border-color: #7c5cff;
}

.auth-box > div > button:not(.auth-switch) {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #7c5cff;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.auth-box > div > button:not(.auth-switch):hover {
    background: #6948ee;
}

.auth-close {
    position: absolute;
    top: 12px;
    right: 15px;

    width: 35px;
    height: 35px;

    border: none;
    background: transparent;
    color: #888;

    font-size: 28px;
    cursor: pointer;
}

.auth-close:hover {
    color: white;
}

.auth-switch {
    margin-top: 18px;
    border: none;
    background: transparent;
    color: #9b86ff;
    cursor: pointer;
    font-size: 14px;
}

.auth-switch:hover {
    color: white;
}

.auth-message {
    min-height: 20px;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
    font-size: 14px !important;
}
