/* Modern YouTube Trimmer - Fully Responsive */

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

:root {
    --primary: #FF0000;
    --primary-dark: #CC0000;
    --secondary: #282828;
    --bg-dark: #0F0F0F;
    --bg-card: #212121;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --border: #303030;
    --success: #00C853;
    --error: #FF5252;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Input Groups */
.input-group {
    margin-bottom: 24px;
}

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

label svg {
    opacity: 0.7;
}

input[type="text"],
select {
    width: 100%;
    padding: 14px 16px;
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-dark);
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.1);
}

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

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

/* Video Preview */
.video-preview {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: var(--secondary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 2px solid var(--border);
}

.preview-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.preview-placeholder p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

#videoFrame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Time Section */
.time-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 24px;
}

.progress-bar {
    height: 48px;
    background: var(--secondary);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #FF6B6B);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#progressPercent {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-text {
    text-align: center;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

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

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

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 0, 0, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-submit.loading {
    background: var(--secondary);
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Status Message */
.status-message {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.95rem;
    display: none;
}

.status-message:not(:empty) {
    display: block;
}

.status-message.success {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.3);
}

.status-message.error {
    background: rgba(255, 82, 82, 0.15);
    color: var(--error);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

/* Footer */
.footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 20px;
        border-radius: 12px;
    }

    .header {
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    .time-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .input-group {
        margin-bottom: 16px;
    }

    input[type="text"],
    select {
        padding: 12px 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .btn-submit {
        padding: 14px 20px;
        font-size: 15px;
    }

    .progress-bar {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }
}

/* Dark scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}