/* ═══════════════════════════════════════════════════════════════════════
   TikTok Anti Burik — Clean Bootstrap 5 Light Theme (Fully Responsive)
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── CSS Variables (Bootstrap 5 Light Palette) ─────────────────────── */
:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-input: #f8f9fa;

    --border-color: #dee2e6;
    --border-color-hover: #ced4da;
    --border-accent: #0d6efd;

    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #8c98a4;

    --accent-blue: #0d6efd;
    --accent-blue-hover: #0b5ed7;
    --accent-cyan: #0dcaf0;
    --accent-green: #198754;
    --accent-red: #dc3545;
    --accent-orange: #fd7e14;

    --btn-primary-bg: #0d6efd;
    --btn-primary-hover: #0b5ed7;
    --btn-primary-active: #0a58ca;

    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.12);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.2s ease-in-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 0 40px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ─── Hide Glow Orbs for Clean Light Look ──────────────────────────── */
.bg-glow {
    display: none !important;
}

/* ─── Main Container ───────────────────────────────────────────────── */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 660px;
    margin: auto 0;
    padding: 16px 16px 24px;
    box-sizing: border-box;
}

/* ─── Header / Brand ────────────────────────────────────────────────── */
.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background-color: var(--btn-primary-bg);
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

.app-logo svg {
    width: 26px;
    height: 26px;
    fill: #ffffff;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.app-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.global-stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 12px;
    background: #e7f1ff;
    border: 1px solid #b6d4fe;
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    display: inline-block;
    box-shadow: 0 0 0 rgba(13, 110, 253, 0.4);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

/* ─── Cards (Bootstrap 5 Style) ─────────────────────────────────────── */
.glass-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
    overflow: hidden;
    box-sizing: border-box;
}

.glass-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

/* ─── Upload Zone ───────────────────────────────────────────────────── */
.upload-zone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 36px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: #f8fafc;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--accent-blue);
    background: #f1f5f9;
}

.upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: #e7f1ff;
    transform: scale(1.005);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e7f1ff;
    color: var(--accent-blue);
    transition: transform var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    transform: translateY(-2px);
    background: #d0e2ff;
}

.upload-icon svg {
    width: 24px;
    height: 24px;
}

