/* FireTube Web App Styles */

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

:root {
    --color-bg: #0f1117;
    --color-surface: #181b25;
    --color-surface-alt: #1f2230;
    --color-divider: rgba(255, 255, 255, 0.06);
    --color-text-primary: #f7f9ff;
    --color-text-secondary: rgba(247, 249, 255, 0.65);
    --color-accent-start: #ff512f;
    --color-accent-end: #dd2476;
    --color-accent: #ff466d;
    --color-success: #17c964;
    --color-warning: #f5a524;
    --color-danger: #f31260;
    --color-info: #0072f5;
    --gradient-accent: linear-gradient(140deg, var(--color-accent-start), var(--color-accent-end));
    --shadow-soft: 0 24px 48px rgba(13, 15, 28, 0.36);
    --shadow-inner: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-base: all 0.25s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top left, rgba(221, 36, 118, 0.35), transparent 45%),
                radial-gradient(circle at bottom right, rgba(255, 81, 47, 0.25), transparent 40%),
                var(--color-bg);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(16, 18, 28, 0.85);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--color-divider);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    overflow: hidden;
}

.sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255, 81, 47, 0.35), transparent 65%);
    opacity: 0.45;
    pointer-events: none;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.sidebar__brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--gradient-accent);
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-soft);
}

.sidebar__brand-logo img {
    width: 26px;
    height: 26px;
}

.sidebar__brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar__section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.sidebar__nav {
    display: grid;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.sidebar__nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: var(--transition-base);
    position: relative;
}

.sidebar__nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    opacity: 0;
    transition: var(--transition-base);
}

.sidebar__nav-link:hover {
    color: var(--color-text-primary);
    transform: translateX(4px);
}

.sidebar__nav-link:hover::before {
    opacity: 1;
}

.sidebar__nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar__nav-link.active {
    color: var(--color-text-primary);
    background: rgba(255, 81, 47, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 81, 47, 0.3);
}

.sidebar__nav-link.active::before {
    opacity: 1;
    background: rgba(221, 36, 118, 0.25);
}

.sidebar__footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--color-divider);
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    position: relative;
    z-index: 1;
}

.sidebar__logout {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 70, 109, 0.15);
    box-shadow: inset 0 0 0 1px rgba(255, 70, 109, 0.35);
    transition: var(--transition-base);
}

.sidebar__logout:hover {
    color: var(--color-text-primary);
    transform: translateX(4px);
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    position: sticky;
    top: 0;
    backdrop-filter: blur(16px);
    background: linear-gradient(90deg, rgba(16, 18, 28, 0.92), rgba(16, 18, 28, 0.75));
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 100;
}

