/* ============================================
   [STYLING] Global CSS
   Copy this to: frontend/assets/style.css
   Minimalist design for fast loading
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--theme-bg, #f8fafc) !important;
    color: var(--theme-text-main, #0f172a) !important;
    line-height: 1.6;
    transition: background-color 0.3s ease;
}

h1, h2, h3 {
    color: var(--theme-text-main, #0f172a) !important;
}

p#context-info {
    color: var(--theme-text-muted, #64748b) !important;
}

/* Hard Feature Hiding */
.feature-pro-only,
.feature-elite-only {
    display: none !important;
}

body[data-tier="pro"] .feature-pro-only,
body[data-tier="elite"] .feature-pro-only,
body[data-tier="elite"] .feature-elite-only {
    display: inline-block !important;
}

/* Premium Pill Badge */
.tier-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
}

.badge-starter {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-pro {
    background: #f3e8ff;
    color: #7e22ce;
}

.badge-elite {
    background: #fef08a;
    color: #854d0e;
}

/* [LAYOUT] Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* [NAVBAR] Top navigation */
.navbar {
    background-color: var(--theme-navbar, #ffffff) !important;
    border-bottom: 1px solid var(--theme-card-border, #e5e7eb) !important;
    color: var(--theme-nav-text, #1f2937) !important;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo,
.navbar #gym-name {
    color: var(--theme-nav-text, #1f2937) !important;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
}

/* [DASHBOARD] Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--theme-card-bg, #ffffff) !important;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--theme-card-border, #e2e8f0) !important;
    box-shadow: 0 4px 6px -1px var(--theme-card-shadow, rgba(0,0,0,0.1)) !important;
    color: var(--theme-text-main, #0f172a);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px var(--theme-card-shadow, rgba(0,0,0,0.15)) !important;
}

.stat-card .stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--theme-text-main, #1a1a1a);
    margin-bottom: 8px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--theme-text-muted, #6b7280) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* [MEMBERS] Member cards */
.member-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.member-info p {
    font-size: 14px;
    color: #6b7280;
}

/* [BADGES] Status badges */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-expiring {
    background: #fef3c7;
    color: #92400e;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #dbeafe;
    color: #1e40af;
}

/* [BUTTONS] All button styles */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--theme-primary, #2563eb) !important;
    border-color: var(--theme-primary, #2563eb) !important;
    color: white;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.btn-secondary {
    background: #f3f4f6;
    color: #1a1a1a;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

/* [FORMS] Form styling */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

/* [MOBILE] Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .member-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ============================================
   UPGRADE PATH:
   - Add dark mode support
   - Add animations
   - Add loading skeletons
   - Add toast notifications
   ============================================ */

/* [TOAST] Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none; /* Let clicks pass through empty space */
}

.toast {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #3b82f6; /* Default info blue */
    pointer-events: auto; /* Re-enable clicks on the toast itself */
}

.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }

.toast-icon {
    font-size: 18px;
}

.toast-message {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #9ca3af;
    line-height: 1;
    padding: 0 4px;
}

.toast-close:hover {
    color: #4b5563;
}

/* [JS-STYLE-INJECTION] Add active button style */
.filter-btn.active {
    background: var(--theme-primary, #2563eb) !important;
    color: white !important;
}

/* [LAYOUT] Sidebar System */
.main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 32px 20px;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 48px;
    padding: 0 12px;
    letter-spacing: -1px;
    color: #fff;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-link.active {
    background: var(--theme-primary, #6366f1);
    color: white;
}

.main-content {
    flex: 1;
    padding: 40px;
    background: radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

/* [GLASS-COMPONENTS] */
.glass-panel {
    background: var(--theme-card-bg, #1e293b);
    border: 1px solid var(--theme-card-border, #334155);
    border-radius: 20px;
    padding: 24px;
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.glass-table th {
    text-align: left;
    padding: 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* [UX] Loading States */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.03) 25%, 
        rgba(255, 255, 255, 0.08) 50%, 
        rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 4px;
    height: 20px;
    width: 100%;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.glass-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--theme-primary, #6366f1);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.empty-subtitle {
    font-size: 14px;
    color: #64748b;
}

/* [TRIAL-NOTIFICATIONS] Banner styles */
.trial-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.grace-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.2);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.banner-content h4 {
    margin: 0 0 4px 0;
    color: #1e40af;
    font-size: 16px;
    font-weight: 700;
}

.grace-banner .banner-content h4 {
    color: #92400e;
}

.banner-content p {
    margin: 0;
    font-size: 13px;
    color: #3b82f6;
}

.grace-banner .banner-content p {
    color: #b45309;
}

.banner-timer {
    font-family: monospace;
    font-weight: 700;
    background: rgba(255,255,255,0.5);
    padding: 2px 6px;
    border-radius: 4px;
}