@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================
   K-Lite Theme — CSS Custom Properties
   Deep Maroon · Charcoal · White
   ============================================ */

@layer base {
    :root {
        --klite-maroon:       #6B1212;
        --klite-maroon-dark:  #4A0E0E;
        --klite-maroon-light: #8B1A1A;
        --klite-accent:       #C0392B;
        --klite-charcoal:     #1e1e1e;
        --klite-charcoal-mid: #2e2e2e;
        --klite-text:         #f5f5f5;
        --klite-border:       #3a1a1a;

        /* Premium accent palette — dipakai untuk aksen di atas dasar maroon/K-Lite */
        --klite-gold:         #B8912F;
        --klite-gold-light:   #D8B45B;
        --klite-gold-soft:    #F6EFDD;
        --klite-emerald:      #0F766E;
        --klite-slate:        #334155;
        --klite-bg:           #F5F3EF;
    }

    html { scroll-behavior: smooth; }

    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

@layer components {

    /* ---- Sidebar K-Lite ---- */
    .klite-sidebar {
        background: linear-gradient(180deg, #2D0808 0%, #1e1e1e 100%);
        box-shadow: 1px 0 0 rgba(184, 145, 47, 0.12);
    }

    .klite-sidebar-link {
        @apply block px-4 py-2.5 text-sm font-medium text-charcoal-200 rounded-lg mx-2
               transition-all duration-150;
        position: relative;
    }
    .klite-sidebar-link:hover {
        @apply text-white;
        background: rgba(255, 255, 255, 0.06);
    }
    .klite-sidebar-link.active {
        background: linear-gradient(90deg, var(--klite-maroon) 0%, var(--klite-maroon-light) 100%);
        @apply text-white shadow-sm;
        box-shadow: 0 2px 10px rgba(107, 18, 18, 0.45);
    }
    .klite-sidebar-link.active::before {
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 60%;
        border-radius: 2px;
        background: var(--klite-gold-light);
    }

    /* ---- Admin Header ---- */
    .klite-header {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: saturate(180%) blur(8px);
        -webkit-backdrop-filter: saturate(180%) blur(8px);
        border-bottom: 1px solid #ece7dd;
        box-shadow: 0 1px 0 rgba(184, 145, 47, 0.15), 0 2px 8px rgba(30, 20, 10, 0.04);
    }

    /* ---- Buttons ---- */
    .btn-maroon {
        @apply inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium
               text-white transition-all duration-150 focus:outline-none focus:ring-2 focus:ring-offset-1;
        background: linear-gradient(135deg, var(--klite-maroon) 0%, var(--klite-maroon-dark) 100%);
        box-shadow: 0 2px 8px rgba(74, 14, 14, 0.35);
    }
    .btn-maroon:hover {
        background: linear-gradient(135deg, var(--klite-maroon-light) 0%, var(--klite-maroon) 100%);
        box-shadow: 0 4px 14px rgba(74, 14, 14, 0.45);
        transform: translateY(-1px);
    }
    .btn-maroon:focus {
        --tw-ring-color: var(--klite-maroon-light);
    }

    .btn-outline {
        @apply inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium
               border transition-all duration-150 focus:outline-none bg-white;
        border-color: var(--klite-maroon);
        color: var(--klite-maroon);
    }
    .btn-outline:hover {
        background: var(--klite-maroon);
        @apply text-white;
    }

    .btn-ghost {
        @apply inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium
               text-charcoal-500 hover:bg-charcoal-100 transition-all duration-150;
    }

    /* ---- Cards ---- */
    .klite-card {
        @apply bg-white rounded-2xl border border-gray-100;
        box-shadow: 0 1px 2px rgba(30, 20, 10, 0.04), 0 6px 20px -8px rgba(74, 14, 14, 0.10);
        transition: box-shadow 0.2s ease;
    }

    /* ---- Premium stat card (dashboard) ---- */
    .klite-stat-card {
        @apply klite-card relative overflow-hidden p-5;
        background: #fff;
    }
    .klite-stat-card::after {
        content: '';
        position: absolute;
        inset: 0 0 auto 0;
        height: 3px;
        background: linear-gradient(90deg, var(--klite-maroon) 0%, var(--klite-gold-light) 100%);
        opacity: 0.9;
    }
    .klite-stat-card:hover {
        box-shadow: 0 2px 4px rgba(30, 20, 10, 0.05), 0 12px 28px -10px rgba(74, 14, 14, 0.22);
        transform: translateY(-2px);
    }

    /* Varian latar warna per-card (menyatu dengan warna ikonnya) */
    .klite-stat-card-maroon {
        background: linear-gradient(135deg, #FBEAEA 0%, #F7D9D9 100%);
        border-color: #F0C6C6;
    }
    .klite-stat-card-maroon::after {
        background: linear-gradient(90deg, var(--klite-maroon-dark), var(--klite-maroon));
    }
    .klite-stat-card-slate {
        background: linear-gradient(135deg, #EAEDF3 0%, #D8DEE9 100%);
        border-color: #C7D0E0;
    }
    .klite-stat-card-slate::after {
        background: linear-gradient(90deg, var(--klite-slate), #64748b);
    }
    .klite-stat-card-emerald {
        background: linear-gradient(135deg, #E1F3F0 0%, #C9EAE3 100%);
        border-color: #AFDED4;
    }
    .klite-stat-card-emerald::after {
        background: linear-gradient(90deg, var(--klite-emerald), #34d399);
    }
    .klite-stat-card-gold {
        background: linear-gradient(135deg, #FBF1DD 0%, #F5E2B8 100%);
        border-color: #EBD190;
    }
    .klite-stat-card-gold::after {
        background: linear-gradient(90deg, var(--klite-gold), var(--klite-gold-light));
    }

    /* Aksen bulat besar transparan di pojok kanan-atas tiap stat card */
    .klite-stat-card-maroon::before,
    .klite-stat-card-slate::before,
    .klite-stat-card-emerald::before,
    .klite-stat-card-gold::before {
        content: '';
        position: absolute;
        top: -30px;
        right: -30px;
        width: 100px;
        height: 100px;
        border-radius: 9999px;
        opacity: 0.16;
        pointer-events: none;
    }
    .klite-stat-card-maroon::before  { background: var(--klite-maroon-dark); }
    .klite-stat-card-slate::before   { background: var(--klite-slate); }
    .klite-stat-card-emerald::before { background: var(--klite-emerald); }
    .klite-stat-card-gold::before    { background: var(--klite-gold); }

    /* ---- Stat icon badge ---- */
    .klite-stat-icon {
        @apply w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0;
        background: rgba(107, 18, 18, 0.08);
        color: var(--klite-maroon);
    }
    .klite-stat-icon-maroon {
        background: linear-gradient(135deg, var(--klite-maroon-light), var(--klite-maroon-dark));
        color: #fff;
        box-shadow: 0 4px 10px rgba(107,18,18,0.35);
    }
    .klite-stat-icon-gold {
        background: linear-gradient(135deg, var(--klite-gold-light), var(--klite-gold));
        color: #fff;
        box-shadow: 0 4px 10px rgba(184,145,47,0.35);
    }
    .klite-stat-icon-emerald {
        background: linear-gradient(135deg, #14b8a6, var(--klite-emerald));
        color: #fff;
        box-shadow: 0 4px 10px rgba(15,118,110,0.35);
    }
    .klite-stat-icon-slate {
        background: linear-gradient(135deg, #64748b, var(--klite-slate));
        color: #fff;
        box-shadow: 0 4px 10px rgba(51,65,85,0.35);
    }

    /* ---- Premium page/section header (form cards, panels) ---- */
    .klite-panel-header {
        @apply -mx-6 -mt-6 mb-6 px-6 py-4 rounded-t-2xl flex items-center justify-between;
        background: linear-gradient(120deg, var(--klite-maroon-dark) 0%, var(--klite-maroon) 60%, var(--klite-maroon-light) 100%);
    }
    .klite-panel-header h2, .klite-panel-header h1 {
        @apply text-white font-semibold;
    }
        /* ---- Premium color banners (dipakai di card peserta: header berwarna penuh) ---- */
    .klite-banner {
        @apply relative px-5 sm:px-6 py-4 text-white;
    }
    .klite-banner::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 92% -10%, rgba(255,255,255,0.16) 0%, transparent 55%);
        pointer-events: none;
    }
    .klite-banner-maroon {
        background: linear-gradient(120deg, var(--klite-maroon-dark) 0%, var(--klite-maroon) 55%, var(--klite-maroon-light) 100%);
    }
    .klite-banner-emerald {
        background: linear-gradient(120deg, #0b5c56 0%, var(--klite-emerald) 55%, #14b8a6 100%);
    }
    .klite-banner-gold {
        background: linear-gradient(120deg, #7d5f1c 0%, var(--klite-gold) 55%, var(--klite-gold-light) 100%);
    }

    .klite-fieldset {
        @apply rounded-xl border border-gray-100 bg-gray-50/60 p-4 mb-5;
    }
    .klite-fieldset-title {
        @apply text-xs font-semibold uppercase tracking-wider mb-3 flex items-center gap-2;
        color: var(--klite-maroon);
    }

    /* ---- Table ---- */
    .klite-table {
        @apply border-collapse;
    }
    .klite-table thead tr {
        @apply border-b bg-gray-50;
    }
    .klite-table thead th {
        @apply py-3 px-4 text-xs font-semibold text-gray-500 uppercase tracking-wide;
    }
    .klite-table tbody tr {
        @apply border-b last:border-b-0 hover:bg-gray-50 transition-colors duration-100;
    }
    .klite-table tbody td {
        @apply py-3 px-4 text-sm text-gray-700 align-middle;
    }

    /* ---- Status badge ---- */
    .badge-published {
        @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
               bg-emerald-50 text-emerald-700 ring-1 ring-emerald-200;
    }
    .badge-draft {
        @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
               bg-amber-50 text-amber-700 ring-1 ring-amber-200;
    }
    .badge-online {
        @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
               bg-blue-50 text-blue-700 ring-1 ring-blue-200;
    }
    .badge-offline {
        @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
               bg-gray-100 text-gray-600 ring-1 ring-gray-200;
    }

    /* ---- Form inputs ---- */
    .klite-input {
        @apply w-full rounded-lg border-gray-300 shadow-sm text-sm
               focus:border-maroon-700 focus:ring-maroon-700 transition-all duration-150;
    }
    .klite-input:focus {
        box-shadow: 0 0 0 3px rgba(107, 18, 18, 0.12);
    }
    .klite-label {
        @apply block text-sm font-medium text-charcoal-600 mb-1;
    }

    /* ---- QR premium card ---- */
    .klite-qr-card {
        @apply klite-card relative overflow-hidden p-6 text-center;
    }
    .klite-qr-card::before {
        content: '';
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: linear-gradient(90deg, var(--klite-maroon-dark), var(--klite-maroon), var(--klite-gold-light));
    }
    .klite-qr-frame {
        @apply inline-flex items-center justify-center rounded-2xl p-4 mx-auto;
        background: #fff;
        border: 1px solid #eee0c4;
        box-shadow: inset 0 0 0 1px rgba(184,145,47,0.08), 0 8px 24px -12px rgba(74,14,14,0.25);
    }

    /* ---- Alert messages ---- */
    .alert-success {
        @apply flex items-start gap-2 rounded-xl px-4 py-3 text-sm
               bg-emerald-50 border border-emerald-200 text-emerald-800;
    }
    .alert-error {
        @apply flex items-start gap-2 rounded-xl px-4 py-3 text-sm
               bg-red-50 border border-red-200 text-red-800;
    }

    /* ---- Navbar participant ---- */
    .nav-link-active {
        border-bottom: 2px solid var(--klite-maroon);
        color: var(--klite-maroon) !important;
        @apply font-semibold;
    }

    /* ---- Page section divider ---- */
    .section-title {
        @apply text-base font-semibold text-charcoal-700 mb-4;
    }

    /* ---- Secondary button variants (Detail Seminar action bar, dsb.) ---- */
    .btn-outline-gold {
        @apply inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium
               border bg-white transition-all duration-150 focus:outline-none;
        border-color: var(--klite-gold);
        color: #8a6a1f;
    }
    .btn-outline-gold:hover {
        background: var(--klite-gold-soft);
    }
    .btn-outline-slate {
        @apply inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-sm font-medium
               border bg-white transition-all duration-150 focus:outline-none;
        border-color: #cbd5e1;
        color: var(--klite-slate);
    }
    .btn-outline-slate:hover {
        background: #f1f5f9;
    }

    /* ---- Info grid (Detail Seminar, dsb.) ---- */
    .klite-info-item {
        @apply flex items-start gap-3 rounded-xl p-3.5;
        background: rgba(107, 18, 18, 0.03);
        border: 1px solid rgba(107, 18, 18, 0.06);
    }
    .klite-info-icon {
        @apply w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0;
        background: rgba(107, 18, 18, 0.08);
        color: var(--klite-maroon);
    }
    .klite-info-label {
        @apply text-xs font-medium uppercase tracking-wide text-gray-400;
    }
    .klite-info-value {
        @apply text-sm font-medium text-charcoal-700 mt-0.5;
    }

    /* =====================================================================
       Premium Pagination — K-Lite (Maroon/Gold), dipakai khusus di halaman
       Admin melalui view kustom `vendor.pagination.admin-maroon`.
       ===================================================================== */
    .klite-pagination-nav {
        @apply flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3;
    }
    .klite-pagination-summary {
        @apply text-xs text-gray-500;
    }
    .klite-pagination-summary strong {
        @apply font-semibold text-charcoal-600;
    }
    .klite-pagination-list {
        @apply inline-flex items-center gap-1 flex-wrap;
    }
    .klite-page-link,
    .klite-page-current,
    .klite-page-disabled,
    .klite-page-dots {
        @apply inline-flex items-center justify-center min-w-[2.25rem] h-9 px-3 rounded-lg
               text-sm font-medium select-none transition-all duration-150;
    }
    .klite-page-link {
        @apply bg-white text-charcoal-600 border;
        border-color: #e7e0d8;
    }
    .klite-page-link:hover {
        border-color: var(--klite-maroon-light);
        color: var(--klite-maroon);
        background: var(--klite-gold-soft);
        transform: translateY(-1px);
    }
    .klite-page-link:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(184, 145, 47, 0.35);
    }
    .klite-page-current {
        color: #fff;
        border: 1px solid transparent;
        background: linear-gradient(135deg, var(--klite-maroon-light) 0%, var(--klite-maroon-dark) 100%);
        box-shadow: 0 3px 10px rgba(74, 14, 14, 0.35);
        cursor: default;
    }
    .klite-page-disabled {
        @apply bg-white text-gray-300 border cursor-not-allowed;
        border-color: #efe9e2;
    }
    .klite-page-dots {
        @apply bg-transparent text-gray-400 cursor-default px-1.5;
    }
    .klite-page-nav {
        @apply inline-flex items-center justify-center w-9 h-9 rounded-lg border bg-white
               text-charcoal-500 transition-all duration-150;
        border-color: #e7e0d8;
    }
    .klite-page-nav:hover {
        border-color: var(--klite-maroon-light);
        color: var(--klite-maroon);
        background: var(--klite-gold-soft);
    }
    .klite-page-nav:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(184, 145, 47, 0.35);
    }
    .klite-page-nav[disabled],
    .klite-page-nav.is-disabled {
        @apply text-gray-300 cursor-not-allowed;
        border-color: #efe9e2;
        background: #fff;
    }
    .klite-page-nav[disabled]:hover,
    .klite-page-nav.is-disabled:hover {
        background: #fff;
        color: #d1d5db;
        border-color: #efe9e2;
    }

    /* =====================================================================
       Kartu statistik Dashboard Admin (gradasi + grafik batang putih)
       Dipakai di resources/views/admin/dashboard.blade.php
       ===================================================================== */
    .dash-stat {
        position: relative;
        overflow: hidden;
        min-height: 175px;
        padding: 1.25rem;
        border-radius: 1.25rem;
        color: #fff;
        box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .dash-stat:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.55);
    }
    /* Hiasan cahaya dan garis gelombang tipis di latar */
    .dash-stat::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background:
            radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.2) 0, transparent 42%),
            repeating-radial-gradient(circle at 15% 130%, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 14px);
    }

    .dash-stat-maroon  { background: linear-gradient(135deg, #5B0F12 0%, #9A2B2B 100%); }
    .dash-stat-indigo  { background: linear-gradient(135deg, #272C66 0%, #6F83C4 100%); }
    .dash-stat-emerald { background: linear-gradient(135deg, #0B5E4D 0%, #3DB58F 100%); }
    .dash-stat-gold    { background: linear-gradient(135deg, #B8700F 0%, #E9B44C 100%); }

    .dash-stat-body {
        position: relative;
        z-index: 1;
    }
    .dash-stat-label {
        font-size: 0.95rem;
        font-weight: 600;
        opacity: 0.95;
    }
    .dash-stat-value {
        margin-top: 0.35rem;
        font-size: 2.75rem;
        line-height: 1;
        font-weight: 800;
    }
    .dash-stat-icon {
        position: absolute;
        z-index: 1;
        top: 1rem;
        right: 1rem;
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 9999px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.18);
        border: 1px solid rgba(255, 255, 255, 0.35);
    }
    .dash-stat-chart {
        position: absolute;
        z-index: 1;
        right: 1rem;
        bottom: 0.75rem;
        width: 58%;
        height: 92px;
    }
}
