/* GiveMeAComment — Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&family=Play:wght@400;700&display=swap');

:root {
    --bg: #0f141b;
    --panel: #141b23;
    --panel-2: #1a2230;
    --panel-3: #202938;
    --line: #2a3445;
    --text: #edf3ff;
    --muted: #9ca9bc;
    --muted-2: #7f8ca0;
    --blue: #3b82f6;
    --blue-2: #2563eb;
    --blue-hover: #4f93ff;
    --green: #22c55e;
    --green-bg: rgba(34,197,94,.12);
    --orange: #f59e0b;
    --orange-bg: rgba(245,158,11,.12);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-card: 0 2px 12px rgba(0,0,0,.18);
    --transition: .18s ease;
}

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

html, body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans', 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(ellipse 80% 60% at 5% 0%, rgba(59,130,246,.15) 0%, transparent 50%),
        radial-gradient(ellipse 70% 55% at 95% 100%, rgba(124,58,237,.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(59,130,246,.04) 0%, transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; outline: none; }
img { max-width: 100%; }

/* ---------- Utility ---------- */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.gap-lg { gap: 20px; }

/* ---------- Auth Pages ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-card);
}

.auth-logo {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 4px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
}

.auth-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 28px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 16px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    transition: border-color var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--blue);
}

.form-input::placeholder {
    color: var(--muted-2);
}

/* Number input spinners — styled */
.form-input[type="number"] {
    -moz-appearance: textfield;
    text-align: center;
}
.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

textarea.form-input {
    height: auto;
    min-height: 100px;
    padding: 12px 16px;
    resize: vertical;
}

select.form-input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca9bc' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.form-hint {
    color: var(--muted-2);
    font-size: 12px;
    margin-top: 4px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

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

.btn-primary {
    background: var(--blue-2);
    color: #fff;
}
.btn-primary:hover { background: var(--blue); color: #fff; }

.btn-secondary {
    background: var(--panel-3);
    color: var(--text);
    border: 1px solid var(--line);
}
.btn-secondary:hover { background: #283346; color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-sm {
    height: 34px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-full { width: 100%; }

.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- App Layout ---------- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 28px;
    height: 60px;
    background: var(--panel-2);
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.app-topbar-brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
}

.app-topbar-brand span { color: var(--blue); }

.app-topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-topbar-nav a,
.app-topbar-nav button {
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
    text-decoration: none;
}

.app-topbar-nav a:hover,
.app-topbar-nav button:hover,
.app-topbar-nav a.active {
    color: var(--text);
    background: rgba(255,255,255,.06);
}

.app-topbar-nav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-content {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- Cards ---------- */
.card {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,.05);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
}

.page-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ---------- Storage Bar ---------- */
.storage-bar {
    margin-bottom: 24px;
}

.storage-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.storage-bar-label { color: var(--muted); }
.storage-bar-value { font-weight: 600; }

.storage-bar-track {
    height: 8px;
    background: var(--panel-3);
    border-radius: 999px;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 999px;
    transition: width .4s ease;
    min-width: 0;
}

.storage-bar-fill.warning { background: var(--orange); }
.storage-bar-fill.danger { background: var(--danger); }

/* ---------- Status Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-ready { background: var(--green-bg); color: var(--green); }
.badge-converting { background: var(--orange-bg); color: var(--orange); }
.badge-error { background: var(--danger-bg); color: var(--danger); }
.badge-queued { background: rgba(99,102,241,.12); color: #818cf8; }
.badge-uploading { background: rgba(59,130,246,.12); color: var(--blue); }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-blocked { background: var(--danger-bg); color: var(--danger); }
.badge-pending { background: rgba(99,102,241,.12); color: #818cf8; }
.badge-completed { background: var(--green-bg); color: var(--green); }
.badge-in_progress { background: var(--orange-bg); color: var(--orange); }
.badge-admin { background: rgba(168,85,247,.12); color: #a855f7; }
.badge-user { background: rgba(99,102,241,.12); color: #818cf8; }

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: currentColor;
    animation: badge-spin .8s linear infinite;
    flex-shrink: 0;
}

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

.badge-animated {
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

/* ---------- Projects Grid ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.project-card {
    background: var(--panel);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    border-color: rgba(255,255,255,.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    color: inherit;
}

.project-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
}

.project-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.04);
}

/* ---------- Version List ---------- */
.version-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background var(--transition);
}

.version-item:hover { background: rgba(255,255,255,.02); }
.version-item:last-child { border-bottom: none; }

.version-number {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--panel-3);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.version-info { flex: 1; min-width: 0; }

.version-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.version-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ---------- Empty State ---------- */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--panel-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--muted);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 13px;
    max-width: 360px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

/* ---------- Table ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: middle;
}

.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4,8,14,.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: auto;
    background: var(--panel-2);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: 0 16px 48px rgba(0,0,0,.3);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.modal-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    background: rgba(17,25,38,.96);
    color: var(--text);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    opacity: 0;
    transform: translateY(12px);
    transition: all .25s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Upload Zone ---------- */
.upload-zone {
    border: 2px dashed var(--line);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--blue);
    background: rgba(59,130,246,.04);
}

.upload-zone-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--panel-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--blue);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.upload-zone-text { font-weight: 600; margin-bottom: 4px; }
.upload-zone-hint { color: var(--muted); font-size: 12px; }

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--panel-3);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 999px;
    transition: width .3s ease;
    width: 0%;
}

/* ---------- Link copy ---------- */
.link-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.link-display input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.link-display button {
    flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .app-topbar { padding: 0 16px; }
    .app-content { padding: 16px; }
    .auth-card { padding: 28px 22px; }
    .projects-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
}
