/**
 * Gymnastics Plus - Core Design System
 * Modern, minimal design - black/white primary, gold accent (sparingly)
 */

:root {
    /* Primary Colors */
    --gp-white: #ffffff;
    --gp-black: #000000;
    --gp-gray-50: #fafafa;
    --gp-gray-100: #f5f5f5;
    --gp-gray-200: #e5e5e5;
    --gp-gray-300: #d4d4d4;
    --gp-gray-400: #a3a3a3;
    --gp-gray-500: #737373;
    --gp-gray-600: #525252;
    --gp-gray-700: #404040;
    --gp-gray-800: #262626;
    --gp-gray-900: #171717;
    
    /* Accent - Use Sparingly */
    --gp-gold: #DFB859;
    --gp-gold-hover: #c9a64e;
    --gp-gold-light: rgba(223, 184, 89, 0.1);
    
    /* Semantic Colors */
    --gp-success: #22c55e;
    --gp-error: #ef4444;
    --gp-warning: #f59e0b;
    --gp-info: #3b82f6;
    
    /* Layout */
    --gp-sidebar-width: 260px;
    --gp-header-height: 64px;
    --gp-bottom-nav-height: 64px;
    --gp-content-max-width: 1200px;
    --gp-card-radius: 12px;
    --gp-card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --gp-card-shadow-hover: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    
    /* Typography */
    --gp-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --gp-font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Transitions */
    --gp-transition-fast: 150ms ease;
    --gp-transition-base: 200ms ease;
    --gp-transition-slow: 300ms ease;
}

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

body.gp-app {
    margin: 0;
    padding: 0;
    font-family: var(--gp-font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--gp-gray-900);
    background: var(--gp-gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT STRUCTURE
   ======================================== */
.gp-layout {
    display: flex;
    min-height: 100vh;
}

.gp-sidebar {
    width: var(--gp-sidebar-width);
    background: var(--gp-white);
    border-right: 1px solid var(--gp-gray-200);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--gp-transition-base);
}

.gp-main {
    flex: 1;
    margin-left: var(--gp-sidebar-width);
    min-height: 100vh;
}

.gp-content {
    max-width: var(--gp-content-max-width);
    margin: 0 auto;
    padding: 32px 24px;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */
.gp-sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--gp-gray-200);
}

.gp-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gp-gray-900);
}

.gp-sidebar-logo svg {
    width: 32px;
    height: 32px;
}

.gp-sidebar-logo span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gp-sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.gp-nav-section {
    margin-bottom: 24px;
}

.gp-nav-section:last-child {
    margin-bottom: 0;
}

.gp-nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gp-gray-500);
    padding: 0 12px;
    margin-bottom: 8px;
}

.gp-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gp-gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--gp-transition-fast);
}

.gp-nav-item:hover {
    background: var(--gp-gray-100);
    color: var(--gp-gray-900);
}

.gp-nav-item.active {
    background: var(--gp-gray-900);
    color: var(--gp-white);
}

.gp-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.75;
}

.gp-nav-item .gp-nav-badge {
    margin-left: auto;
    background: var(--gp-gray-200);
    color: var(--gp-gray-600);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.gp-nav-item.active .gp-nav-badge {
    background: var(--gp-white);
    color: var(--gp-gray-900);
}

/* Sidebar Footer */
.gp-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gp-gray-200);
}

.gp-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--gp-transition-fast);
}

.gp-user-menu:hover {
    background: var(--gp-gray-100);
}

.gp-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gp-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gp-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gp-user-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--gp-gray-500);
}

.gp-user-info {
    flex: 1;
    min-width: 0;
}

.gp-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gp-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gp-user-role {
    font-size: 12px;
    color: var(--gp-gray-500);
}

/* ========================================
   MOBILE BOTTOM NAVIGATION
   ======================================== */
.gp-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--gp-bottom-nav-height);
    background: var(--gp-white);
    border-top: 1px solid var(--gp-gray-200);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.gp-bottom-nav-inner {
    display: flex;
    height: 100%;
}

.gp-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--gp-gray-500);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color var(--gp-transition-fast);
}

.gp-bottom-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.75;
}

.gp-bottom-nav-item.active {
    color: var(--gp-gray-900);
}

/* Mobile Header */
.gp-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--gp-header-height);
    background: var(--gp-white);
    border-bottom: 1px solid var(--gp-gray-200);
    z-index: 99;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.gp-mobile-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--gp-gray-900);
    text-decoration: none;
}

.gp-mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gp-gray-700);
}

.gp-mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   CARDS
   ======================================== */
.gp-card {
    background: var(--gp-white);
    border-radius: var(--gp-card-radius);
    box-shadow: var(--gp-card-shadow);
}

.gp-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.gp-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gp-gray-900);
    margin: 0;
}

.gp-card-body {
    padding: 24px;
}

.gp-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gp-gray-200);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   PAGE HEADER
   ======================================== */
.gp-page-header {
    margin-bottom: 32px;
}

.gp-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gp-gray-900);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.gp-page-subtitle {
    font-size: 15px;
    color: var(--gp-gray-500);
    margin: 0;
}

.gp-page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

/* ========================================
   BUTTONS
   ======================================== */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--gp-transition-fast);
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.gp-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.gp-btn-primary {
    background: var(--gp-gray-900);
    color: var(--gp-white);
}

.gp-btn-primary:hover {
    background: var(--gp-gray-800);
    color: var(--gp-white);
}

.gp-btn-secondary {
    background: var(--gp-white);
    color: var(--gp-gray-700);
    border: 1px solid var(--gp-gray-300);
}

