@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* --- DESIGN SYSTEM TOKENS --- */
:root {
    --bg-dark: #09090c;
    --bg-surface: rgba(18, 18, 24, 0.7);
    --bg-card: rgba(26, 26, 36, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(139, 92, 246, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    
    --glow-purple: rgba(139, 92, 246, 0.15);
    
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #3b82f6 100%);
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(217, 70, 239, 0.3) 50%, rgba(59, 130, 246, 0.3) 100%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Glowing Orbs */
body::before, body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}
body::before {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
}
body::after {
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* --- LAYOUT --- */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 0.5rem;
    position: relative;
}

.logo::after {
    content: 'Discord Ready';
    position: absolute;
    bottom: -12px;
    right: 0;
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    -webkit-text-fill-color: var(--accent-blue);
    opacity: 0.8;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.8rem;
}

/* --- GLASS CARD MAIN CONTAINER --- */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 2rem;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

/* --- DRAG & DROP ZONE --- */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-card);
    transition: all var(--transition-normal);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.04);
    box-shadow: 0 0 30px var(--glow-purple);
    transform: translateY(-2px);
}

.upload-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-purple);
    transition: all var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    background: var(--gradient-primary);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    transform: rotate(-10deg) scale(1.1);
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.upload-text-main {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-text-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-limits {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

#fileInput {
    display: none;
}

/* --- PROGRESS BAR --- */
.progress-container {
    margin-top: 2rem;
    display: none;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

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

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* --- SUCCESS / RESULT VIEW --- */
.result-container {
    margin-top: 2rem;
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.success-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.share-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.share-box {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    align-items: center;
}

.share-url {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    outline: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.btn {
    background: var(--gradient-primary);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
    opacity: 0.95;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.btn-copy {
    padding: 0.6rem 1.2rem;
    min-width: 100px;
    justify-content: center;
}

.copy-success {
    background: var(--accent-green) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* --- HISTORIQUE --- */
.history-section {
    margin-top: 3rem;
    animation: fadeInUp 1s ease-out;
}

.history-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-title svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    color: var(--accent-purple);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.history-item {
    background: var(--bg-surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all var(--transition-normal);
}

.history-item:hover {
    border-color: var(--accent-purple);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.history-preview {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.history-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.history-preview svg {
    position: absolute;
    width: 32px;
    height: 32px;
    fill: var(--text-secondary);
    z-index: 1;
}

.history-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.history-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.history-actions a, .history-actions button {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.5rem;
    justify-content: center;
    border-radius: 8px;
}

/* --- WATCH PAGE SPECIFIC --- */
.watch-container {
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
}

.video-info {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.video-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.video-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.video-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.video-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    flex-wrap: wrap;
}

.video-actions .btn {
    flex: 1;
    min-width: 180px;
    justify-content: center;
}

.discord-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(88, 101, 242, 0.1);
    color: #5865F2;
    border: 1px solid rgba(88, 101, 242, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    align-self: flex-start;
}

.discord-badge svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Empty State */
.empty-history {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer styling */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-purple);
}

/* --- ANIMATIONS --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive adjustments */
@media (max-width: 640px) {
    .card {
        padding: 1.5rem;
    }
    .upload-zone {
        padding: 2.5rem 1rem;
    }
    .video-info {
        padding: 1.25rem;
    }
    .video-title {
        font-size: 1.25rem;
    }
}
