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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    animation: fadeInUp 0.6s ease;
}

.converter-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-bottom: 40px;
}

.input-group {
    position: relative;
    margin-bottom: 30px;
}

#videoUrl {
    width: 100%;
    padding: 18px 50px 18px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    outline: none;
}

#videoUrl:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #666;
}

.clear-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.clear-btn.visible {
    display: flex;
}

.format-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.format-option {
    cursor: pointer;
}

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

.format-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    background: #fafafa;
}

.format-option input[type="radio"]:checked + .format-card {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    transform: scale(1.05);
}

.format-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.format-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.format-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.format-desc {
    color: #666;
    font-size: 0.9em;
}

.convert-btn {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

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

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status {
    margin-top: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    color: #1976d2;
    animation: slideIn 0.3s ease;
}

.error {
    margin-top: 20px;
    padding: 15px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 8px;
    color: #c62828;
    animation: slideIn 0.3s ease;
}

.video-info {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
    animation: slideIn 0.4s ease;
}

.video-info img {
    width: 180px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.info-details {
    flex: 1;
}

.info-details h3 {
    margin-bottom: 8px;
    color: #333;
    font-size: 1.1em;
}

.info-details p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.download-section {
    margin-top: 30px;
    animation: slideIn 0.4s ease;
}

.download-btn {
    display: inline-block;
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    text-decoration: none;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.4);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
}

.feature h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.feature p {
    color: #666;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    opacity: 0.8;
}

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .converter-box {
        padding: 25px;
    }
    
    .format-selector {
        grid-template-columns: 1fr;
    }
    
    .video-info {
        flex-direction: column;
    }
    
    .video-info img {
        width: 100%;
        height: auto;
    }
}