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

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd8;
    --secondary: #764ba2;
    --success: #2ed573;
    --warning: #ffa502;
    --danger: #ff4757;
    --dark: #2f3542;
    --light: #f1f2f6;
    --white: #ffffff;
    --gray: #57606f;
    --border: #e0e6ed;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-radius: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: var(--white);
    padding: 30px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 30px;
}

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

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 2.5rem;
    color: var(--dark);
    font-weight: 700;
}

.tagline {
    color: var(--gray);
    font-size: 1.1rem;
    margin-left: 10px;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    color: var(--primary);
}

.step.completed {
    opacity: 1;
    color: var(--success);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary);
    color: var(--white);
}

.step.completed .step-number {
    background: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Add connecting lines between steps */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: -1;
}

.step.completed:not(:last-child)::after {
    background: var(--success);
}

/* Main Content */
.main-content {
    margin-bottom: 30px;
}

.step-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

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

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

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 40px;
}

.card h2 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card h2 i {
    color: var(--primary);
}

.step-description {
    color: var(--gray);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.input-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-help {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-help i {
    color: var(--primary);
}

/* URL Type Info */
.url-type-info {
    margin: 20px 0;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.url-type-info.hidden {
    display: none;
}

.type-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dark);
}

.type-badge i {
    color: var(--primary);
}

/* Playlist Choice */
.playlist-choice-container {
    border-left: 4px solid var(--primary);
    background: #f8f9ff;
}

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

.playlist-info {
    margin-bottom: 20px;
}

.playlist-info i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.playlist-info strong {
    display: block;
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.playlist-info p {
    color: var(--gray);
    margin-bottom: 0;
}

.playlist-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.playlist-choice-btn {
    flex: 1;
    max-width: 200px;
}

/* Temporary Message */
.temp-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease-out;
}

.temp-message.info {
    background: var(--primary);
}

.temp-message.warning {
    background: var(--warning);
}

.temp-message.error {
    background: var(--danger);
}

.temp-message.success {
    background: var(--success);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Disabled Type Card */
.type-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.type-card.disabled:hover {
    border-color: var(--border);
    transform: none;
    box-shadow: none;
}

.type-card.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(240, 240, 240, 0.5);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

.coming-soon {
    margin: 10px 0;
    position: relative;
    z-index: 2;
}

.coming-soon-badge {
    background: var(--warning);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

/* Quality Settings */
.quality-settings {
    margin-bottom: 30px;
}

.quality-settings.hidden {
    display: none;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Download Summary */
.download-summary {
    background: var(--light);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.download-summary h3 {
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-summary h3 i {
    color: var(--primary);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: var(--dark);
}

.summary-item span {
    color: var(--gray);
    font-weight: 500;
}

/* Download Controls */
.download-controls {
    text-align: center;
    margin-bottom: 30px;
}

/* Download Status */
.download-status {
    margin-bottom: 30px;
}

.download-status.hidden {
    display: none;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.status-message i {
    color: var(--primary);
}

.status-message.success {
    background: rgba(46, 213, 115, 0.1);
    color: var(--success);
}

.status-message.success i {
    color: var(--success);
}

.status-message.error {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

.status-message.error i {
    color: var(--danger);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--dark);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: #495057;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #26d366;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.step-navigation .btn + .btn {
    margin-left: 15px;
}

/* Footer */
.footer {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.footer-content p {
    color: var(--gray);
    margin-bottom: 5px;
}

.footer-content strong {
    color: var(--dark);
}

/* Playlist Choice Dialog */
.playlist-choice-dialog {
    margin: 20px 0;
    padding: 25px;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

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

.dialog-content h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dialog-content h3 i {
    color: var(--primary);
}

.dialog-content p {
    color: var(--gray);
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.choice-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.choice-buttons .btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.choice-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.choice-buttons .btn i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.dialog-info {
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
    color: var(--gray);
}

.dialog-info i {
    color: var(--primary);
    margin-right: 5px;
}

/* Type Selection */
.type-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.type-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
    position: relative;
}

.type-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.type-card.selected {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.type-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.5rem;
}

.type-card.selected .type-icon {
    background: var(--primary);
    color: var(--white);
}

.type-card h3 {
    margin-bottom: 10px;
    color: var(--dark);
    font-size: 1.3rem;
}

.type-card p {
    color: var(--gray);
    margin-bottom: 15px;
}

.type-card ul {
    list-style: none;
    text-align: left;
}

.type-card li {
    padding: 4px 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.type-card li:before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
    margin-right: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 25px;
    }
    
    .progress-steps {
        padding: 15px;
    }
    
    .step-label {
        font-size: 0.8rem;
    }
    
    .type-selection {
        grid-template-columns: 1fr;
    }
    
    .settings-row {
        grid-template-columns: 1fr;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .step-navigation .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .progress-steps {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .step {
        flex-basis: calc(50% - 7.5px);
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in {
    animation: slideIn 0.5s ease-in-out;
}

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

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

.visible {
    display: block !important;
}

/* Dialog Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog {
    background: var(--white);
    border-radius: var(--card-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.dialog-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid var(--border);
}

.dialog-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.2rem;
}

.dialog-header i {
    color: var(--primary);
    margin-right: 8px;
}

.dialog-content {
    padding: 25px;
}

.dialog-info {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--dark);
}

.dialog-info i {
    color: var(--primary);
    margin-right: 8px;
}

.choice-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.dialog-footer {
    padding: 15px 25px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

@media (max-width: 480px) {
    .choice-buttons {
        grid-template-columns: 1fr;
    }
}
