/* ============================================================
   main.css - Beriin Sky Blue Fresh Theme
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ── Sky Blue Palette ── */
  --primary:       #0ea5e9;   /* sky-500 */
  --primary-d:     #0284c7;   /* sky-600 */
  --primary-l:     #e0f2fe;   /* sky-100 */
  --primary-ll:    #f0f9ff;   /* sky-50  */
  --accent:        #f59e0b;   /* amber   */
  --accent2:       #06b6d4;   /* cyan    */
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #06b6d4;

  /* ── Surfaces ── */
  --bg:            #f0f9ff;
  --surface:       #ffffff;
  --surface2:      #f8fbff;
  --border:        rgba(14,165,233,0.15);
  --border-light:  rgba(14,165,233,0.08);

  /* ── Text ── */
  --text:          #0c1a2e;
  --text-muted:    #64748b;

  /* ── Effects ── */
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 4px 20px rgba(14,165,233,0.08);
  --shadow-md:     0 8px 32px rgba(14,165,233,0.12);
  --shadow-lg:     0 16px 48px rgba(14,165,233,0.16);
  --font:          'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

/* ── Base ── */
html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: var(--font);
  background: linear-gradient(160deg, #f0f9ff 0%, #e0f2fe 30%, #f0fdf4 65%, #fefce8 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Decorative blobs */
body::before {
  content: '';
  position: fixed; top: -15%; left: -10%;
  width: 55vw; height: 55vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,0.07) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
  animation: blobFloat 14s ease-in-out infinite alternate;
}
body::after {
  content: '';
  position: fixed; bottom: -15%; right: -10%;
  width: 45vw; height: 45vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
  animation: blobFloat 18s ease-in-out infinite alternate-reverse;
}
@keyframes blobFloat {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(3%,5%) scale(1.05); }
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
img { max-width: 100%; display: block; }

/* ── Typography ── */
h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

/* ── Card ── */
.card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(14,165,233,0.12);
  box-shadow: 0 2px 16px rgba(14,165,233,0.06);
  position: relative; z-index: 1;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}
.card:hover {
  border-color: rgba(14,165,233,0.25);
  box-shadow: 0 6px 28px rgba(14,165,233,0.12);
  transform: translateY(-1px);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: 40px; border: none;
  font-size: 0.9rem; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: all 0.25s; white-space: nowrap;
  text-decoration: none; position: relative; z-index: 1;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  box-shadow: 0 4px 20px rgba(14,165,233,0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  box-shadow: 0 6px 28px rgba(14,165,233,0.55);
}
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-l); }
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white; box-shadow: 0 4px 16px rgba(239,68,68,0.35);
}
.btn-ghost {
  background: rgba(14,165,233,0.06); color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(14,165,233,0.12); border-color: rgba(14,165,233,0.3); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.btn-info    { background: linear-gradient(135deg, #06b6d4, #0891b2); color: white; }
.btn-sm  { padding: 7px 16px; font-size: 0.82rem; }
.btn-lg  { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Form ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-control {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid rgba(14,165,233,0.2);
  border-radius: var(--radius-sm);
  background: #ffffff; color: var(--text);
  font-size: 0.95rem; font-family: var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control::placeholder { color: #94a3b8; }
.form-control:focus {
  border-color: var(--primary);
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 0.78rem; color: #ef4444; margin-top: 4px; }
.form-hint  { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
select.form-control option { background: #ffffff; color: var(--text); }
.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-group .input-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer; font-size: 0.9rem;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700;
}
.badge-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-info    { background: #cffafe; color: #0e7490; border: 1px solid #67e8f9; }
.badge-purple  { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }

/* ── Avatar ── */
.avatar {
  border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.avatar-sm  { width: 36px;  height: 36px;  font-size: 0.85rem; }
.avatar-md  { width: 56px;  height: 56px;  font-size: 1.2rem; }
.avatar-lg  { width: 80px;  height: 80px;  font-size: 1.8rem; }
.avatar-xl  { width: 120px; height: 120px; font-size: 2.5rem; }

/* ── Spinner ── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(14,165,233,0.15);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.spinner-sm {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(14,165,233,0.2);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #e0f2fe 25%, #bae6fd 50%, #e0f2fe 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(14,165,233,0.15);
  color: var(--text);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(14,165,233,0.12);
  transform: translateX(110%); opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left: 4px solid #10b981; }
.toast-error   { border-left: 4px solid #ef4444; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-info    { border-left: 4px solid #06b6d4; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(12,26,46,0.45);
  backdrop-filter: blur(6px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: #ffffff;
  border: 1px solid rgba(14,165,233,0.15);
  border-radius: 20px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(14,165,233,0.18);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid rgba(14,165,233,0.1);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: #f0f9ff; border: 1px solid rgba(14,165,233,0.1);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1rem; transition: all 0.15s;
}
.modal-close:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }
.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid rgba(14,165,233,0.1);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Progress Bar ── */
.progress-wrap { background: #e0f2fe; border-radius: 99px; overflow: hidden; height: 8px; }
.progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4, #10b981);
  transition: width 0.5s ease;
}

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.82rem; margin: 16px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(14,165,233,0.12);
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 16px rgba(14,165,233,0.07);
}
.navbar-brand {
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-decoration: none;
}
.navbar-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 7px 14px; border-radius: 8px;
  color: #475569; font-size: 0.875rem; font-weight: 500;
  transition: all 0.15s; text-decoration: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary); background: var(--primary-l);
}

/* ── Footer ── */
.footer {
  background: #0c1a2e;
  border-top: 1px solid rgba(14,165,233,0.15);
  color: rgba(148,163,184,0.8);
  padding: 60px 24px 32px;
}
.footer-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand { font-size: 1.4rem; font-weight: 800; color: white; margin-bottom: 12px; }
.footer-desc  { font-size: 0.875rem; line-height: 1.7; }
.footer-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #7dd3fc; margin-bottom: 14px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(148,163,184,0.6); font-size: 0.875rem; text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: #7dd3fc; }
.footer-bottom {
  max-width: 1100px; margin: 40px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.82rem; flex-wrap: wrap; gap: 10px;
}

/* ── Container ── */
.container    { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 640px;  margin: 0 auto; padding: 0 20px; }

/* ── Section ── */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { margin-bottom: 12px; }
.section-title p  { color: var(--text-muted); font-size: 1.05rem; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Stat Card ── */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 0.875rem; }

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.875rem; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 18px; border: none; background: none;
  font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all 0.15s; font-family: var(--font);
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover  { color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: var(--font);
}
.page-btn:hover, .page-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(14,165,233,0.35);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .navbar { padding: 0 16px; }
  .section { padding: 48px 0; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  #toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 92vh; width: 100%; max-width: 100%; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
  .card { padding: 16px; }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], textarea, select { font-size: 16px !important; }
}

/* ── No transition (theme toggle) ── */
.no-transition *, .no-transition *::before, .no-transition *::after {
  transition: none !important; animation: none !important;
}