.gp-btn-secondary:hover {
    background: var(--gp-gray-50);
    border-color: var(--gp-gray-400);
}

.gp-btn-ghost {
    background: transparent;
    color: var(--gp-gray-700);
}

.gp-btn-ghost:hover {
    background: var(--gp-gray-100);
}

/* Gold accent button - use sparingly */
.gp-btn-accent {
    background: var(--gp-gold);
    color: var(--gp-gray-900);
}

.gp-btn-accent:hover {
    background: var(--gp-gold-hover);
}

.gp-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.gp-btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.gp-btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
}

.gp-btn-icon.gp-btn-sm {
    width: 32px;
    height: 32px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.gp-form-group {
    margin-bottom: 20px;
}

.gp-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gp-gray-700);
    margin-bottom: 6px;
}

.gp-form-label .required {
    color: var(--gp-error);
}

.gp-form-input,
.gp-form-select,
.gp-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gp-gray-300);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--gp-gray-900);
    background: var(--gp-white);
    transition: border-color var(--gp-transition-fast), box-shadow var(--gp-transition-fast);
}

.gp-form-input:focus,
.gp-form-select:focus,
.gp-form-textarea:focus {
    outline: none;
    border-color: var(--gp-gray-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

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

.gp-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.gp-form-hint {
    font-size: 13px;
    color: var(--gp-gray-500);
    margin-top: 6px;
}

.gp-form-error {
    font-size: 13px;
    color: var(--gp-error);
    margin-top: 6px;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.gp-grid {
    display: grid;
    gap: 24px;
}

.gp-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gp-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gp-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gp-grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ========================================
   EMPTY STATES
   ======================================== */
.gp-empty {
    text-align: center;
    padding: 60px 24px;
}

.gp-empty svg {
    width: 64px;
    height: 64px;
    color: var(--gp-gray-300);
    margin-bottom: 16px;
}

.gp-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gp-gray-900);
    margin: 0 0 8px 0;
}

.gp-empty-text {
    font-size: 15px;
    color: var(--gp-gray-500);
    margin: 0 0 24px 0;
}

/* ========================================
   BADGES
   ======================================== */
.gp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--gp-gray-100);
    color: var(--gp-gray-700);
}

.gp-badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.gp-badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.gp-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

/* ========================================
   LOADING STATES
   ======================================== */
.gp-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gp-gray-200);
    border-top-color: var(--gp-gray-900);
    border-radius: 50%;
    animation: gp-spin 0.6s linear infinite;
}

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

.gp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

/* ========================================
   TOASTS
   ======================================== */
.gp-toast-container {
    position: fixed;
    bottom: calc(var(--gp-bottom-nav-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gp-toast {
    background: var(--gp-gray-900);
    color: var(--gp-white);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: gp-toast-in 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gp-toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.gp-toast-success {
    background: var(--gp-success);
}

.gp-toast-error {
    background: var(--gp-error);
}

@keyframes gp-toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   LOGIN PROMPT
   ======================================== */
.gp-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 24px;
}

.gp-login-prompt svg {
    width: 80px;
    height: 80px;
    color: var(--gp-gray-300);
    margin-bottom: 24px;
}

.gp-login-prompt h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gp-gray-900);
    margin: 0 0 12px 0;
}

.gp-login-prompt p {
    font-size: 16px;
    color: var(--gp-gray-500);
    margin: 0 0 32px 0;
    max-width: 400px;
}

/* ========================================
   ACCESS DENIED
   ======================================== */
.gp-access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 24px;
}

.gp-access-denied svg {
    width: 80px;
    height: 80px;
    color: var(--gp-gray-300);
    margin-bottom: 24px;
}

.gp-access-denied h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gp-gray-900);
    margin: 0 0 12px 0;
}

.gp-access-denied p {
    font-size: 16px;
    color: var(--gp-gray-500);
    margin: 0 0 32px 0;
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .gp-sidebar {
        transform: translateX(-100%);
    }
    
    .gp-sidebar.open {
        transform: translateX(0);
    }
    
    .gp-main {
        margin-left: 0;
        padding-bottom: var(--gp-bottom-nav-height);
    }
    
    .gp-mobile-header {
        display: flex;
    }
    
    .gp-bottom-nav {
        display: block;
    }
    
    .gp-content {
        padding: calc(var(--gp-header-height) + 24px) 16px 24px;
    }
    
    .gp-page-title {
        font-size: 24px;
    }
    
    .gp-grid-2,
    .gp-grid-3,
    .gp-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .gp-card-header,
    .gp-card-body,
    .gp-card-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .gp-toast-container {
        left: 16px;
        right: 16px;
        transform: none;
    }
}

/* Sidebar overlay for mobile */
.gp-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.gp-sidebar-overlay.active {
    display: block;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.gp-text-center { text-align: center; }
.gp-text-right { text-align: right; }
.gp-text-muted { color: var(--gp-gray-500); }
.gp-text-sm { font-size: 13px; }
.gp-text-lg { font-size: 18px; }
.gp-font-bold { font-weight: 700; }
.gp-mt-0 { margin-top: 0; }
.gp-mb-0 { margin-bottom: 0; }
.gp-mb-4 { margin-bottom: 16px; }
.gp-mb-6 { margin-bottom: 24px; }
.gp-mb-8 { margin-bottom: 32px; }
.gp-flex { display: flex; }
.gp-flex-col { flex-direction: column; }
.gp-items-center { align-items: center; }
.gp-justify-between { justify-content: space-between; }
.gp-gap-2 { gap: 8px; }
.gp-gap-4 { gap: 16px; }
.gp-gap-6 { gap: 24px; }
.gp-hidden { display: none !important; }
