/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
    background-color: rgba(255,255,255,0.2);
}

/* Main content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Platform cards */
.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.platform-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.platform-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.platform-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.platform-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.platform-card .features {
    list-style: none;
    text-align: left;
    margin-bottom: 2rem;
}

.platform-card .features li {
    padding: 0.3rem 0;
    color: #555;
}

/* Platform specific colors */
.platform-card.youtube { border-top: 4px solid #ff0000; }
.platform-card.instagram { border-top: 4px solid #e4405f; }
.platform-card.facebook { border-top: 4px solid #1877f2; }
.platform-card.tiktok { border-top: 4px solid #000; }

/* Page headers */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 12px;
    color: white;
}

.page-header.youtube { background: linear-gradient(135deg, #ff0000, #cc0000); }
.page-header.instagram { background: linear-gradient(135deg, #e4405f, #833ab4); }
.page-header.facebook { background: linear-gradient(135deg, #1877f2, #42a5f5); }
.page-header.tiktok { background: linear-gradient(135deg, #000, #333); }

.page-header .platform-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Tabs */
.download-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tab-btn {
    background: white;
    border: 2px solid #ddd;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Notice messages */
.notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress Bar */
.progress-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-text {
    color: #333;
    font-size: 1rem;
}

.progress-percentage {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #666;
}

/* Playlist Videos */
.playlist-videos {
    margin-top: 1rem;
}

.playlist-video-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.playlist-video-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.playlist-video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 6px;
    object-fit: cover;
    background: #ddd;
    flex-shrink: 0;
}
.video-thumbnail {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .video-thumbnail {
        max-width: 100%;
    }
}
.playlist-video-info {
    flex: 1;
    min-width: 0;
}

.playlist-video-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-video-details {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.playlist-video-actions {
    flex-shrink: 0;
}

.playlist-download-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
}

.playlist-download-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.playlist-download-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.playlist-download-btn.downloading {
    background: #28a745;
}

.playlist-download-btn.completed {
    background: #28a745;
}

.playlist-download-btn.error {
    background: #dc3545;
}

.playlist-stats {
    background: #e9ecef;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-bulk-actions {
    margin: 1rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bulk-download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Download forms */
.download-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.download-form h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-group input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.input-group button:hover {
    background: #5a67d8;
}

/* Video info */
.video-info {
    margin-bottom: 1.5rem;
}

.video-info.hidden {
    display: none;
}

.info-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.info-card h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.info-card p {
    margin-bottom: 0.5rem;
    color: #666;
}

.format-selector {
    margin-top: 1rem;
}

.format-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.format-selector select {
    width: 100%;
    max-width: 200px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
}

.audio-note {
    font-style: italic;
    color: #667eea !important;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 150px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.loading-indicator.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* How it works section */
.how-it-works {
    margin: 3rem 0;
    text-align: center;
}

.how-it-works h2 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.step {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* Features section */
.features-section {
    margin: 3rem 0;
    text-align: center;
}

.features-section h2 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.feature h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

/* Tips sections */
.youtube-tips,
.instagram-tips,
.facebook-tips,
.tiktok-tips {
    margin-top: 3rem;
}

.youtube-tips h3,
.instagram-tips h3,
.facebook-tips h3,
.tiktok-tips h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tip {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tip h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* URL guide sections */
.how-to-get-url,
.supported-urls,
.quality-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.how-to-get-url h4,
.supported-urls h4,
.quality-info h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.how-to-get-url ol,
.supported-urls ul,
.quality-info ul {
    padding-left: 1.5rem;
}

.how-to-get-url li,
.supported-urls li,
.quality-info li {
    margin-bottom: 0.5rem;
    color: #555;
}

.playlist-preview {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.playlist-item {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

footer p {
    margin-bottom: 0.5rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .platforms-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group button {
        width: 100%;
    }
    
    .download-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .page-header .platform-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .platform-card {
        padding: 1.5rem;
    }
    
    .download-form {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.8rem;
    }
}

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

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}