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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
    25% { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
    50% { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
    75% { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
}

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

/* Header */
header {
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.youtube-logo {
    height: 40px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.converter-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main Content */
main {
    padding: 60px 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 50px;
}

.main-title {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

.subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.2s both;
}

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

/* Converter Card */
.converter-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
    animation: fadeInUp 1s ease 0.4s both;
}

.input-section {
    margin-bottom: 40px;
}

.url-input-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.url-input {
    flex: 1;
    padding: 18px 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.url-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.url-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.convert-button {
    padding: 18px 32px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.3);
}

.convert-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(238, 90, 36, 0.4);
}

.convert-button:active {
    transform: translateY(-1px);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Options Section */
.options-section h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.format-options {
    margin-bottom: 30px;
}

.format-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.format-option:not(.disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.format-option input[type="radio"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.format-option input[type="radio"]:checked + .checkmark {
    border-color: #ff6b6b;
    background: #ff6b6b;
}

.format-option input[type="radio"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.format-text {
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.format-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-left: auto;
}

.premium-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.filename-section {
    margin-top: 30px;
}

.filename-section label {
    display: block;
    color: white;
    margin-bottom: 10px;
    font-weight: 600;
}

.filename-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filename-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.filename-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

/* Progress Container */
.progress-container {
    margin: 40px 0;
    animation: fadeInUp 0.5s ease;
}

.progress-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.progress-header h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.progress-status {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.loading-gif {
    width: 80px;
    height: 80px;
    opacity: 0.8;
}

/* Features Section */
.features-section {
    margin-top: 80px;
    animation: fadeInUp 1s ease 0.6s both;
}

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

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 999;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.modal-header p {
    color: #666;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.file-icon {
    font-size: 2.5rem;
}

.file-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.download-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
}

.download-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.secondary-button {
    padding: 15px 30px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 30px 0;
    margin-top: 80px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .converter-card {
        padding: 25px;
    }
    
    .url-input-container {
        flex-direction: column;
    }
    
    .url-input {
        margin-bottom: 15px;
    }
    
    .convert-button {
        width: 100%;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    header .container {
        flex-direction: column;
        gap: 20px;
    }
    
    nav {
        gap: 20px;
    }
    
    .modal-content {
        padding: 25px;
        margin: 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}