.upload-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.upload-browse-btn {
    display: inline-block;
    padding: 8px 22px;
    background-color: var(--btn-primary-bg);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.upload-browse-btn:hover {
    background-color: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: #ffffff;
}

.upload-formats {
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.upload-formats span {
    display: inline-block;
    padding: 2px 7px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 2px 2px;
    font-weight: 500;
    color: #495057;
}

/* ─── Upload Progress ───────────────────────────────────────────────── */
.upload-progress-wrapper {
    margin-top: 16px;
    display: none;
}

.upload-progress-wrapper.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.upload-filename {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-filename .file-icon {
    color: var(--accent-blue);
    flex-shrink: 0;
}

/* ─── Progress Bar (Bootstrap 5 Style) ─────────────────────────────── */
.progress-container {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background-color: var(--btn-primary-bg);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.progress-percent {
    font-weight: 600;
    color: var(--accent-blue);
}

/* ─── Section Cards ─────────────────────────────────────────────────── */
.section-card {
    margin-top: 16px;
    animation: slideUp 0.3s ease;
}

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

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

.section-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ─── File Header Row (No Overlap) ─────────────────────────────────── */
.file-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.file-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.file-title-icon {
    flex-shrink: 0;
    color: var(--accent-blue);
}

.file-title-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.bypass-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ─── Video Preview ─────────────────────────────────────────────────── */
.video-preview {
    width: 100%;
    max-height: 320px;
    border-radius: var(--radius-md);
    background: #000;
    margin-bottom: 14px;
    overflow: hidden;
}

.video-preview video {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    display: block;
}

/* ─── Metadata Grid ─────────────────────────────────────────────────── */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.meta-item {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
}

.meta-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-value.accent {
    color: var(--accent-blue);
}

/* ─── Action Buttons (Blue Standard) ────────────────────────────────── */
.btn-primary-action,
.btn-super-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background-color: var(--btn-primary-bg);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
    text-decoration: none;
    box-sizing: border-box;
}

.btn-primary-action:hover:not(:disabled),
.btn-super-action:hover:not(:disabled) {
    background-color: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary-action:active:not(:disabled),
.btn-super-action:active:not(:disabled) {
    background-color: var(--btn-primary-active);
    border-color: var(--btn-primary-active);
}

.btn-primary-action:disabled,
.btn-super-action:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background-color: var(--btn-primary-bg);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--btn-primary-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
    text-decoration: none;
    box-sizing: border-box;
}

.btn-download:hover {
    background-color: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-new {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 9px 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    box-sizing: border-box;
}

.btn-new:hover {
    border-color: var(--border-color-hover);
    background: #f8f9fa;
    color: var(--text-primary);
}

/* ─── Processing State ──────────────────────────────────────────────── */
.processing-card {
    text-align: center;
}

.processing-status {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.processing-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ─── Complete Card ─────────────────────────────────────────────────── */
.complete-header {
    text-align: center;
    margin-bottom: 16px;
}

.complete-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #d1e7dd;
    border: 1px solid #badbcc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    position: relative;
    overflow: hidden;
}

.complete-icon::before,
.complete-icon::after {
    content: none !important;
    display: none !important;
}

.complete-icon svg {
    width: 24px;
    height: 24px;
    color: #0f5132;
    fill: currentColor;
    display: block;
}

.complete-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f5132;
    margin-bottom: 2px;
}

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

.output-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.comparison-col {
    text-align: center;
}

.comparison-col .comp-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.comparison-col .comp-size {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.comparison-arrow {
    font-size: 1.2rem;
    color: var(--accent-blue);
    font-weight: 700;
}

.size-change {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 3px;
}

.size-change.reduced {
    background: #d1e7dd;
    color: #0f5132;
}

.size-change.increased {
    background: #fff3cd;
    color: #664d03;
}

/* ─── Toast Notifications (Bootstrap Toast Style) ──────────────────── */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
}

.toast {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
    transition: all 0.2s ease;
    min-width: 260px;
}

.toast.removing {
    animation: toastOut 0.2s ease forwards;
}

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

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast.success .toast-icon {
    background: #d1e7dd;
    color: #0f5132;
}

.toast.error .toast-icon {
    background: #f8d7da;
    color: #842029;
}

.toast.info .toast-icon {
    background: #cff4fc;
    color: #055160;
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1px;
}

.toast-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    font-size: 1rem;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

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

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(13, 110, 253, 0.25);
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.app-footer {
    text-align: center;
    padding: 20px 16px 24px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.app-footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* ─── Responsive (Mobile Compact Mode) ────────────────────────────────── */
@media (max-width: 576px) {
    body {
        padding: 10px 0 24px;
    }

    .app-container {
        padding: 8px 10px 16px;
    }

    .app-header {
        margin-bottom: 14px;
    }

    .app-logo {
        width: 42px;
        height: 42px;
        border-radius: var(--radius-sm);
        margin-bottom: 6px;
    }

    .app-logo svg {
        width: 20px;
        height: 20px;
    }

    .app-title {
        font-size: 1.3rem;
        margin-bottom: 2px;
    }

    .app-subtitle {
        font-size: 0.78rem;
    }

    .glass-card {
        padding: 12px 10px;
        border-radius: 8px;
    }

    .file-header-row {
        gap: 6px;
    }

    .file-title-text {
        font-size: 0.82rem;
    }

    .bypass-badge {
        padding: 2px 7px;
        font-size: 0.68rem;
    }

    .upload-zone {
        padding: 20px 8px;
        border-radius: 8px;
    }

    .upload-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 6px;
    }

    .upload-icon svg {
        width: 18px;
        height: 18px;
    }

    .upload-title {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }

    .upload-text {
        font-size: 0.74rem;
        margin-bottom: 8px;
    }

    .upload-browse-btn {
        padding: 6px 14px;
        font-size: 0.78rem;
    }

    .upload-formats {
        margin-top: 8px;
        font-size: 0.68rem;
    }

    .upload-formats span {
        padding: 1px 4px;
        margin: 1px;
        font-size: 0.65rem;
    }

    .section-card {
        margin-top: 10px;
    }

    .video-preview {
        max-height: 200px;
        margin-bottom: 8px;
        border-radius: 6px;
    }

    .video-preview video {
        max-height: 200px;
    }

    .metadata-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .meta-item {
        padding: 6px 8px;
        border-radius: 6px;
    }

    .meta-label {
        font-size: 0.62rem;
    }

    .meta-value {
        font-size: 0.8rem;
    }

    .btn-primary-action,
    .btn-super-action,
    .btn-download {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 6px;
        gap: 6px;
    }

    .btn-super-action svg,
    .btn-download svg {
        width: 16px;
        height: 16px;
    }

    .btn-new {
        padding: 7px 12px;
        font-size: 0.75rem;
        margin-top: 6px;
        border-radius: 6px;
    }

    .processing-card {
        padding: 14px 10px;
    }

    .processing-status {
        font-size: 0.88rem;
    }

    .processing-detail {
        font-size: 0.72rem;
        margin-bottom: 10px;
    }

    .progress-container {
        height: 7px;
    }

    .progress-text {
        font-size: 0.7rem;
    }

    .complete-header {
        margin-bottom: 10px;
    }

    .complete-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 6px;
    }

    .complete-icon svg {
        width: 18px;
        height: 18px;
    }

    .complete-title {
        font-size: 0.95rem;
    }

    .complete-subtitle {
        font-size: 0.72rem;
    }

    .output-comparison {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
        margin-bottom: 12px;
    }

    .comparison-arrow {
        display: none !important;
    }

    .size-change {
        font-size: 0.65rem;
        padding: 1px 5px;
    }

    .toast-container {
        top: 8px;
        left: 8px;
        right: 8px;
        max-width: none;
    }

    .toast {
        padding: 6px 8px;
        min-width: auto;
    }

    .toast-title {
        font-size: 0.75rem;
    }

    .toast-message {
        font-size: 0.7rem;
    }

    .app-footer {
        padding: 14px 8px 20px;
        font-size: 0.7rem;
    }
}