/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #0b0f19;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Orbs */
.glass-bg-blur {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(0, 0, 0, 0) 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    filter: blur(80px);
    pointer-events: none;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem 1.5rem;
    z-index: 10;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.icon-logo {
    font-size: 2.2rem;
    color: #ef4444;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 50%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 span {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Main Card */
.main-card {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Common Input Style & Form */
.input-section {
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.5rem 0.5rem 0.5rem 1.2rem;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.input-icon {
    color: #64748b;
    font-size: 1.2rem;
    margin-right: 0.8rem;
}

#youtube-url {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 1rem;
    padding: 0.5rem 0;
}

#youtube-url::placeholder {
    color: #64748b;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    outline: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.8rem 1.8rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
    transform: translateY(-2px);
}

.btn-icon-round {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.btn-icon-round:hover {
    background: #6366f1;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Progress Section */
.progress-section {
    margin-top: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.2rem;
    animation: fadeIn 0.4s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

#progress-percent {
    font-weight: 700;
    color: #818cf8;
}

.progress-bar-wrapper {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #c084fc);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Editor Section */
.editor-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 2rem;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-header {
    margin-bottom: 1.5rem;
}

.editor-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-header h2 i {
    color: #c084fc;
}

.editor-header p {
    font-size: 0.88rem;
    color: #64748b;
}

/* Waveform Box */
.waveform-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    min-height: 128px;
}

#waveform {
    width: 100%;
}

.waveform-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.waveform-loading i {
    color: #6366f1;
}

/* Editor Controls */
.editor-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.time-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.time-field label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.time-field input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    width: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.time-field input:focus {
    border-color: #6366f1;
}

.time-duration {
    font-size: 0.9rem;
    color: #cbd5e1;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-top: 1.2rem;
}

.time-duration strong {
    color: #818cf8;
}

.play-controls {
    display: flex;
    gap: 0.8rem;
}

/* Action Buttons Container */
.action-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.action-section .btn {
    padding: 1rem;
    font-size: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-left: 4px solid #6366f1;
    color: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 100;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-error {
    border-left-color: #ef4444;
}

.toast.toast-success {
    border-left-color: #10b981;
}

.toast-icon {
    font-size: 1.2rem;
    color: #818cf8;
}

.toast.toast-error .toast-icon {
    color: #ef4444;
}

.toast.toast-success .toast-icon {
    color: #10b981;
}

/* Helper Classes & Animations */
.hidden {
    display: none !important;
}

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

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

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

/* Responsive Grid */
@media (max-width: 640px) {
    .action-section {
        grid-template-columns: 1fr;
    }
    
    .editor-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .time-controls {
        justify-content: space-between;
    }
    
    .play-controls {
        justify-content: center;
    }
}
