/**
 * SkaterWorld Design System
 * A comprehensive, professional CSS framework for the SkaterWorld application
 * Maintains orange branding while providing modern, responsive components
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    /* Primary Brand Colors - Orange Theme */
    --sw-primary: #ec814b;
    --sw-primary-light: #f5a066;
    --sw-primary-dark: #d66a35;
    --sw-primary-rgb: 236, 129, 75;

    /* Secondary Colors */
    --sw-secondary: #2c3e50;
    --sw-secondary-light: #34495e;
    --sw-secondary-dark: #1a252f;

    /* Accent Colors */
    --sw-accent: #3498db;
    --sw-accent-light: #5dade2;
    --sw-accent-dark: #2980b9;

    /* Status Colors */
    --sw-success: #27ae60;
    --sw-success-light: #2ecc71;
    --sw-warning: #f39c12;
    --sw-warning-light: #f1c40f;
    --sw-danger: #e74c3c;
    --sw-danger-light: #ec7063;
    --sw-info: #17a2b8;
    --sw-info-light: #3498db;

    /* Medal Colors */
    --sw-gold: #FFD700;
    --sw-silver: #C0C0C0;
    --sw-bronze: #CD7F32;

    /* Neutral Colors */
    --sw-white: #ffffff;
    --sw-gray-50: #fafafa;
    --sw-gray-100: #f5f5f5;
    --sw-gray-200: #eeeeee;
    --sw-gray-300: #e0e0e0;
    --sw-gray-400: #bdbdbd;
    --sw-gray-500: #9e9e9e;
    --sw-gray-600: #757575;
    --sw-gray-700: #616161;
    --sw-gray-800: #424242;
    --sw-gray-900: #212121;
    --sw-black: #000000;

    /* Background Colors */
    --sw-bg-primary: #f8f9fa;
    --sw-bg-secondary: #ffffff;
    --sw-bg-dark: var(--sw-secondary);

    /* Text Colors */
    --sw-text-primary: #2c3e50;
    --sw-text-secondary: #6c757d;
    --sw-text-muted: #95a5a6;
    --sw-text-light: #ffffff;

    /* Shadows */
    --sw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --sw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --sw-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --sw-shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    --sw-shadow-hover: 0 8px 30px rgba(230, 126, 34, 0.2);

    /* Border Radius */
    --sw-radius-sm: 0.25rem;
    --sw-radius-md: 0.5rem;
    --sw-radius-lg: 0.75rem;
    --sw-radius-xl: 1rem;
    --sw-radius-2xl: 1.5rem;
    --sw-radius-full: 50%;

    /* Spacing Scale */
    --sw-space-1: 0.25rem;
    --sw-space-2: 0.5rem;
    --sw-space-3: 0.75rem;
    --sw-space-4: 1rem;
    --sw-space-5: 1.5rem;
    --sw-space-6: 2rem;
    --sw-space-7: 2.5rem;
    --sw-space-8: 3rem;

    /* Typography */
    --sw-font-primary: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sw-font-heading: 'Poppins', var(--sw-font-primary);
    --sw-font-mono: 'Fira Code', 'Consolas', monospace;

    /* Font Sizes */
    --sw-text-xs: 0.75rem;
    --sw-text-sm: 0.875rem;
    --sw-text-base: 1rem;
    --sw-text-lg: 1.125rem;
    --sw-text-xl: 1.25rem;
    --sw-text-2xl: 1.5rem;
    --sw-text-3xl: 1.875rem;
    --sw-text-4xl: 2.25rem;

    /* Z-Index Layers */
    --sw-z-dropdown: 1000;
    --sw-z-sticky: 1020;
    --sw-z-fixed: 1030;
    --sw-z-modal-backdrop: 1040;
    --sw-z-modal: 1050;
    --sw-z-popover: 1060;
    --sw-z-tooltip: 1070;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--sw-font-primary);
    background-color: var(--sw-bg-primary);
    color: var(--sw-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--sw-font-heading);
    font-weight: 700;
    color: var(--sw-text-primary);
    margin-bottom: 0.5em;
}

