/**
 * SwissProfs - Global Fixes CSS
 * Reset, normalisation et classes utilitaires
 * CHARGE EN PREMIER - Ne contient PAS de styles de composants
 *
 * @package SwissProfs
 */

/* ==========================================================================
   RESET & NORMALISATION
   ========================================================================== */

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

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1e293b;
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.nav-open,
body.modal-open {
    overflow: hidden;
}

/* WordPress admin bar fix */
body.admin-bar .sp-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .sp-header {
        top: 46px;
    }
}

/* ==========================================================================
   BASE ELEMENT NORMALIZATION
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    cursor: pointer;
}

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

/* ==========================================================================
   UTILITY CLASSES - DISPLAY
   ========================================================================== */

.sp-d-none { display: none !important; }
.sp-d-block { display: block !important; }
.sp-d-flex { display: flex !important; }
.sp-d-grid { display: grid !important; }
.sp-d-inline { display: inline !important; }
.sp-d-inline-block { display: inline-block !important; }
.sp-d-inline-flex { display: inline-flex !important; }

/* ==========================================================================
   UTILITY CLASSES - FLEXBOX
   ========================================================================== */

.sp-flex-row { flex-direction: row !important; }
.sp-flex-column { flex-direction: column !important; }
.sp-flex-wrap { flex-wrap: wrap !important; }
.sp-flex-nowrap { flex-wrap: nowrap !important; }
.sp-justify-start { justify-content: flex-start !important; }
.sp-justify-end { justify-content: flex-end !important; }
.sp-justify-center { justify-content: center !important; }
.sp-justify-between { justify-content: space-between !important; }
.sp-align-start { align-items: flex-start !important; }
.sp-align-end { align-items: flex-end !important; }
.sp-align-center { align-items: center !important; }
.sp-flex-1 { flex: 1 1 0% !important; }
.sp-flex-shrink-0 { flex-shrink: 0 !important; }

/* ==========================================================================
   UTILITY CLASSES - GAP
   ========================================================================== */

.sp-gap-0 { gap: 0 !important; }
.sp-gap-1 { gap: 0.25rem !important; }
.sp-gap-2 { gap: 0.5rem !important; }
.sp-gap-3 { gap: 0.75rem !important; }
.sp-gap-4 { gap: 1rem !important; }
.sp-gap-5 { gap: 1.25rem !important; }
.sp-gap-6 { gap: 1.5rem !important; }
.sp-gap-8 { gap: 2rem !important; }

/* ==========================================================================
   UTILITY CLASSES - TEXT
   ========================================================================== */

.sp-text-left { text-align: left !important; }
.sp-text-center { text-align: center !important; }
.sp-text-right { text-align: right !important; }

