:root {
    /* Light Mode Colors */
    --primary-color: #fe2c55;
    --secondary-color: #25f4ee;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --stat-bg: #f9f9f9;
    --music-bg: #f0f8ff;
    --code-bg: #e9ecef;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --font-family: 'Poppins', sans-serif;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --input-bg: #252525;
    --stat-bg: #252525;
    --music-bg: #1e2a35;
    --code-bg: #2d2d2d;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER ========== */
header {
    background: var(--card-bg);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    transition: background-color 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: rotate(20deg);
}

/* ========== HERO SECTION ========== */
.hero {
    text-align: center;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--text-main), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.description {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== SUPPORTED LINKS INFO ========== */
.supported-links {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-left: 4px solid var(--secondary-color);
    transition: background-color 0.3s ease;
}

.supported-links p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supported-links p i {
    color: var(--success-color);
}

.link-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.link-examples code {
    background: var(--code-bg);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-main);
    font-family: 'Consolas', 'Monaco', monospace;
    transition: background-color 0.3s ease;
}

/* ========== INPUT SECTION ========== */
.input-section {
    max-width: 700px;
    margin: 0 auto 40px;
    text-align: center;
}

.input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

input[type="text"] {
    width: 100%;
    padding: 18px 55px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
    background: var(--input-bg);
    color: var(--text-main);
}

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

input[type="text"]:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(37, 244, 238, 0.15);
}

input[type="text"].invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15);
}

input[type="text"].valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.15);
}

.paste-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--stat-bg);
    border: none;
    cursor: pointer;
    padding: 10px;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.3s;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paste-btn:hover { 
    color: var(--primary-color);
    background: var(--border-color);
}

.download-btn {
    background: linear-gradient(45deg, var(--primary-color), #ff0050);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(254, 44, 85, 0.3);
}

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

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-msg {
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: left;
}

.error-msg.error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.error-msg.warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.error-msg i {
    margin-right: 8px;
}

/* ========== LOADER / PROGRESS BAR ========== */
.loader-container {
    max-width: 600px;
    margin: 0 auto 40px;
    display: none;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-track {
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

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

/* ========== RESULT CONTAINER ========== */
.result-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 50px;
    animation: fadeIn 0.5s ease;
    transition: background-color 0.3s ease;
}

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

/* ========== AUTHOR CARD ========== */
.author-card {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 3px solid var(--secondary-color);
}

.author-details h3 { 
    font-size: 1.1rem; 
    color: var(--text-main); 
}

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

.region-badge {
    display: inline-block;
    background: var(--stat-bg);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-top: 5px;
    font-weight: 700;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 25px;
    text-align: center;
}

.stat-item {
    background: var(--stat-bg);
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-item i { 
    color: var(--primary-color); 
    font-size: 1rem;
}

.stat-item span { 
    font-weight: 600; 
    color: var(--text-main); 
}

/* ========== CONTENT WRAPPER ========== */
.content-wrapper {
    display: flex;
    gap: 30px;
}

.video-preview {
    flex: 1;
    max-width: 300px;
}

.video-preview video {
    width: 100%;
    border-radius: 12px;
    background: #000;
    max-height: 500px;
}

.info-details {
    flex: 2;
    display: flex;
    flex-direction: column;
}

#videoTitle {
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main);
    line-height: 1.4;
}

.meta-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-info i {
    width: 16px;
    text-align: center;
}

/* ========== MUSIC INFO BOX ========== */
.music-info {
    display: flex;
    align-items: center;
    background: var(--music-bg);
    padding: 12px 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid var(--secondary-color);
    transition: background-color 0.3s ease;
}

.icon-music {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.music-text { 
    display: flex; 
    flex-direction: column;
    overflow: hidden;
}

#musicTitle { 
    font-weight: 600; 
    font-size: 0.95rem; 
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-music { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
}

/* ========== ACTION BUTTONS ========== */
.action-buttons {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    gap: 10px;
}

.btn-action.primary {
    background: linear-gradient(45deg, var(--primary-color), #ff3366);
    color: white;
}

.btn-action.secondary {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
}

.btn-action:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

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

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    transition: border-color 0.3s ease;
}

footer strong {
    color: var(--primary-color);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .content-wrapper { 
        flex-direction: column; 
    }
    
    .video-preview { 
        max-width: 100%; 
    }
    
    .hero h1 { 
        font-size: 1.6rem; 
    }
    
    input[type="text"] { 
        padding: 15px 50px 15px 45px; 
        font-size: 0.9rem; 
    }
    
    .download-btn { 
        width: 100%; 
        justify-content: center;
    }
    
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }

    .link-examples {
        flex-direction: column;
    }

    .link-examples code {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.4rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .description {
        font-size: 0.85rem;
    }
    
    .result-container {
        padding: 20px 15px;
    }
    
    .btn-action {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .supported-links {
        padding: 12px 15px;
    }

    .supported-links p {
        font-size: 0.8rem;
    }
}