a {
    color: var(--sw-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--sw-primary-dark);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sw-text-primary {
    color: var(--sw-primary) !important;
}

.sw-text-secondary {
    color: var(--sw-secondary) !important;
}

.sw-bg-primary {
    background-color: var(--sw-primary) !important;
}

.sw-bg-light {
    background-color: var(--sw-bg-primary) !important;
}

.sw-bg-white {
    background-color: var(--sw-white) !important;
}

.sw-shadow-sm {
    box-shadow: var(--sw-shadow-sm) !important;
}

.sw-shadow-md {
    box-shadow: var(--sw-shadow-md) !important;
}

.sw-shadow-lg {
    box-shadow: var(--sw-shadow-lg) !important;
}

.sw-rounded-md {
    border-radius: var(--sw-radius-md) !important;
}

.sw-rounded-lg {
    border-radius: var(--sw-radius-lg) !important;
}

.sw-rounded-xl {
    border-radius: var(--sw-radius-xl) !important;
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-family: var(--sw-font-primary);
    font-weight: 600;
    font-size: var(--sw-text-base);
    border-radius: var(--sw-radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.sw-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sw-shadow-md);
}

.sw-btn:active {
    transform: translateY(0);
}

.sw-btn-primary {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 129, 75, 0.3);
}

.sw-btn-primary:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(236, 129, 75, 0.4);
}

.sw-btn-secondary {
    background: var(--sw-secondary);
    color: white;
}

.sw-btn-secondary:hover {
    background: var(--sw-secondary-dark);
    color: white;
}

.sw-btn-outline {
    background: transparent;
    border: 2px solid var(--sw-primary);
    color: var(--sw-primary);
}

.sw-btn-outline:hover {
    background: var(--sw-primary);
    color: white;
}

.sw-btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: var(--sw-text-sm);
}

.sw-btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: var(--sw-text-lg);
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.sw-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--sw-gray-200);
}

.sw-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sw-shadow-hover);
}

.sw-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--sw-gray-100);
    background: var(--sw-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sw-card-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sw-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sw-card-body {
    padding: 1.25rem;
}

.sw-card-footer {
    padding: 1rem 1.25rem;
    background: var(--sw-gray-50);
    border-top: 1px solid var(--sw-gray-100);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.sw-form-group {
    margin-bottom: 1.5rem;
}

.sw-form-label {
    display: block;
    font-weight: 600;
    color: var(--sw-text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.sw-form-input,
.sw-form-select,
.sw-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--sw-font-primary);
    font-size: var(--sw-text-base);
    border: 2px solid var(--sw-gray-200);
    border-radius: var(--sw-radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--sw-white);
}

.sw-form-input:focus,
.sw-form-select:focus,
.sw-form-textarea:focus {
    outline: none;
    border-color: var(--sw-primary);
    box-shadow: 0 0 0 4px rgba(236, 129, 75, 0.1);
}

.sw-form-input::placeholder {
    color: var(--sw-gray-400);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.sw-page-header {
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-dark) 100%);
    padding: 2rem 0;
    color: white;
    margin-bottom: 2rem;
    box-shadow: var(--sw-shadow-md);
}

.sw-page-header-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.sw-page-header-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================
   TABLE STYLES
   ============================================ */
.sw-table-responsive {
    overflow-x: auto;
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow-sm);
}

.sw-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--sw-white);
}

.sw-table th {
    background: var(--sw-gray-50);
    color: var(--sw-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--sw-gray-200);
}

.sw-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--sw-gray-100);
    color: var(--sw-text-primary);
    vertical-align: middle;
}

.sw-table tr:last-child td {
    border-bottom: none;
}

.sw-table tr:hover {
    background-color: var(--sw-gray-50);
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.sw-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sw-badge-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--sw-success);
}

.sw-badge-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--sw-warning);
}

.sw-badge-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--sw-danger);
}

.sw-badge-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--sw-info);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.sw-alert {
    padding: 1rem;
    border-radius: var(--sw-radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid transparent;
}

.sw-alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--sw-success-dark);
    border-left-color: var(--sw-success);
}

.sw-alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--sw-danger);
    border-left-color: var(--sw-danger);
}

.sw-alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--sw-warning-dark);
    border-left-color: var(--sw-warning);
}

.sw-alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--sw-info-dark);
    border-left-color: var(--sw-info);
}

/* ============================================
   STAT CARDS
   ============================================ */
.sw-stat-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--sw-shadow-sm);
    border: 1px solid var(--sw-gray-200);
    transition: transform 0.3s ease;
}

.sw-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sw-shadow-md);
}

.sw-stat-card-label {
    font-size: 0.9rem;
    color: var(--sw-text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.sw-stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sw-text-primary);
    line-height: 1;
}

.sw-stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(236, 129, 75, 0.1);
    color: var(--sw-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes sw-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sw-animate-fade-in {
    animation: sw-fade-in 0.5s ease-out forwards;
}

.sw-animate-slide-up {
    animation: sw-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    .sw-page-header {
        padding: 1.5rem 0;
    }

    .sw-page-header-title {
        font-size: 1.5rem;
    }

    .sw-btn {
        width: 100%;
        justify-content: center;
    }

    .sw-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}