/* Modern yt-dlp Web Interface Styles */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo svg {
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
    animation: float 3s ease-in-out infinite;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Notice Banner */
.notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 20px;
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.notice-banner svg {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}

.notice-content {
    flex: 1;
}

.notice-content strong {
    color: var(--warning);
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.notice-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}


/* Card */
.card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px var(--shadow);
}

/* Form */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group label svg {
    color: var(--primary);
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input[type="text"]::placeholder {
    color: var(--text-secondary);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Checkbox */
.checkbox-group {
    margin: 20px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-dark);
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Video Info */
.video-info {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: 12px;
    margin: 20px 0;
    border: 2px solid var(--border);
    animation: fadeIn 0.4s ease-out;
}

.video-info img {
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.video-details h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.video-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Progress Card */
.progress-card {
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Indeterminate state used while merging / converting / extracting audio */
.progress-fill.processing {
    width: 100% !important;
    transition: none;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    animation: indeterminate 1.2s linear infinite;
}

@keyframes indeterminate {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Download Complete/Error */
.download-complete,
.download-error {
    text-align: center;
    padding: 30px;
    animation: fadeIn 0.4s ease-out;
}

.download-complete svg,
.download-error svg {
    margin-bottom: 15px;
    animation: scaleIn 0.5s ease-out;
}

.download-complete h4 {
    color: var(--success);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.download-error h4 {
    color: var(--error);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.download-error p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature {
    text-align: center;
    padding: 25px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.feature:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--shadow);
}

.feature svg {
    color: var(--primary);
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {

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

    50% {
        transform: translateY(-10px);
    }
}

/* Trim Interface */
.trim-container {
    background: rgba(15, 23, 42, 0.3);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.trim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.trim-header label {
    margin-bottom: 0;
}

.trim-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.3s ease-out;
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.time-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.time-field input {
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-dark);
    transition: .4s;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-color: white;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.help-text code {
    background: var(--bg-dark);
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .video-info {
        flex-direction: column;
    }

    .video-info img {
        width: 100%;
        height: auto;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .time-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}