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

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2933;
    /* Vibrant animated background with red, orange and yellow */
    background: radial-gradient(circle at top left, #ffd900 0, #aa182c 30%, #ff7a1a 60%, #1a0303 100%);
    background-attachment: fixed;
    animation: bg-pulse 18s ease-in-out infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

@keyframes bg-pulse {
    0% {
        background-position: 0% 0%;
        filter: saturate(1);
    }
    50% {
        background-position: 50% 50%;
        filter: saturate(1.2);
    }
    100% {
        background-position: 100% 100%;
        filter: saturate(1.35);
    }
}

/* Page layout */
.page {
    width: 100%;
    max-width: 960px;
}

.card {
    background: rgba(24, 6, 6, 0.94);
    border-radius: 18px;
    padding: 28px 26px 26px;
    box-shadow:
        0 22px 45px rgba(26, 3, 3, 0.75),
        0 0 0 1px rgba(248, 180, 28, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(248, 180, 28, 0.45);
    color: #fde68a;
}

.logo {
    display: block;
    margin: 0 auto 20px;
    width: 300px;
    height: 160px;
}

.logo-sm {
    display: block;
    width: auto;
    height: 32px;
}

.title {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #ffd900;
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.9rem;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 20px;
}

/* Alerts */
.alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.alert-error {
    background: rgba(170, 24, 44, 0.22);
    border: 1px solid rgba(255, 100, 100, 0.75);
    color: #fee2e2;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

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

label {
    font-size: 0.88rem;
    font-weight: 500;
    color: #fee2e2;
}

input[type="text"],
input[type="password"] {
    border-radius: 999px;
    border: 1px solid rgba(254, 215, 170, 0.7);
    background-color: rgba(24, 6, 6, 0.9);
    padding: 10px 14px;
    color: #fffbeb;
    font-size: 0.95rem;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease,
        transform 0.08s ease;
}

input::placeholder {
    color: #fbbf24;
}

input:focus {
    border-color: #ffd900;
    box-shadow: 0 0 0 1px rgba(255, 217, 0, 0.85), 0 0 0 6px rgba(255, 166, 0, 0.25);
    background-color: rgba(24, 6, 6, 0.98);
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    border-radius: 999px;
    border: none;
    padding: 10px 16px;
    font-size: 0.98rem;
    font-weight: 550;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.08s ease,
        opacity 0.15s ease;
    width: 100%;
    margin-top: 4px;
}

.btn.primary {
    background: linear-gradient(135deg, #ffd900, #ff7a1a);
    color: #3b0b0f;
    box-shadow:
        0 12px 25px rgba(170, 24, 44, 0.55),
        0 0 0 1px rgba(170, 24, 44, 0.95);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #ffe34c, #ff9327);
    transform: translateY(-1px);
    box-shadow:
        0 16px 32px rgba(170, 24, 44, 0.7),
        0 0 0 1px rgba(170, 24, 44, 0.95);
}

.btn.primary:active {
    transform: translateY(0);
    box-shadow:
        0 6px 18px rgba(170, 24, 44, 0.5),
        0 0 0 1px rgba(170, 24, 44, 0.95);
}

/* Small helper text or footer (optional for future) */
.page-footer {
    margin-top: 12px;
    text-align: center;
    font-size: 0.8rem;
    color: #fed7aa;
}

/* Top navigation bar for app pages */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(24, 6, 6, 0.96);
    border: 1px solid rgba(255, 217, 0, 0.65);
    box-shadow:
        0 16px 30px rgba(90, 7, 7, 0.85),
        0 0 0 1px rgba(90, 7, 7, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffd900;
}

.link {
    font-size: 0.9rem;
    color: #fffbeb;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 217, 0, 0.75);
    background: rgba(24, 6, 6, 0.9);
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.08s ease;
}

.link:hover {
    background: rgba(255, 217, 0, 0.22);
    color: #fffbeb;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(90, 7, 7, 0.8);
}

.link:active {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(90, 7, 7, 0.7);
}

.content {
    margin-top: 14px;
}

/* Table & admin listing */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.table-search-input {
    min-width: 220px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.9);
    padding: 8px 12px;
    color: #e5e7eb;
    font-size: 0.9rem;
    outline: none;
}

.table-search-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.table-filter-select {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 0.86rem;
    padding: 7px 10px;
}

.table-wrapper {
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.files-table thead {
    background: rgba(15, 23, 42, 0.98);
}

.files-table th,
.files-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.9);
    vertical-align: middle;
}

.files-table th {
    font-weight: 600;
    text-align: left;
    color: #e5e7eb;
    white-space: nowrap;
}

.files-table td {
    color: #d1d5db;
}

.files-table tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.96);
}

.files-table tr:nth-child(odd) td {
    background: rgba(15, 23, 42, 0.92);
}

.table-empty {
    text-align: center;
    padding: 16px 10px;
    color: #9ca3af;
}

.cell-name {
    max-width: 260px;
    word-break: break-word;
}

.cell-link {
    min-width: 220px;
}

.cell-actions {
    white-space: nowrap;
}

.inline-edit-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-inline-input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.9);
    padding: 6px 10px;
    color: #e5e7eb;
    font-size: 0.86rem;
}

@media (max-width: 720px) {
    .files-table th:nth-child(3),
    .files-table td:nth-child(3) {
        display: none;
    }
}

/* Generic hidden helper */
.hidden {
    display: none;
}

/* Progress bar styles for upload page */
.progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.5);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #38bdf8);
    transition: width 0.2s ease-out;
}

.progress-text {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #e5e7eb;
}

.download-link-container {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px dashed rgba(148, 163, 184, 0.5);
}

.download-link-container h2 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.download-link-container p {
    font-size: 0.85rem;
    color: #9ca3af;
}

.download-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.download-link-input {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background-color: rgba(15, 23, 42, 0.9);
    padding: 8px 12px;
    color: #e5e7eb;
    font-size: 0.88rem;
    outline: none;
    word-break: break-all;
}

.download-link-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.btn.outline {
    width: auto;
    padding-inline: 14px;
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow: none;
}

.btn.outline:hover {
    background: rgba(148, 163, 184, 0.15);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.65);
}

.btn.small {
    padding-block: 7px;
    font-size: 0.84rem;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .card {
        padding: 24px 18px 20px;
    }

    .title {
        font-size: 1.35rem;
    }
}