.sp-text-primary { color: #E63946 !important; }
.sp-text-secondary { color: #1e40af !important; }
.sp-text-success { color: #059669 !important; }
.sp-text-warning { color: #d97706 !important; }
.sp-text-danger { color: #dc2626 !important; }
.sp-text-muted { color: #6b7280 !important; }
.sp-text-white { color: #fff !important; }

.sp-font-normal { font-weight: 400 !important; }
.sp-font-medium { font-weight: 500 !important; }
.sp-font-semibold { font-weight: 600 !important; }
.sp-font-bold { font-weight: 700 !important; }

.sp-text-xs { font-size: 0.75rem !important; }
.sp-text-sm { font-size: 0.875rem !important; }
.sp-text-base { font-size: 1rem !important; }
.sp-text-lg { font-size: 1.125rem !important; }
.sp-text-xl { font-size: 1.25rem !important; }

/* ==========================================================================
   UTILITY CLASSES - BACKGROUND
   ========================================================================== */

.sp-bg-transparent { background-color: transparent !important; }
.sp-bg-white { background-color: #fff !important; }
.sp-bg-light { background-color: #f9fafb !important; }
.sp-bg-primary { background-color: #E63946 !important; }
.sp-bg-success { background-color: #10b981 !important; }
.sp-bg-warning { background-color: #f59e0b !important; }
.sp-bg-danger { background-color: #dc2626 !important; }

/* ==========================================================================
   UTILITY CLASSES - SPACING
   ========================================================================== */

/* Margin */
.sp-m-0 { margin: 0 !important; }
.sp-m-auto { margin: auto !important; }
.sp-mt-0 { margin-top: 0 !important; }
.sp-mt-1 { margin-top: 0.25rem !important; }
.sp-mt-2 { margin-top: 0.5rem !important; }
.sp-mt-4 { margin-top: 1rem !important; }
.sp-mt-6 { margin-top: 1.5rem !important; }
.sp-mt-8 { margin-top: 2rem !important; }
.sp-mb-0 { margin-bottom: 0 !important; }
.sp-mb-1 { margin-bottom: 0.25rem !important; }
.sp-mb-2 { margin-bottom: 0.5rem !important; }
.sp-mb-3 { margin-bottom: 0.75rem !important; }
.sp-mb-4 { margin-bottom: 1rem !important; }
.sp-mb-5 { margin-bottom: 1.25rem !important; }
.sp-mb-6 { margin-bottom: 1.5rem !important; }
.sp-mb-8 { margin-bottom: 2rem !important; }
.sp-mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Padding */
.sp-p-0 { padding: 0 !important; }
.sp-p-2 { padding: 0.5rem !important; }
.sp-p-4 { padding: 1rem !important; }
.sp-p-6 { padding: 1.5rem !important; }
.sp-p-8 { padding: 2rem !important; }
.sp-px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.sp-py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.sp-py-6 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

/* ==========================================================================
   UTILITY CLASSES - SIZING
   ========================================================================== */

.sp-w-full { width: 100% !important; }
.sp-w-auto { width: auto !important; }
.sp-h-full { height: 100% !important; }
.sp-h-auto { height: auto !important; }
.sp-min-h-screen { min-height: 100vh !important; }

/* ==========================================================================
   UTILITY CLASSES - BORDER & SHADOW
   ========================================================================== */

.sp-rounded { border-radius: 0.5rem !important; }
.sp-rounded-lg { border-radius: 0.75rem !important; }
.sp-rounded-xl { border-radius: 1rem !important; }
.sp-rounded-full { border-radius: 9999px !important; }
.sp-rounded-none { border-radius: 0 !important; }

.sp-border { border: 1px solid #e5e7eb !important; }
.sp-border-0 { border: 0 !important; }
.sp-border-primary { border-color: #E63946 !important; }

.sp-shadow-none { box-shadow: none !important; }
.sp-shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; }
.sp-shadow { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important; }
.sp-shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important; }
.sp-shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important; }
.sp-shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important; }

/* ==========================================================================
   UTILITY CLASSES - OVERFLOW & VISIBILITY
   ========================================================================== */

.sp-overflow-hidden { overflow: hidden !important; }
.sp-overflow-auto { overflow: auto !important; }
.sp-overflow-x-auto { overflow-x: auto !important; }
.sp-overflow-y-auto { overflow-y: auto !important; }

.sp-invisible { visibility: hidden !important; }
.sp-visible { visibility: visible !important; }

.sp-opacity-0 { opacity: 0 !important; }
.sp-opacity-50 { opacity: 0.5 !important; }
.sp-opacity-100 { opacity: 1 !important; }

/* ==========================================================================
   UTILITY CLASSES - POSITION
   ========================================================================== */

.sp-relative { position: relative !important; }
.sp-absolute { position: absolute !important; }
.sp-fixed { position: fixed !important; }
.sp-sticky { position: sticky !important; }
.sp-static { position: static !important; }

.sp-inset-0 { inset: 0 !important; }
.sp-top-0 { top: 0 !important; }
.sp-right-0 { right: 0 !important; }
.sp-bottom-0 { bottom: 0 !important; }
.sp-left-0 { left: 0 !important; }

.sp-z-0 { z-index: 0 !important; }
.sp-z-10 { z-index: 10 !important; }
.sp-z-50 { z-index: 50 !important; }
.sp-z-100 { z-index: 100 !important; }

/* ==========================================================================
   UTILITY CLASSES - CURSOR & INTERACTION
   ========================================================================== */

.sp-cursor-pointer { cursor: pointer !important; }
.sp-cursor-not-allowed { cursor: not-allowed !important; }
.sp-pointer-events-none { pointer-events: none !important; }
.sp-select-none { user-select: none !important; }

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.sp-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sp-not-sr-only {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Focus visible for keyboard navigation */
.sp-focus-visible:focus {
    outline: 2px solid #E63946;
    outline-offset: 2px;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

/* Hide on specific breakpoints */
@media (max-width: 639px) {
    .sp-hide-xs { display: none !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
    .sp-hide-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .sp-hide-md { display: none !important; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .sp-hide-lg { display: none !important; }
}

@media (min-width: 1280px) {
    .sp-hide-xl { display: none !important; }
}

/* Mobile/Desktop visibility */
@media (max-width: 767px) {
    .sp-hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
    .sp-show-mobile-only { display: none !important; }
}

@media (min-width: 1024px) {
    .sp-hide-desktop { display: none !important; }
}

@media (max-width: 1023px) {
    .sp-show-desktop-only { display: none !important; }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .sp-header,
    .sp-footer,
    .sp-sidebar,
    .sp-dashboard-sidebar,
    .sp-btn,
    .sp-modal,
    .sp-dropdown-menu,
    .sp-toast,
    .sp-no-print {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .sp-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .sp-card,
    .sp-professor-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
