:root {
    --bg-color: #f5f7fa;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.12);
    --primary: #e3000f;
    --primary-hover: #c2000c;
    --secondary: #8b5cf6;
    --text-main: #111827;
    --text-muted: #4b5563;
    --danger: #ef4444;
    --success: #e3000f;
    --surface: #ffffff;
    --pill-bg: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}


.container {
    width: 100%;
    max-width: 700px;
    padding: 20px;
    z-index: 1;
}

.text-center {
    text-align: center;
}

/* Glass Panel Styling */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Input Group */
.input-group {
    display: flex;
    position: relative;
    margin-bottom: 20px;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
}

input[type="text"] {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 18px 20px 18px 50px;
    border-radius: 16px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

/* Buttons */
.btn {
    padding: 16px 24px;
    border-radius: 14px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    position: absolute;
    right: 6px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

.btn-action {
    width: 100%;
    background: var(--primary);
    color: white;
    margin-top: 15px;
}

.btn-action:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-success {
    width: 100%;
    background: var(--success);
    color: white;
    margin-top: 15px;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Error Box */
.error-box {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Loading Box */
.loading-box {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Video Preview */
.result-box {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-preview {
    display: flex;
    background: var(--surface);
    border-radius: 16px;
    padding: 15px;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}



#thumbnail {
    width: 160px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.video-info h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    background: var(--pill-bg);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tabs */
.download-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
}

.download-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--pill-bg);
    color: white;
}

/* Quality Grid Layout */
.section-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.quality-box {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quality-box:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--primary);
}

.quality-box.selected {
    background: var(--primary);
    border-color: var(--primary-hover);
}

.quality-box .res {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.quality-box .size {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
}

.quality-box.selected .res {
    color: white;
}

.quality-box.selected .size {
    color: rgba(255, 255, 255, 0.8);
}

/* Action Buttons Row */
.action-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}



.btn-red {
    background: var(--primary);
    color: white;
}

.btn-red:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(227, 0, 15, 0.3);
}

.btn-dark {
    background: var(--primary);
    color: white;
}

.btn-dark:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(227, 0, 15, 0.3);
}

/* Progress Box */
.progress-box {
    text-align: center;
    padding: 20px;
    background: var(--surface);
    border-radius: 16px;
    margin-top: 20px;
}

.progress-box h3 {
    margin-bottom: 15px;
}

.progress-bar-container {
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.3s ease;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* =========================================
   Responsive Design
   ========================================= */

/* Tablet & Smaller Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
}

/* Tablet / Large Mobile (max-width: 768px) */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .glass-panel {
        padding: 25px;
    }

    .btn {
        font-size: 0.95rem;
    }
}

/* Mobile (max-width: 500px) */
@media (max-width: 500px) {
    header h1 {
        font-size: 1.7rem;
    }

    .glass-panel {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-icon {
        top: 20px;
    }

    input[type="text"] {
        width: 100%;
        padding-right: 20px;
    }

    .btn-primary {
        position: static;
        width: 100%;
        margin-top: 10px;
        padding: 15px;
    }

    .video-preview {
        flex-direction: column;
        text-align: center;
    }

    .action-buttons-row {
        grid-template-columns: 1fr;
    }

    .quality-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Small Mobile (max-width: 320px) */
@media (max-width: 320px) {
    header h1 {
        font-size: 1.4rem;
    }

    .glass-panel {
        padding: 15px;
    }

    header p {
        font-size: 0.9rem;
    }

    input[type="text"] {
        font-size: 1rem;
        padding: 14px 15px 14px 40px;
    }

    .input-icon {
        top: 16px;
        left: 15px;
    }

    .btn {
        font-size: 0.85rem;
        padding: 12px;
    }

    .quality-grid {
        grid-template-columns: 1fr;
    }

    #thumbnail {
        width: 100%;
    }
}