* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.input-section {
    margin-bottom: 30px;
}

.url-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#videoUrl {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#videoUrl:focus {
    outline: none;
    border-color: #667eea;
}

#getInfoBtn {
    padding: 15px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#getInfoBtn:hover {
    background: #5a67d8;
}

#getInfoBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.video-info {
    margin-bottom: 30px;
}

.info-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #f9f9f9;
}

.info-card img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.info-details {
    flex: 1;
}

.info-details h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3em;
}

.info-details p {
    margin-bottom: 10px;
    color: #666;
}

.download-btn {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.download-btn:hover {
    background: #218838;
}

.download-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.progress-section {
    margin-bottom: 30px;
}

.progress-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    color: #666;
    font-size: 14px;
}

.video-player-section {
    margin-bottom: 30px;
}

.video-player-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#player {
    width: 100%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.player-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.player-controls button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.player-controls button:hover {
    background: #5a67d8;
}

.error-message {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .url-input-container {
        flex-direction: column;
    }
    
    .info-card {
        flex-direction: column;
    }
    
    .info-card img {
        width: 100%;
        height: 200px;
    }
    
    .player-controls {
        flex-direction: column;
    }
}

/* Loading animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