.topbar__title {
    font-size: 1.4rem;
    font-weight: 600;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chip {
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chip--accent {
    background: rgba(255, 81, 47, 0.18);
    color: var(--color-text-primary);
}

.w-100 {
    width: 100%;
}

.text-small {
    font-size: 0.76rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(140deg, rgba(255, 81, 47, 0.85), rgba(221, 36, 118, 0.85));
    display: grid;
    place-items: center;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: white;
    box-shadow: var(--shadow-soft);
}

.content {
    padding: 32px 36px 48px;
    flex: 1;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--three {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    border-radius: var(--radius-lg);
    background: rgba(24, 27, 37, 0.9);
    box-shadow: var(--shadow-soft), var(--shadow-inner);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.card__subtitle {
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat__label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat__value {
    font-size: 1.8rem;
    font-weight: 600;
}

.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary {
    color: white;
    background: var(--gradient-accent);
    box-shadow: 0 12px 24px rgba(221, 36, 118, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.btn-warning {
    background: rgba(245, 165, 36, 0.16);
    color: #ffd173;
    box-shadow: 0 12px 24px rgba(245, 165, 36, 0.22);
}

.btn-danger {
    background: rgba(243, 18, 96, 0.25);
    color: #ff9dac;
    box-shadow: 0 12px 24px rgba(243, 18, 96, 0.25);
}

.btn-logout {
    font-size: 0.9rem;
    padding-inline: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge--accent {
    background: rgba(255, 70, 109, 0.2);
    color: #ff90b3;
}

.badge--success {
    background: rgba(23, 201, 100, 0.18);
    color: #5be488;
}

.badge--warning {
    background: rgba(245, 165, 36, 0.18);
    color: #ffd173;
}

.badge--danger {
    background: rgba(243, 18, 96, 0.2);
    color: #ff8fa6;
}

.table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    margin-top: 12px;
}

.table thead th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    padding: 12px 16px;
    color: var(--color-text-secondary);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table tbody td {
    padding: 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.form-control,
.form-select {
    background: rgba(24, 27, 37, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--color-text-primary);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(255, 81, 47, 0.65);
    box-shadow: 0 0 0 4px rgba(221, 36, 118, 0.18);
}

.form-helper {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.switch input[type="checkbox"] {
    appearance: none;
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    cursor: pointer;
    transition: var(--transition-base);
}

.switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: var(--transition-base);
}

.switch input[type="checkbox"]:checked {
    background: rgba(255, 81, 47, 0.65);
}

.switch input[type="checkbox"]:checked::after {
    transform: translateX(22px);
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: var(--color-text-secondary);
}

.empty-state strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.timeline {
    display: grid;
    gap: 18px;
}

.timeline__item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 16px;
    align-items: start;
}

.timeline__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.timeline__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timeline__title {
    font-weight: 600;
}

.timeline__meta {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions .btn {
    flex: 0 0 auto;
}

.alert-banner {
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 81, 47, 0.12);
    border: 1px solid rgba(255, 81, 47, 0.3);
    color: #ff9dac;
}

.alert-banner--info {
    background: rgba(0, 114, 245, 0.12);
    border-color: rgba(0, 114, 245, 0.3);
    color: #7cb7ff;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(4, 6, 10, 0.72);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal__dialog {
    background: rgba(24, 27, 37, 0.98);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: min(480px, 90vw);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.modal__dialog--sm {
    width: min(360px, 90vw);
}

.modal__title {
    margin-top: 0;
    font-size: 1.2rem;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    display: grid;
    gap: 12px;
    z-index: 1050;
}

.toast {
    min-width: 260px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(24, 27, 37, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-primary);
}

.toast--error {
    border-color: rgba(243, 18, 96, 0.45);
}

.toast--success {
    border-color: rgba(23, 201, 100, 0.45);
}

.text-muted {
    color: var(--color-text-secondary);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 81, 47, 0.95);
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

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

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    background: radial-gradient(circle at top left, rgba(221, 36, 118, 0.36), transparent 50%),
                radial-gradient(circle at bottom right, rgba(255, 81, 47, 0.32), transparent 45%),
                var(--color-bg);
}

.auth-layout__panel {
    background: rgba(16, 18, 28, 0.8);
    padding: 64px 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
}

.auth-layout__panel h1 {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-layout__info {
    display: grid;
    gap: 18px;
    color: var(--color-text-secondary);
}

.auth-card {
    margin: auto;
    max-width: 420px;
    width: 100%;
    background: rgba(24, 27, 37, 0.85);
    border-radius: 24px;
    padding: 48px 42px;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 1;
}

.auth-card__title {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.auth-card__subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.auth-illustration {
    min-height: 100%;
    background: url('/assets/img/auth-bg.svg') no-repeat center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
}

.auth-illustration::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(15, 17, 23, 0.88), rgba(15, 17, 23, 0.65));
    z-index: 0;
    pointer-events: none;
}

.auth-demo-credentials {
    margin-top: 24px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    display: grid;
    gap: 8px;
}

.footer-note {
    font-size: 0.78rem;
    color: rgba(247, 249, 255, 0.45);
    text-align: center;
    margin-top: 28px;
}

@media (max-width: 1200px) {
    .grid--two {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        gap: 18px;
    }

    .sidebar__nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .sidebar__nav-link {
        white-space: nowrap;
    }

    .topbar {
        padding: 18px 22px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .content {
        padding: 24px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-layout__panel {
        padding: 48px 32px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .auth-card {
        margin: 48px auto;
        padding: 36px 28px;
    }
}

@media (max-width: 768px) {
    .grid--three {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .card {
        padding: 20px;
    }

    .topbar__title {
        font-size: 1.1rem;
    }
}

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

.animate-fade-in {
    animation: fadeInUp 0.45s ease forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}
