/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

/* Notification Container */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    animation: slideIn 0.3s ease forwards;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.notification.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #fff, #f0fdf4);
}

.notification.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fff, #fef2f2);
}

.notification.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #fff, #eff6ff);
}

.notification.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fff, #fffbeb);
}

.notification-icon {
    font-size: 24px;
    line-height: 1;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #1f2937;
}

.notification-message {
    font-size: 0.85rem;
    color: #6b7280;
}

.notification-close {
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    transition: color 0.2s;
    padding: 0 5px;
}

.notification-close:hover {
    color: #4b5563;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Theme toggle button */
#theme-toggle {
    background: #ff6b6b;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
    margin-left: 20px;
}

#theme-toggle:hover {
    background: #f06595;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

/* Dark Theme */
body.dark-theme {
    background: #1a1a1a;
    color: #f1f1f1;
}

body.dark-theme header {
    background: #111;
    color: #ff6b6b;
}

body.dark-theme .upload-section,
body.dark-theme .features .card,
body.dark-theme .instructions,
body.dark-theme footer {
    background: #222;
    color: #f1f1f1;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

body.dark-theme #drop-area {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: #333;
}

body.dark-theme button,
body.dark-theme #download-btn,
body.dark-theme .reset-btn {
    background: #ff6b6b;
    color: #fff;
}

body.dark-theme button:hover,
body.dark-theme #download-btn:hover,
body.dark-theme .reset-btn:hover {
    background: #f06595;
}

body.dark-theme footer a {
    color: #ff6b6b;
}

body.dark-theme .notification {
    background: #2d2d2d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-theme .notification-title {
    color: #f1f1f1;
}

body.dark-theme .notification-message {
    color: #aaa;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    font-weight: bold;
    font-size: 1.8rem;
    color: #ff6b6b;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 20px;
}

/* Upload Section */
.upload-section {
    background: #fff;
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    margin-bottom: 60px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-section:hover {
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.15);
}

.upload-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

body.dark-theme .upload-section h2 {
    color: #f1f1f1;
}

.upload-section p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1rem;
}

body.dark-theme .upload-section p {
    color: #ccc;
}

/* Drop area */
#drop-area {
    border: 2px dashed #ff6b6b;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 107, 107, 0.02);
}

#drop-area:hover {
    background: rgba(255, 107, 107, 0.05);
    transform: scale(1.02);
}

#drop-area.dragover {
    background: #ffe6e6;
    border-color: #f06595;
    transform: scale(1.02);
}

#drop-area p {
    color: #ff6b6b;
    font-weight: 500;
    font-size: 1.1rem;
}

#drop-area input[type="file"] {
    display: none;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Reset Button */
.reset-btn {
    background: #6c757d !important;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3) !important;
}

.reset-btn:hover {
    background: #5a6268 !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4) !important;
}

body.dark-theme .reset-btn {
    background: #4a4e54 !important;
}

body.dark-theme .reset-btn:hover {
    background: #3a3e44 !important;
}

/* Progress Bar */
#progress-container {
    margin: 20px 0;
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #f06595);
    border-radius: 15px;
    transition: width 0.3s ease;
    width: 0%;
}

#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
    z-index: 1;
}

body.dark-theme #progress-container {
    background: #3a3a3a;
}

body.dark-theme #progress-text {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Format Selector */
#format-selector {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#format-selector label {
    color: #ff6b6b;
    font-weight: 500;
}

#audio-format {
    padding: 8px 15px;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    background: white;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

#audio-format:hover {
    background: #fff0f0;
}

body.dark-theme #format-selector {
    background: rgba(255, 107, 107, 0.2);
}

body.dark-theme #audio-format {
    background: #333;
    color: #f1f1f1;
    border-color: #ff6b6b;
}

/* Buttons */
.upload-section button, #download-btn {
    background: #ff6b6b;
    color: #fff;
    border: none;
    padding: 14px 35px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.upload-section button:hover, #download-btn:hover {
    background: #f06595;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.upload-section button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Features */
.features {
    text-align: center;
    margin-bottom: 60px;
}

.features h3 {
    margin-bottom: 30px;
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
}

body.dark-theme .features h3 {
    color: #f1f1f1;
}

.feature-cards {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.card {
    background: #fff;
    padding: 30px 20px;
    border-radius: 20px;
    width: 250px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 35px rgba(255, 107, 107, 0.2);
}

.card h4 {
    color: #ff6b6b;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.card p {
    color: #666;
}

body.dark-theme .card p {
    color: #ccc;
}

/* Instructions */
.instructions {
    text-align: center;
    margin-bottom: 60px;
    padding: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.instructions h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
    font-weight: 600;
}

body.dark-theme .instructions h3 {
    color: #f1f1f1;
}

.instructions ol {
    display: inline-block;
    text-align: left;
    color: #666;
    list-style: none;
    counter-reset: step-counter;
}

.instructions li {
    margin-bottom: 15px;
    font-size: 1.1rem;
    counter-increment: step-counter;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions li span {
    background: #ff6b6b;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

body.dark-theme .instructions li {
    color: #ccc;
}

/* Footer */
footer {
    background: #fff;
    text-align: center;
    padding: 30px 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

footer a {
    color: #ff6b6b;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    color: #f06595;
}

/* Audio container */
#audio-container {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 16px;
    transition: opacity 0.3s ease;
}

#audio-container h4 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

#audio-player {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
}

/* Focus states for accessibility */
button:focus-visible, 
#theme-toggle:focus-visible, 
#drop-area:focus-visible {
    outline: 3px solid #ff6b6b;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        font-size: 1.4rem;
        padding: 30px 15px;
    }
    
    .upload-section {
        padding: 30px 20px;
    }
    
    .upload-section h2 {
        font-size: 1.6rem;
    }
    
    .card {
        width: 100%;
        max-width: 300px;
    }
    
    #theme-toggle {
        margin-left: 10px;
        padding: 6px 12px;
    }
    
    #notification-container {
        max-width: 300px;
        right: 10px;
        top: 10px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-group button {
        width: 100%;
    }
}