/*
==============================================
GLOBAL.CSS - Master Brand Styles
==============================================
This file controls the overall look and feel of AthletePulse.
Change colors, fonts, or button styles here to update ALL pages.

Last updated: 2025-11-10
==============================================
*/

/* ============================================
   CSS VARIABLES - Brand Colors & Spacing
   ============================================ */
:root {
    /* Primary Brand Colors */
    --primary-blue: #3498db;
    --primary-dark-blue: #2980b9;
    --primary-gradient: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    
    /* Accent Colors */
    --accent-orange: #f46b45;
    --accent-purple: #667eea;
    --accent-purple-dark: #764ba2;
    
    /* Neutral Colors */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #e5e7eb;
    --gray-300: #e1e5e9;
    --gray-400: #bdc3c7;
    --gray-500: #95a5a6;
    --gray-600: #555;
    --gray-700: #374151;
    --gray-800: #333;
    --gray-900: #2c3e50;
    
    /* Status Colors */
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    
    /* Background Colors */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Text Colors */
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #95a5a6;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 30px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(26, 42, 108, 0.3);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* ============================================
   CONTAINERS & LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ============================================
   BUTTONS - Universal Button Styles
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    min-height: 44px;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button (Blue Gradient) */
.btn-primary, .btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover, .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 42, 108, 0.4);
}

/* Secondary Button (Outline) */
.btn-secondary, .btn.secondary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover, .btn.secondary:hover {
    background: var(--primary-blue);
    color: white;
}

/* Ghost Button (Transparent with border) */
.btn-ghost, .btn.ghost {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-ghost:hover, .btn.ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Success Button */
.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* Danger Button */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Full Width Button */
.btn-full, .btn-block {
    width: 100%;
    display: flex;
}

/* ============================================
   FORMS - Input Fields & Form Elements
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group.compact {
    margin-bottom: var(--spacing-sm);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--gray-700);
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background: white;
    color: var(--text-primary);
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* ============================================
   CARDS - Universal Card Styles
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: var(--spacing-sm) 0;
}

.card-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: var(--success);
}

.alert-danger, .alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: var(--danger);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: var(--info);
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead {
    background: var(--gray-50);
}

th {
    padding: var(--spacing-sm);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--gray-200);
}

td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--gray-200);
}

tr:hover {
    background: var(--gray-50);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Spacing */
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

/* Background Colors */
.bg-light { background-color: var(--bg-light); }
.bg-white { background-color: var(--bg-white); }
.bg-primary { background-color: var(--primary-blue); }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

/* Flexbox Utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: var(--spacing-xs); }
.gap-2 { gap: var(--spacing-sm); }
.gap-3 { gap: var(--spacing-md); }

/* Width */
.w-100 { width: 100%; }
.w-75 { width: 75%; }
.w-50 { width: 50%; }
.w-25 { width: 25%; }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .btn {
        padding: 0.75rem 1.25rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   TIER-GATED SANITIZATION
   Hide Performance/Elite features for Foundation users
   ============================================ */
.tier-performance-only,
.tier-elite-only {
    /* Default: visible for Performance/Elite users */
}

/* Hide Performance/Elite features when Foundation user is active */
body.foundation-user .tier-performance-only,
body.foundation-user .tier-elite-only {
    display: none !important;
}
