/* ================================
   SHConcept Formació - Global CSS
   Design Tokens + Reset + Base + Utilities
   ================================ */

/* ================================
   CSS Variables (Design Tokens)
   ================================ */
:root {
    /* Colors */
    --color-primary: #2d6a4f;
    --color-primary-hover: #1b4332;
    --color-primary-light: #d8f3dc;
    --color-primary-dark: #1b4332;
    --color-primary-surface: #f0faf4;

    --color-secondary: #f2f2f2;
    --color-secondary-dark: #1a2e23;
    --color-text: #1a1a2e;
    --color-text-light: #4a5568;
    --color-text-muted: #9ca3af;

    --color-white: #ffffff;
    --color-border: #eeeeee;
    --color-border-light: #e5e7eb;
    --color-border-gray: #e2e8f0;

    --color-background: #ffffff;
    --color-background-gray: #f2f2f2;
    --color-background-light: #f9fafb;
    --color-background-gradient-from: #f8fafc;

    --color-error: #dc2626;
    --color-success: #16a34a;
    --color-orange-bg: #ffedd5;

    /* Moodle (Campus button) */
    --color-moodle: #f98012;
    --color-moodle-hover: #e86d00;

    /* Badge Colors */
    --color-badge-new-bg: #dcfce7;
    --color-badge-new-text: #166534;
    --color-badge-limited-bg: #fed7aa;
    --color-badge-limited-text: #f97316;
    --color-badge-full-bg: #fee2e2;
    --color-badge-full-text: #dc2626;
    --color-badge-upcoming-bg: #f3e8ff;
    --color-badge-upcoming-text: #a855f7;
    --color-badge-featured-bg: #dbeafe;
    --color-badge-featured-text: #1e40af;

    /* Star rating */
    --color-star: #f59e0b;

    /* Typography */
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter Tight', sans-serif;

    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;
    --font-size-5xl: 48px;

    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 48px;
    --spacing-4xl: 64px;
    --spacing-5xl: 80px;
    --spacing-6xl: 96px;
    --spacing-7xl: 112px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-3xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
    --shadow-md: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Breakpoints (for JS reference) */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1440px;

    /* Z-index */
    --z-header: 1000;
    --z-dropdown: 1100;
    --z-modal: 1200;
    --z-tooltip: 1300;

    /* Container */
    --container-max-width: 1440px;
    --container-padding: var(--spacing-2xl);
}

/* ================================
   Reset & Base Styles
   ================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-background);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

/* ================================
   Fade-in Animation (legacy)
   ================================ */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   Scroll Reveal Animation
   ================================ */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ================================
   Utility Classes
   ================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ================================
   Responsive Spacing Overrides
   ================================ */
@media (max-width: 640px) {
    :root {
        --spacing-5xl: 40px;
        --spacing-6xl: 48px;
        --spacing-7xl: 64px;
    }
}
