/* ============================================ */
/* GLOBAL STYLES - styles.css                   */
/* Platform Administrasi Kelas Digital          */
/* ============================================ */

/* ─────────────────────────────────────────── */
/* 1. RESET & BASE STYLES                      */
/* ─────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─────────────────────────────────────────── */
/* 2. TYPOGRAPHY                               */
/* ─────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

h1 { font-size: clamp(1.75rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p { margin-bottom: 1rem; }

a {
    color: #7c3aed;
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: #6d28d9; }
a:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────── */
/* 3. LAYOUT UTILITIES                         */
/* ─────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

/* ─────────────────────────────────────────── */
/* 4. SPACING UTILITIES                        */
/* ─────────────────────────────────────────── */

/* Margin */
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.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; }
.mb-16 { margin-bottom: 4rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mx-3 { margin-left: 0.75rem; margin-right: 0.75rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Gap utilities for flex/grid */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ─────────────────────────────────────────── */
/* 5. FLEXBOX & GRID UTILITIES                 */
/* ─────────────────────────────────────────── */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }

/* ─────────────────────────────────────────── */
/* 6. VISIBILITY UTILITIES                     */
/* ─────────────────────────────────────────── */

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sr-only:focus:not(.sr-only) {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ─────────────────────────────────────────── */
/* 7. BUTTON BASE STYLES                       */
/* ─────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
}

.btn:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* Button Variants */
.btn-primary {
    background-color: #7c3aed;
    color: white;
}
.btn-primary:hover { background-color: #6d28d9; }
.btn-primary:active { background-color: #5b21b6; }

.btn-ghost {
    color: #4b5563;
}
.btn-ghost:hover { color: #7c3aed; }

.btn-outline {
    background-color: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-white {
    background-color: white;
    color: #7c3aed;
}
.btn-white:hover { background-color: #f3f4f6; }

/* ─────────────────────────────────────────── */
/* 8. ANIMATIONS                               */
/* ─────────────────────────────────────────── */

.fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ─────────────────────────────────────────── */
/* 9. RESPONSIVE BREAKPOINTS (Mobile-First)    */
/* ─────────────────────────────────────────── */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .container { padding: 0 1.5rem; }
    .section { padding: 5rem 0; }
    .sm\:inline { display: inline; }
    .sm\:block { display: block; }
    .sm\:hidden { display: none; }
    .sm\:flex { display: flex; }
}

/* Laptop: 1024px+ */
@media (min-width: 1024px) {
    .container { padding: 0 2rem; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Desktop: 1280px+ */
@media (min-width: 1280px) {
    .container { padding: 0 2.5rem; }
}

/* ─────────────────────────────────────────── */
/* 10. ACCESSIBILITY ENHANCEMENTS              */
/* ─────────────────────────────────────────── */

/* Focus visible for keyboard users */
:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn { border: 2px solid currentColor; }
    a { text-decoration: underline; }
}
/* ─────────────────────────────────────────── */
/* 11. INFO BOARD / RUNNING TEXT               */
/* ─────────────────────────────────────────── */

.info-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #7c3aed, #6d28d9);
  color: white;
  padding: 10px 0;
  z-index: 9999;
  font-size: 14px;
  display: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-bar.active { display: block; }

/* Geser body ke bawah biar ga ketutup info bar */
body.has-info-bar { padding-top: 50px; }

.marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 25s linear infinite;
}

.marquee:hover span { animation-play-state: paused; }

@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

@media (max-width: 640px) {
  .info-bar { font-size: 13px; padding: 8px 0; }
  body.has-info-bar { padding-top: 46px; }
  .marquee span { animation-duration: 20s; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee span { animation: none; padding-left: 0; }
  .marquee { text-align: center; }
}
