* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0066FF;
    --primary-red: #FF0050;
    --primary-black: #000000;
    --primary-white: #FFFFFF;
    --dark-gray: #121212;
    --light-gray: #f8f9fa;
    --border-gray: #e1e5e9;
    --text-dark: #333333;
    --text-light: #666666;
    --success-green: #4CAF50;
    --error-red: #f44336;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--dark-gray) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.app-header {
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 3px solid var(--primary-red);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.logo h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    color: var(--primary-white);
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* Download Card */
.download-card {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    border: 2px solid var(--primary-blue);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 2rem;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
}

.card-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Input Section */
.input-section {
    margin-bottom: 1.5rem;
}

.url-input-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.url-input {
    width: 100%;
    padding: 1.2rem;
    border: 2px solid var(--border-gray);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light-gray);
    padding-right: 3rem;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    background: var(--primary-white);
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: var(--border-gray);
    color: var(--primary-red);
}

/* Download Button */
.download-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-red));
    color: var(--primary-white);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 0, 80, 0.3);
    background: linear-gradient(45deg, var(--primary-red), var(--primary-blue));
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-btn.loading {
    background: linear-gradient(45deg, #666, #888);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.download-icon {
    font-size: 1.2rem;
}

/* Error Message */
.error-message {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: var(--primary-white);
    padding: 1.2rem;
    border-radius: 12px;
    border-left: 4px solid #ff4757;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-icon {
    font-size: 1.2rem;
}

/* Result Section */
.result-section {
    border-top: 2px solid var(--border-gray);
    padding-top: 2rem;
}

.success-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.success-icon {
    font-size: 1.5rem;
}

.success-header h3 {
    color: var(--primary-black);
    font-size: 1.5rem;
}

.video-preview {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 12px;
}

.thumbnail {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    border: 2px solid var(--primary-blue);
}

.video-info h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-black);
}

.video-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.video-meta span {
    padding: 0.3rem 0.8rem;
    background: var(--primary-white);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.quality-badge {
    background: var(--primary-blue) !important;
    color: var(--primary-white) !important;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 160px;
}

.action-btn.primary {
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-red));
    color: var(--primary-white);
}

.action-btn.secondary {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.action-btn.primary:hover {
    background: linear-gradient(45deg, var(--primary-red), var(--primary-blue));
}

.action-btn.secondary:hover {
    background: var(--primary-blue);
    color: var(--primary-white);
}

.btn-icon {
    font-size: 1.1rem;
}

/* Features Section */
.features-section {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    border: 2px solid var(--primary-red);
}

.features-section h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: var(--primary-black);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid var(--border-gray);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-black);
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Instructions Section */
.instructions-section {
    background: var(--primary-white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-blue);
}

.instructions-section h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: var(--primary-black);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-red));
    color: var(--primary-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 1rem auto;
}

.step p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Footer */
.app-footer {
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 2rem 1rem;
    text-align: center;
    border-top: 3px solid var(--primary-red);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 1.5rem 1rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .app-main {
        padding: 1rem;
    }
    
    .download-card {
        padding: 1.5rem;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .thumbnail {
        width: 100%;
        max-width: 250px;
        height: auto;
        margin: 0 auto;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
    
    .download-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .download-card,
    .features-section,
    .instructions-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .download-btn,
    .action-btn {
        display: none;
    }
}