/* =====================
   THEME VARIABLES
===================== */
:root {
    --bg: #020617;
    --bg-grad: #000;
    --card: #0f172a;
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #ef4444;
    --success: #22c55e;
    --font-arab: 'Amiri', serif;
    --font-latin: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-scale: 1;
}

body.light {
    --bg: #f8fafc;
    --bg-grad: #e5e7eb;
    --card: #ffffff;
    --text: #020617;
    --muted: #475569;
}

/* =====================
   BASE
===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: radial-gradient(circle at top, var(--bg), var(--bg-grad));
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
    transition: background .4s, color .4s;
    min-height: 100vh;
}

.wrapper {
    max-width: 900px;
    margin: auto;
    padding: 70px 18px 90px;
}

/* =====================
   HEADER
===================== */
.header, .header-dash {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeDown 1s ease;
}
.header-dash { text-align: left; display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.header h1, .header-dash h1 { margin: 0; font-size: 28px; font-weight: 600; }
.header-dash h1 { font-size: 24px; }
.header p { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* =====================
   CONTROLS (TOP RIGHT)
===================== */
.controls {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 999;
}

.btn-ctrl, .btn {
    background: var(--card);
    color: var(--text);
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    transition: .3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-ctrl:hover, .btn:hover {
    transform: translateY(-2px);
    background: var(--accent);
    color: #fff;
}
.btn { border-radius: 8px; padding: 8px 16px; display: inline-flex; box-shadow: none; }
.btn-primary { background: var(--accent); color: #000; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-secondary { background: #334155; color: #fff; }

/* =====================
   DOA CARD
===================== */
.doa, .doa-item {
    position: relative;
    background: linear-gradient(180deg, var(--bg), var(--card));
    border-radius: 20px;
    padding: 28px 26px;
    margin-bottom: 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpFade 0.5s forwards;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid transparent;
}
.doa-item { 
    transform: none; opacity: 1; animation: none; padding: 20px; border-radius: 12px; margin-bottom: 15px; 
    display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; cursor: default;
}
.doa.show { transform: translateY(0) scale(1); opacity: 1; }
.doa:hover { border-color: var(--accent); }

/* =====================
   TEXT ELEMENTS
===================== */
body { font-family: var(--font-latin); }
.arab, .doa-arab {
    font-family: var(--font-arab);
    font-size: calc(26px * var(--font-scale));
    line-height: 2.15;
    direction: rtl;
    text-align: right;
    transition: color 0.3s;
}
.doa-arab { font-size: calc(20px * var(--font-scale)); margin-bottom: 10px; line-height: 1.6; }
.doa-id { color: var(--accent); font-weight: bold; font-size: 14px; margin-bottom: 5px; }

.terjemah, .doa-trans {
    font-family: var(--font-latin);
    font-size: calc(15px * var(--font-scale));
    line-height: 1.6;
    color: var(--muted);
}
.terjemah {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    margin-top: 15px;
    padding-top: 15px;
    display: none;
    animation: slideIn 0.4s ease-out;
}
.doa-trans { line-height: 1.5; }

.show-meaning .terjemah, .doa.active .terjemah { display: block; }
.doa-content { flex: 1; }
.actions { display: flex; gap: 8px; }

.doa-note {
    position: absolute;
    bottom: 10px;
    left: 20px;
    font-size: 11px;
    color: var(--muted);
    opacity: 0.7;
}

/* =====================
   FORM STYLE
===================== */
.card-form { 
    background: var(--card); padding: 20px; border-radius: 15px; margin-bottom: 40px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
}
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
textarea { 
    width: 100%; border: 1px solid #334155; background: #1e293b; color: #fff; 
    border-radius: 8px; padding: 12px; font-size: 15px; box-sizing: border-box; resize: vertical;
}
textarea.arab-input { direction: rtl; text-align: right; font-family: system-ui, serif; font-size: 20px; }
body.light textarea { background: #fff; color: #000; border: 1px solid #cbd5e1; }

/* =====================
   ANIMATIONS
===================== */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: none; }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUpFade {
    to { opacity: 1; transform: translateY(0); }
}

/* =====================
   PAGINATION & REORDER
===================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding-bottom: 20px;
}
.btn-icon {
    background: #334155;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: var(--accent);
    color: #000;
}
.btn-icon:disabled {
    background: #1e293b;
    color: #475569;
    cursor: not-allowed;
}

@media(max-width:600px){
    .arab { font-size: 22px; }
    .header h1 { font-size: 22px; }
    .btn-ctrl { padding: 8px 12px; font-size: 12px; }
    .doa-item { flex-direction: column; }
    .actions { width: 100%; justify-content: flex-end; }
}

/* =====================
   SETTINGS MODAL
===================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--card); color: var(--text); padding: 20px 25px;
    border-radius: 12px; width: 90%; max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUpFade 0.3s ease-out;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-close {
    background: none; border: none; font-size: 24px; color: var(--text);
    cursor: pointer; line-height: 1; padding: 0; margin: 0;
}
.form-control {
    width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--muted);
    background: var(--bg); color: var(--text); font-size: 15px; margin-top: 5px;
}
body.light .form-control { background: #fff; border-color: #cbd5e1; }

