/**
 * Sports Directory — Core CSS
 *
 * Shared base styles scoped to .sd-container. Variables (--primary, --columns,
 * etc.) are injected per-instance by SD_Assets via sd_derive_palette().
 */

.sd-container,
.sd-container *,
.sd-container *::before,
.sd-container *::after {
    box-sizing: border-box;
}

.sd-container {
    /* Defaults — overridden per instance by inline <style>. */
    --primary: #1E40AF;
    --primary-dark: #1A3A9E;
    --primary-light: #3B82F6;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-ring: rgba(59, 130, 246, 0.15);
    --shadow-color: rgba(30, 64, 175, 0.25);
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --columns: 3;
    --gap: 20px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    font-family: 'Noto Sans', 'Noto Sans Lao', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

.sd-container .screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Iconify baseline inside .sd-container */
.sd-container .sd-iconify,
.sd-container [class*="iconify"] {
    display: inline-block;
    line-height: 1;
}

/* ------------------------------------------------------------------ */
/* Spinner                                                            */
/* ------------------------------------------------------------------ */
.sd-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: sd-spin 0.7s linear infinite;
    display: inline-block;
}

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

.sd-panel-loading {
    padding: 100px 24px;
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Skeleton shimmer                                                   */
/* ------------------------------------------------------------------ */
.sd-skeleton {
    pointer-events: none;
}

.sd-skeleton .sd-skel-image,
.sd-skeleton .sd-skel-line,
.sd-skeleton .sd-skel-circle {
    background: var(--border);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.sd-skeleton .sd-skel-image {
    height: 180px;
    border-radius: 0;
}

.sd-skeleton .sd-skel-line {
    height: 13px;
    width: 100%;
}

.sd-skeleton .sd-skel-line--title {
    height: 22px;
    width: 60%;
    margin-bottom: 12px;
}

.sd-skeleton .sd-skel-line--short { width: 80%; }
.sd-skeleton .sd-skel-line--players { height: 14px; width: 70px; }

.sd-skeleton .sd-skel-circle {
    height: 34px;
    width: 34px;
    border-radius: 50%;
}

.sd-skeleton .sd-skel-image::after,
.sd-skeleton .sd-skel-line::after,
.sd-skeleton .sd-skel-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transform: translateX(-100%);
    animation: sd-shimmer 1.5s infinite;
}

@keyframes sd-shimmer {
    100% { transform: translateX(100%); }
}

/* Entrance animation */
@keyframes sd-fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sd-container .sd-card {
    animation: sd-fade-in-up 0.45s ease both;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sd-container *,
    .sd-container *::before,
    .sd-container *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
