/* ==========================================================
   Practice Lab — tema untuk latihan Database & Web Apps
   Simpan sebagai: assets/css/style.css
   ========================================================== */

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

:root {
    --bg: #0b1020;
    --bg-soft: #111833;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.10);
    --text: #e6e9f5;
    --muted: #8f98b8;
    --primary: #6c8cff;
    --primary-2: #8b5cf6;
    --accent: #22d3ee;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --radius: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(108, 140, 255, 0.22), transparent 60%),
        radial-gradient(700px 500px at 100% 0%, rgba(139, 92, 246, 0.20), transparent 60%),
        radial-gradient(800px 600px at 50% 120%, rgba(34, 211, 238, 0.12), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* grid halus di latar */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

main, header, nav, footer { position: relative; z-index: 1; }

/* ---------- Layout umum ---------- */
.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

main {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 40px 0 60px;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.6rem; margin-bottom: 14px; }
h3 { font-size: 1.15rem; margin-bottom: 8px; }
p  { color: var(--muted); }
a  { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }

/* ---------- Navbar / header ---------- */
header, .navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(11, 16, 32, 0.7);
    border-bottom: 1px solid var(--border);
}

.navbar-inner {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand::before { content: "›_"; color: var(--accent); }

.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav-links a {
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: .92rem;
    font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active { color: #fff; background: var(--surface-strong); }

/* ---------- Card ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 140, 255, 0.5);
    box-shadow: 0 14px 40px rgba(108, 140, 255, 0.15);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* ---------- Tombol ---------- */
button, .btn {
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 8px 24px rgba(108, 140, 255, 0.35);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
button:hover, .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.45);
    color: #fff;
}
button:active, .btn:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
    color: var(--text);
}
.btn-outline:hover { background: var(--surface-strong); box-shadow: none; }

.btn-danger { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 8px 24px rgba(239,68,68,.3); }

/* ---------- Form ---------- */
label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: .02em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text);
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 16px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: #5d6685; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(108, 140, 255, 0.18);
}

/* area editor SQL / kode */
textarea.code, .editor {
    font-family: var(--mono);
    font-size: .92rem;
    min-height: 180px;
    resize: vertical;
    line-height: 1.7;
    color: #b8f5d0;
}

/* ---------- Tabel (hasil query) ---------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
    text-align: left;
    font-family: var(--mono);
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text); }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(108, 140, 255, 0.08); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Kode ---------- */
code, pre { font-family: var(--mono); }
code {
    background: rgba(255,255,255,.08);
    color: #ffd479;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: .88em;
}
pre {
    background: #070b18;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    overflow-x: auto;
    color: #b8f5d0;
    font-size: .9rem;
    line-height: 1.7;
}

/* ---------- Badge & Alert ---------- */
.badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(108,140,255,.15);
    color: var(--primary);
    border: 1px solid rgba(108,140,255,.35);
}
.badge.easy   { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.35); }
.badge.medium { background: rgba(251,191,36,.12); color: var(--warning); border-color: rgba(251,191,36,.35); }
.badge.hard   { background: rgba(248,113,113,.12); color: var(--danger);  border-color: rgba(248,113,113,.35); }

.alert {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: .92rem;
    margin-bottom: 20px;
    border: 1px solid;
}
.alert-error   { background: rgba(248,113,113,.10); color: #fca5a5; border-color: rgba(248,113,113,.35); }
.alert-success { background: rgba(52,211,153,.10);  color: #6ee7b7; border-color: rgba(52,211,153,.35); }

/* ==========================================================
   HALAMAN LOGIN
   ========================================================== */
body.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-wrap {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    animation: rise .7s cubic-bezier(.2,.8,.2,1) both;
}

.login-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 38px 34px 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}
/* garis gradient di atas kartu */
.login-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary), var(--primary-2));
}

.terminal-dots { display: flex; gap: 7px; margin-bottom: 22px; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.login-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff, #b9c6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.login-sub { font-size: .95rem; margin-bottom: 8px; }

.sql-hint {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--muted);
    background: rgba(0,0,0,.35);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 18px 0 26px;
}
.sql-hint .kw  { color: #c792ea; }
.sql-hint .fn  { color: var(--accent); }
.sql-hint .str { color: #a5e075; }

.field { margin-bottom: 20px; }
.login-card button[type="submit"] { width: 100%; padding: 14px; font-size: 1rem; margin-top: 6px; }

.login-foot {
    text-align: center;
    margin-top: 22px;
    font-size: .8rem;
    color: var(--muted);
    font-family: var(--mono);
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 28px 0;
    color: var(--muted);
    font-size: .85rem;
    border-top: 1px solid var(--border);
}

/* ---------- Animasi ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(24px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.fade-in { animation: rise .6s ease both; }

/* ---------- Responsif ---------- */
@media (max-width: 600px) {
    .login-card { padding: 30px 22px 26px; }
    .navbar-inner { flex-direction: column; align-items: flex-start; }
    main { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
