/* ================================================
   Facebook Video Converter - Editorial Design
   ================================================ */

:root {
    /* Colors */
    --color-bg: #FAF9F7;
    --color-card: #FFFFFF;
    --color-text: #1A1A1A;
    --color-text-secondary: #6B6B6B;
    --color-text-tertiary: #9A9A9A;
    --color-border: #E5E3E0;
    --color-accent: #E85D3B;
    --color-accent-hover: #D14F2E;
    --color-accent-light: #FEF4F2;
    --color-success: #2D8A5F;
    --color-success-light: #E8F5EF;
    --color-error: #C93B3B;
    --color-error-light: #FDEEEE;

    /* Typography */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-xl);
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

/* Card */
.card {
    background: var(--color-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

/* States */
.state {
    display: none;
    padding: var(--space-2xl);
}

.state.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

/* Dropzone */
.dropzone {
    width: 100%;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--color-accent);
    background-color: var(--color-accent-light);
}

.dropzone.dragover .dropzone-icon {
    transform: translateY(-4px);
    color: var(--color-accent);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--color-text-tertiary);
    transition: all var(--transition-normal);
}

.dropzone-icon svg {
    width: 100%;
    height: 100%;
}

.dropzone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
}

.dropzone-subtext {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin: calc(var(--space-sm) * -1) 0;
}

.dropzone-hint {
    position: absolute;
    bottom: var(--space-md);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
}

.dropzone-hint .separator {
    opacity: 0.5;
}

/* Progress Section */
.progress-section {
    width: 100%;
    margin-bottom: var(--space-lg);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-weight: 500;
    color: var(--color-text);
}

.progress-value {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-accent);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent) 0%, #F47A5C 100%);
    border-radius: 4px;
    width: 0%;
    transition: width var(--transition-normal);
    position: relative;
}

.progress-bar.processing .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-filename,
.progress-eta {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.progress-eta {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

/* Queue Section */
.queue-section {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.queue-icon {
    width: 56px;
    height: 56px;
    color: var(--color-accent);
    margin: 0 auto var(--space-md);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.queue-icon svg {
    width: 100%;
    height: 100%;
}

.queue-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.queue-position {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-accent);
    margin-bottom: var(--space-xs);
}

.queue-message {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Complete Section */
.complete-section {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.complete-icon {
    width: 64px;
    height: 64px;
    color: var(--color-success);
    margin: 0 auto var(--space-md);
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.complete-icon svg {
    width: 100%;
    height: 100%;
}

.complete-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-success);
    margin-bottom: var(--space-xs);
}

.complete-message {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.complete-actions {
    display: flex;
    gap: var(--space-sm);
    width: 100%;
    margin-bottom: var(--space-md);
}

.complete-actions .btn {
    flex: 1;
}

/* Error Section */
.error-section {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.error-icon {
    width: 64px;
    height: 64px;
    color: var(--color-error);
    margin: 0 auto var(--space-md);
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.error-icon svg {
    width: 100%;
    height: 100%;
}

.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-error);
    margin-bottom: var(--space-xs);
}

.error-message {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    max-width: 280px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-text {
    background: transparent;
    color: var(--color-text-secondary);
    padding: var(--space-sm) var(--space-md);
}

.btn-text:hover {
    color: var(--color-text);
}

.btn-cancel {
    width: 100%;
}

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

.btn-download:hover {
    background: #247A52;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-md);
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.footer p {
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

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

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

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

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: var(--space-md);
    }

    .header {
        padding: var(--space-xl) 0 var(--space-lg);
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .state {
        padding: var(--space-xl) var(--space-lg);
    }

    .complete-actions {
        flex-direction: column;
    }

    .complete-actions .btn {
        width: 100%;
    }
}

/* Focus States */
.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.dropzone:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--color-accent-light);
    color: var(--color-accent);
}
