/* ====================================================
   KCA PHP App - Local CSS (Replaces Tailwind CDN)
   ==================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Lexend:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* --- CSS Variables (Design Tokens) --- */
:root {
    --primary: #40589c;
    --primary-container: #8ea6f0;
    --secondary: #8c4a00;
    --secondary-container: #ffc69a;
    --on-secondary-container: #6f3a00;
    --tertiary: #802fc3;
    --tertiary-container: #d09aff;
    --on-tertiary-container: #4b007e;
    --surface: #ffffff;
    --on-surface: #2d2f31;
    --on-surface-variant: #5a5c5d;
    --surface-container-low: #f0f1f3;
    --surface-container-lowest: #ffffff;
    --on-primary: #f1f2ff;
    --surface-container-high: #e4e5e7;
    --font-headline: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Lexend', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background-color: var(--surface); color: var(--on-surface); line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-headline); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --- Material Symbols --- */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Utility Classes (Tailwind replacements) --- */

/* Layout */
.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.block { display: block; }
.grid { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.shrink-0 { flex-shrink: 0; }
.flex-grow { flex-grow: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Spacing */
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.ml-1 { margin-left: 0.25rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pb-1 { padding-bottom: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.pt-24 { padding-top: 6rem; }

/* Sizing */
.w-full { width: 100%; }
.w-fit { width: fit-content; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-48 { width: 12rem; }
.w-64 { width: 16rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.max-w-xs { max-width: 20rem; }
.max-w-lg { max-width: 32rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-screen-xl { max-width: 1280px; }
.max-w-screen-2xl { max-width: 1536px; }
.max-h-\[80vh\] { max-height: 80vh; }

/* Typography */
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-\[13px\] { font-size: 13px; }
.text-\[16px\] { font-size: 16px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.font-headline { font-family: var(--font-headline); }
.italic { font-style: italic; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.uppercase { text-transform: uppercase; }
.text-justify { text-align: justify; }
.text-center { text-align: center; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.whitespace-nowrap { white-space: nowrap; }

/* Colors - Text */
.text-white { color: #ffffff; }
.text-primary { color: var(--primary); }
.text-on-surface { color: var(--on-surface); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-on-secondary-container { color: var(--on-secondary-container); }
.text-on-tertiary-container { color: var(--on-tertiary-container); }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-500 { color: #64748b; }
.text-\[\#f3123c\] { color: #f3123c; }

/* Colors - Background */
.bg-white { background-color: #ffffff; }
.bg-surface { background-color: var(--surface); }
.bg-surface-container-low { background-color: var(--surface-container-low); }
.bg-surface-container-high { background-color: var(--surface-container-high); }
.bg-surface-container-lowest { background-color: var(--surface-container-lowest); }
.bg-primary { background-color: var(--primary); }
.bg-secondary-container { background-color: var(--secondary-container); }
.bg-tertiary-container { background-color: var(--tertiary-container); }
.bg-\[#000929\]\/90 { background-color: rgba(0,9,41,0.90); }
.bg-\[#000929\]\/20 { background-color: rgba(0,9,41,0.20); }
.bg-primary\/10 { background-color: rgba(64,88,156,0.1); }
.bg-primary\/40 { background-color: rgba(64,88,156,0.4); }
.bg-slate-50 { background-color: #f8fafc; }
.bg-white\/95 { background-color: rgba(255,255,255,0.95); }

/* Border & Radius */
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-b-lg { border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; }
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-t-2 { border-top-width: 2px; border-top-style: solid; }
.border-l-2 { border-left-width: 2px; border-left-style: solid; }
.border-y { border-top-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-bottom-style: solid; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-primary { border-color: var(--primary); }
.border-transparent { border-color: transparent; }
.border-primary\/20 { border-color: rgba(64,88,156,0.2); }

/* Effects */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.blur-3xl { filter: blur(64px); }
.opacity-0 { opacity: 0; }
.invisible { visibility: hidden; }

/* Transition */
.transition-all { transition: all 0.15s ease; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-transform { transition: transform 0.15s ease; }
.duration-300 { transition-duration: 0.3s; }
.duration-700 { transition-duration: 0.7s; }

/* Transform */
.transform { transform: translateZ(0); }
.rotate-2 { transform: rotate(2deg); }
.origin-top-left { transform-origin: top left; }

/* Positioning */
.top-0 { top: 0; }
.top-full { top: 100%; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.z-50 { z-index: 50; }
.-top-12 { top: -3rem; }
.-left-12 { left: -3rem; }
.-bottom-8 { bottom: -2rem; }
.-right-8 { right: -2rem; }

/* Object */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* Flex & Grid Gaps */
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.pl-4 { padding-left: 1rem; }

/* Grid Columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0,1fr)); }

/* --- Gradients --- */
.btn-gradient { background: linear-gradient(135deg, #40589c 0%, #8ea6f0 100%); }
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.from-primary\/40 { --tw-gradient-from: rgba(64,88,156,0.4); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.to-transparent { --tw-gradient-to: transparent; }
.from-\[\#000929\]\/90 { --tw-gradient-from: rgba(0,9,41,0.90); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.via-\[\#000929\]\/20 { /* handled inline */ }

/* ===================================================
   COMPONENT: Navbar
   =================================================== */
nav.fixed { top: 0; width: 100%; z-index: 50; background: rgba(255,255,255,0.95); backdrop-filter: blur(24px); box-shadow: 0 1px 2px rgba(0,0,0,0.05); border-bottom: 1px solid #e5e7eb; }

/* ===================================================
   COMPONENT: Hover Effects
   =================================================== */
.hover\:shadow-2xl:hover { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.hover\:bg-primary:hover { background-color: var(--primary); }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.hover\:bg-surface-container-high:hover { background-color: var(--surface-container-high); }
.hover\:border-primary:hover { border-color: var(--primary); }
.hover\:underline:hover { text-decoration: underline; }
.underline-offset-8 { text-underline-offset: 8px; }
.hover\:scale-110:hover { transform: scale(1.1); }

/* Group hover effects */
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:visible { visibility: visible; }
.group:hover .group-hover\:scale-110 { transform: scale(1.1); }
.group:hover .group-hover\:rotate-180 { transform: rotate(180deg); }
.group:hover .group-hover\:text-primary { color: var(--primary); }
.group:hover .group-hover\:border-primary { border-color: var(--primary); }
.group:hover .group-hover\:scale-110 { transform: scale(1.1); }

/* ===================================================
   RESPONSIVE: Tablet (md: 768px+)
   =================================================== */
@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .h-\[600px\] { height: 600px; }
    .h-\[500px\] { height: 500px; }
}

/* ===================================================
   RESPONSIVE: Large (lg: 1024px+)
   =================================================== */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
    .lg\:text-base { font-size: 1rem; line-height: 1.5rem; }
}

/* ===================================================
   RESPONSIVE: XL Nav (xl: 1280px+)
   =================================================== */
@media (min-width: 1280px) {
    .xl\:flex { display: flex; }
    .xl\:hidden { display: none !important; }
    nav .xl-hidden-on-desktop { display: none; }
}
@media (max-width: 1279px) {
    .hidden.xl\:flex { display: none !important; }
    .xl\:hidden { display: flex; }
}

/* ===================================================
   HEIGHT UTILITIES
   =================================================== */
.h-\[600px\] { height: 600px; }
.h-\[500px\] { height: 500px; }

/* ===================================================
   COMPONENT: Hero Section
   =================================================== */
.pt-24 { padding-top: 6rem; }

.hero-section {
    max-width: 1536px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-section { grid-template-columns: 1fr 1fr; }
}

/* ===================================================
   COMPONENT: Cards
   =================================================== */
.card-hover { transition: box-shadow 0.3s ease, transform 0.3s ease; }
.card-hover:hover { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); transform: translateY(-4px); }

/* ===================================================
   COMPONENT: Buttons
   =================================================== */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #40589c 0%, #8ea6f0 100%);
    color: white;
    font-weight: 700;
    padding: 1.25rem 2.5rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}
.btn-primary:hover { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }

.btn-secondary {
    display: inline-block;
    background-color: var(--surface-container-low);
    color: var(--primary);
    font-weight: 700;
    padding: 1.25rem 2.5rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    transition: background-color 0.2s ease;
}
.btn-secondary:hover { background-color: var(--surface-container-high); }

/* ===================================================
   COMPONENT: Dropdown
   =================================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    width: 12rem;
    background: white;
    border-top: 2px solid var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform-origin: top left;
    display: flex;
    flex-direction: column;
    z-index: 50;
}
.group:hover .dropdown-menu { opacity: 1; visibility: visible; }

/* ===================================================
   COMPONENT: Stat Counter
   =================================================== */
#visitor-count {
    font-size: 3.75rem;
    font-weight: 900;
    color: #f3123c;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

/* ===================================================
   ADMIN PANEL STYLES
   =================================================== */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e2a4a 0%, #40589c 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}
.admin-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: #f0f1f3;
}
.admin-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}
.admin-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

/* ===================================================
   FORM STYLES
   =================================================== */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--on-surface);
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64,88,156,0.15);
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--on-surface);
    margin-bottom: 0.375rem;
}

/* ===================================================
   TABLE STYLES
   =================================================== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--surface-container-low); padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--on-surface-variant); border-bottom: 2px solid #e5e7eb; }
.data-table td { padding: 1rem; border-bottom: 1px solid #f3f4f6; font-size: 0.875rem; color: var(--on-surface); vertical-align: middle; }
.data-table tr:hover td { background-color: #f8fafc; }

/* ===================================================
   BADGE / STATUS
   =================================================== */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }

/* ===================================================
   ALERT STYLES
   =================================================== */
.alert { padding: 1rem 1.25rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; display: flex; align-items: center; gap: 0.75rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ===================================================
   FOOTER
   =================================================== */
footer a:hover { color: var(--primary-container); }

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
.animate-fade-in-up { animation: fadeInUp 0.6s ease forwards; }

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-container); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
