/* ====== Glassmorphism / Neomorphic Theme ====== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hover: rgba(255, 255, 255, 0.1);
    --text: #e8e6f0;
    --text-muted: #9b97b0;
    --accent: #7c6aef;
    --accent-glow: rgba(124, 106, 239, 0.35);
    --success: #34d399;
    --success-glass: rgba(52, 211, 153, 0.15);
    --danger: #f87171;
    --danger-glass: rgba(248, 113, 113, 0.15);
    --warning: #fbbf24;
    --radius: 16px;
    --radius-sm: 10px;
    --blur: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
}

/* Ambient glow blobs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}
body::before {
    width: 500px; height: 500px;
    background: #7c6aef;
    top: -100px; left: -100px;
}
body::after {
    width: 400px; height: 400px;
    background: #e040fb;
    bottom: -80px; right: -80px;
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 24px;
}

/* ---- Header ---- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c4b5fd, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

h3 {
    margin: 0 0 10px;
    font-weight: 600;
}

/* ---- Glass card ---- */
.box {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.box:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ---- Buttons ---- */
.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 0;
    padding: 11px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, rgba(124, 106, 239, 0.5), rgba(99, 102, 241, 0.4));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.button:hover, button:hover {
    background: linear-gradient(135deg, rgba(124, 106, 239, 0.7), rgba(99, 102, 241, 0.6));
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}
.button:active, button:active {
    transform: translateY(0) scale(0.98);
}

.button.success, button.success {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.45), rgba(16, 185, 129, 0.35));
    box-shadow: 0 2px 12px rgba(52, 211, 153, 0.25);
    border-color: rgba(52, 211, 153, 0.25);
}
.button.success:hover, button.success:hover {
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.35);
}

.button.danger, button.danger {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.45), rgba(239, 68, 68, 0.35));
    box-shadow: 0 2px 12px rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.2);
}
.button.danger:hover, button.danger:hover {
    box-shadow: 0 4px 20px rgba(248, 113, 113, 0.3);
}

.button.small, button.small {
    padding: 7px 14px;
    font-size: 0.82rem;
}

nav .button { margin-right: 8px; }

/* ---- Forms ---- */
.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"], input[type="password"], textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="file"] {
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-muted);
}
input[type="file"]::file-selector-button {
    padding: 7px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.92rem;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* ---- Status / progress ---- */
.status {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--success-glass);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 0.9rem;
}

progress {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border: none;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}
progress::-webkit-progress-bar {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--accent), #818cf8);
    border-radius: 4px;
    transition: width 0.3s ease;
}
progress::-moz-progress-bar {
    background: linear-gradient(90deg, var(--accent), #818cf8);
    border-radius: 4px;
}

.full-width {
    width: 100%;
}

/* ---- Batch upload queue ---- */
.batch-item {
    display: grid;
    grid-template-columns: 1fr 140px auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}
.batch-item.batch-active {
    border-color: var(--accent);
    background: rgba(124, 106, 239, 0.06);
}
.batch-item.batch-done {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.05);
}
.batch-item.batch-error {
    border-color: rgba(248, 113, 113, 0.25);
    background: rgba(248, 113, 113, 0.05);
}
.batch-name {
    font-size: 0.85rem;
    font-weight: 500;
    word-break: break-all;
}
.batch-bar {
    height: 6px;
}
.batch-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    min-width: 80px;
}
.batch-done .batch-status { color: var(--success); }
.batch-error .batch-status { color: var(--danger); font-size: 0.75rem; }

.hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 6px 0 12px;
}

/* ---- Error ---- */
.error {
    color: var(--danger);
    background: var(--danger-glass);
    border: 1px solid rgba(248, 113, 113, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge.revised {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.4), rgba(234, 88, 12, 0.3));
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.25);
}

/* ---- Cards (generic) ---- */
.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.card {
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color 0.3s ease;
}
.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

/* ---- Panel ---- */
.panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .container { padding: 16px; }
    .panel { flex-direction: column; }
    .inline-form { flex-direction: column; align-items: stretch; }
    h1 { font-size: 1.4rem; }
    table { font-size: 0.85rem; }
    th, td { padding: 10px 8px; }
}
