/* --- CSS Variables & Theming --- */
:root {
    --bg-color: #0d0f1a;
    --panel-bg: rgba(25, 28, 45, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #FF2E93;
    --primary-hover: #ff479f;
    --secondary: #00E5FF;
    --text-main: #FFFFFF;
    --text-muted: #9499b7;
    --success: #00E676;

    --font-family: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem;
}

/* --- Animated Background Blobs --- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 46, 147, 0.4);
    top: 10%;
    left: -10%;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: rgba(0, 229, 255, 0.4);
    bottom: -10%;
    right: -10%;
    animation-delay: -3s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: rgba(140, 0, 255, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-40px) scale(1.05);
    }
}

/* --- Layout & Glassmorphism --- */
.app-container {
    width: 100%;
    max-width: 800px;
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* --- Typography --- */
.app-header {
    text-align: center;
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.section-label {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* --- Form Elements --- */
.config-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* File Drop Area */
.file-drop-area {
    position: relative;
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.file-drop-area:hover,
.file-drop-area.dragover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
}

.file-msg {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

.file-drop-area:hover .file-msg {
    color: var(--text-main);
}

#video-upload {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* Custom Radio Buttons - Boxes */
.box-radio {
    display: flex;
    gap: 12px;
}

.box-radio label {
    flex: 1;
    cursor: pointer;
}

.box-radio input[type="radio"] {
    display: none;
}

.box-radio .radio-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 600;
}

.box-radio input[type="radio"]:checked+.radio-btn {
    background: rgba(255, 46, 147, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 46, 147, 0.3);
    color: var(--primary);
}

.box-radio label:hover .radio-btn {
    background: rgba(255, 255, 255, 0.1);
}

/* Custom Radio Buttons - List */
.list-radio {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-radio label {
    cursor: pointer;
}

.list-radio input[type="radio"] {
    display: none;
}

.list-radio .radio-text {
    display: block;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.list-radio input[type="radio"]:checked+.radio-text {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--secondary);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.list-radio label:hover .radio-text {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Action Button --- */
.action-section {
    margin-top: 10px;
}

.primary-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(90deg, var(--primary), #FF5E5E);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
    letter-spacing: 1px;
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.glow-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 46, 147, 0.5);
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.5s ease;
}

.glow-btn:not(:disabled):hover::before {
    left: 100%;
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility */
.hidden {
    display: none !important;
}

/* --- Progress Section --- */
.progress-section {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: monospace;
    text-align: center;
}

/* --- Results --- */
.results-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 32px;
}

.clips-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.clip-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s ease;
}

.clip-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.clip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clip-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
}

.clip-headline {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.clip-actions {
    display: flex;
    gap: 12px;
}

.clip-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-preview {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-preview:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-download {
    background: var(--success);
    color: #000;
}

.btn-download:hover {
    background: #00c853;
}

video.preview-player {
    width: 100%;
    border-radius: 12px;
    background: #000;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }

    .app-container {
        padding: 24px;
        border-radius: 16px;
    }

    h1 {
        font-size: 2.2rem;
    }
}

/* --- Verification Container --- */
.verification-container {
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
}

.url-input {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}