:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Background */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99,102,241,0.4) 0%, rgba(168,85,247,0.4) 100%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(236,72,153,0.4) 0%, rgba(234,88,12,0.4) 100%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Glassmorphism Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 1;
    margin: 1rem;
}

header {
    margin-bottom: 2.5rem;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Settings Styles */
.settings-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    margin-bottom: 1rem;
    float: right;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.settings-trigger:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.settings-panel {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.help-text {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-text a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.save-settings-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    width: auto !important;
    margin-top: 0.5rem;
    display: inline-block !important;
}

/* Form Styles */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.time-inputs {
    display: flex;
    gap: 1rem;
}

.time-inputs .input-group {
    flex: 1;
}

/* Video Preview */
#video-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
}

#video-preview iframe, #video-preview video {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

#preview-info {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#preview-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.control-btn {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Button */
button {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.hidden {
    display: none !important;
}

/* Status Message */
#status-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Responsive Design (RWD) */
@media (max-width: 480px) {
    .glass-container {
        padding: 1rem;
        border-radius: 16px;
        margin: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }

    header {
        margin-bottom: 1rem;
    }

    p {
        font-size: 0.85rem;
    }

    .input-group {
        margin-bottom: 0.75rem;
    }

    label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    input, select {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .time-inputs {
        flex-direction: row;
        gap: 0.5rem;
    }

    #video-preview {
        margin-bottom: 0.75rem;
    }

    .control-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    #preview-controls {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    button#submit-btn {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
}
