/*
 * TestandTrack - Site-Wide Styles
 * ================================
 * Include this file in all your pages for consistent styling:
 * <link rel="stylesheet" href="testandtrack-styles.css">
 * 
 * This provides:
 * - CSS variables for colors
 * - Typography
 * - Buttons
 * - Cards
 * - Form elements
 * - Modal styles
 * - Utility classes
 */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary palette - purples */
    --tt-purple-50: #faf5ff;
    --tt-purple-100: #f3e8ff;
    --tt-purple-200: #e9d5ff;
    --tt-purple-300: #d8b4fe;
    --tt-purple-400: #c084fc;
    --tt-purple-500: #a855f7;
    --tt-purple-600: #9333ea;
    --tt-purple-700: #7c3aed;
    --tt-purple-800: #6b21a8;
    --tt-purple-900: #581c87;
    
    /* Indigo accents */
    --tt-indigo-500: #6366f1;
    --tt-indigo-600: #4f46e5;
    --tt-indigo-700: #4338ca;
    
    /* Pink accents */
    --tt-pink-300: #f9a8d4;
    --tt-pink-400: #f472b6;
    --tt-pink-500: #ec4899;
    
    /* Blue accents */
    --tt-blue-300: #93c5fd;
    --tt-blue-400: #60a5fa;
    --tt-blue-500: #3b82f6;
    
    /* Green/Cyan accents */
    --tt-green-400: #4ade80;
    --tt-green-500: #22c55e;
    --tt-cyan-300: #67e8f9;
    --tt-cyan-400: #22d3ee;
    
    /* Neutrals */
    --tt-slate-50: #f8fafc;
    --tt-slate-100: #f1f5f9;
    --tt-slate-200: #e2e8f0;
    --tt-slate-300: #cbd5e1;
    --tt-slate-400: #94a3b8;
    --tt-slate-500: #64748b;
    --tt-slate-600: #475569;
    --tt-slate-700: #334155;
    --tt-slate-800: #1e293b;
    --tt-slate-900: #0f172a;
    
    /* Semantic colors */
    --tt-success: #10b981;
    --tt-warning: #f59e0b;
    --tt-error: #ef4444;
    --tt-info: #6366f1;
    
    /* Background colors */
    --tt-bg-primary: #fafaff;
    --tt-bg-secondary: #f8f7ff;
    --tt-bg-card: #ffffff;
    
    /* Text colors */
    --tt-text-primary: #1e1b4b;
    --tt-text-secondary: #64748b;
    --tt-text-muted: #94a3b8;
    
    /* Gradients */
    --tt-gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --tt-gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #6366f1 100%);
    --tt-gradient-hero: linear-gradient(135deg, #fafaff 0%, #f3f0ff 50%, #fdf2f8 100%);
    
    /* Shadows */
    --tt-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --tt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --tt-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --tt-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --tt-shadow-purple: 0 4px 20px rgba(139, 92, 246, 0.25);
    --tt-shadow-purple-lg: 0 8px 30px rgba(139, 92, 246, 0.35);
    
    /* Border radius */
    --tt-radius-sm: 8px;
    --tt-radius-md: 12px;
    --tt-radius-lg: 16px;
    --tt-radius-xl: 24px;
    --tt-radius-full: 9999px;
    
    /* Transitions */
    --tt-transition-fast: 150ms ease;
    --tt-transition-normal: 200ms ease;
    --tt-transition-slow: 300ms ease;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--tt-bg-primary);
    color: var(--tt-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--tt-text-primary);
}

h1 { font-size: 2.5rem; font-weight: 900; }
h2 { font-size: 2rem; font-weight: 800; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.25rem; font-weight: 700; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; }

p {
    color: var(--tt-text-secondary);
    line-height: 1.7;
}

.tt-text-gradient {
    background: var(--tt-gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: tt-gradient-shift 8s ease infinite;
}

@keyframes tt-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== BUTTONS ===== */
.tt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--tt-radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--tt-transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.tt-btn-primary {
    background: var(--tt-gradient-primary);
    color: white;
    box-shadow: var(--tt-shadow-purple);
}

.tt-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--tt-shadow-purple-lg);
}

.tt-btn-secondary {
    background: white;
    color: var(--tt-purple-600);
    border: 2px solid rgba(139, 92, 246, 0.2);
}

.tt-btn-secondary:hover {
    border-color: var(--tt-purple-500);
    background: rgba(139, 92, 246, 0.05);
}

.tt-btn-ghost {
    background: transparent;
    color: var(--tt-text-secondary);
}

.tt-btn-ghost:hover {
    background: var(--tt-slate-100);
    color: var(--tt-text-primary);
}

.tt-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.tt-btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.tt-btn-full {
    width: 100%;
}

.tt-btn-rounded {
    border-radius: var(--tt-radius-full);
}

/* ===== CARDS ===== */
.tt-card {
    background: var(--tt-bg-card);
    border: 2px solid rgba(139, 92, 246, 0.08);
    border-radius: var(--tt-radius-xl);
    padding: 1.5rem;
    transition: all var(--tt-transition-normal);
}

.tt-card:hover {
    border-color: rgba(139, 92, 246, 0.15);
    box-shadow: var(--tt-shadow-lg);
}

.tt-card-elevated {
    box-shadow: var(--tt-shadow-md);
}

/* ===== FORM ELEMENTS ===== */
.tt-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--tt-text-primary);
    background: white;
    border: 2px solid var(--tt-slate-200);
    border-radius: var(--tt-radius-md);
    transition: all var(--tt-transition-fast);
    outline: none;
}

.tt-input:focus {
    border-color: var(--tt-purple-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.tt-input::placeholder {
    color: var(--tt-slate-400);
}

.tt-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--tt-text-primary);
}

.tt-input-group {
    margin-bottom: 1rem;
}

.tt-input-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--tt-text-muted);
}

.tt-input-error {
    border-color: var(--tt-error);
}

.tt-input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== AUTH TABS ===== */
.tt-auth-tabs {
    display: flex;
    background: var(--tt-slate-100);
    border-radius: var(--tt-radius-lg);
    padding: 4px;
    margin-bottom: 1.5rem;
}

.tt-auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tt-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--tt-radius-md);
    cursor: pointer;
    transition: all var(--tt-transition-fast);
}

.tt-auth-tab:hover {
    color: var(--tt-text-primary);
}

.tt-auth-tab.active {
    background: white;
    color: var(--tt-text-primary);
    box-shadow: var(--tt-shadow-sm);
}

/* ===== MODAL ===== */
.tt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--tt-transition-normal);
}

.tt-modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.tt-modal {
    background: white;
    border-radius: var(--tt-radius-xl);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: all var(--tt-transition-normal);
}

.tt-modal-backdrop.open .tt-modal {
    transform: scale(1) translateY(0);
}

.tt-modal-header {
    padding: 1.5rem 1.5rem 0;
    text-align: center;
}

.tt-modal-logo {
    width: 56px;
    height: 56px;
    background: var(--tt-gradient-primary);
    border-radius: var(--tt-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: var(--tt-shadow-purple);
}

.tt-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    background: var(--tt-slate-100);
    border: none;
    border-radius: var(--tt-radius-md);
    color: var(--tt-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--tt-transition-fast);
}

.tt-modal-close:hover {
    background: var(--tt-slate-200);
    color: var(--tt-text-primary);
}

.tt-modal-body {
    padding: 1.5rem;
}

/* ===== AVATAR PICKER ===== */
.tt-avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tt-avatar-option {
    width: 44px;
    height: 44px;
    border: 2px solid var(--tt-slate-200);
    border-radius: var(--tt-radius-md);
    background: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--tt-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-avatar-option:hover {
    border-color: var(--tt-purple-300);
    background: var(--tt-purple-50);
}

.tt-avatar-option.selected {
    border-color: var(--tt-purple-500);
    background: var(--tt-purple-100);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* ===== ALERTS / ERRORS ===== */
.tt-alert {
    padding: 0.875rem 1rem;
    border-radius: var(--tt-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.tt-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.tt-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.tt-alert-info {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

/* ===== BADGES ===== */
.tt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--tt-radius-full);
    background: var(--tt-slate-100);
    color: var(--tt-text-secondary);
}

.tt-badge-purple {
    background: var(--tt-purple-100);
    color: var(--tt-purple-700);
}

.tt-badge-green {
    background: #dcfce7;
    color: #166534;
}

.tt-badge-live {
    background: white;
    border: 2px solid rgba(139, 92, 246, 0.15);
    box-shadow: var(--tt-shadow-sm);
}

.tt-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tt-green-500);
    animation: tt-pulse 2s ease-in-out infinite;
}

@keyframes tt-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== DIVIDERS ===== */
.tt-divider {
    height: 2px;
    background: var(--tt-slate-100);
    border: none;
    margin: 1.5rem 0;
}

.tt-divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--tt-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 1.5rem 0;
}

.tt-divider-text::before,
.tt-divider-text::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--tt-slate-100);
}

/* ===== UTILITY CLASSES ===== */
.tt-text-center { text-align: center; }
.tt-text-left { text-align: left; }
.tt-text-right { text-align: right; }

.tt-text-primary { color: var(--tt-text-primary); }
.tt-text-secondary { color: var(--tt-text-secondary); }
.tt-text-muted { color: var(--tt-text-muted); }
.tt-text-purple { color: var(--tt-purple-600); }

.tt-font-bold { font-weight: 700; }
.tt-font-semibold { font-weight: 600; }
.tt-font-medium { font-weight: 500; }

.tt-mb-0 { margin-bottom: 0; }
.tt-mb-1 { margin-bottom: 0.25rem; }
.tt-mb-2 { margin-bottom: 0.5rem; }
.tt-mb-3 { margin-bottom: 0.75rem; }
.tt-mb-4 { margin-bottom: 1rem; }
.tt-mb-6 { margin-bottom: 1.5rem; }

.tt-mt-0 { margin-top: 0; }
.tt-mt-1 { margin-top: 0.25rem; }
.tt-mt-2 { margin-top: 0.5rem; }
.tt-mt-3 { margin-top: 0.75rem; }
.tt-mt-4 { margin-top: 1rem; }
.tt-mt-6 { margin-top: 1.5rem; }

.tt-hidden { display: none !important; }
.tt-visible { display: block; }

/* ===== LINK STYLES ===== */
.tt-link {
    color: var(--tt-purple-600);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--tt-transition-fast);
}

.tt-link:hover {
    color: var(--tt-purple-700);
    text-decoration: underline;
}

/* ===== ANIMATIONS ===== */
@keyframes tt-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tt-slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes tt-scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.tt-animate-fadeIn { animation: tt-fadeIn 0.3s ease forwards; }
.tt-animate-slideIn { animation: tt-slideIn 0.3s ease forwards; }
.tt-animate-scaleIn { animation: tt-scaleIn 0.3s ease forwards; }

/* ===== RESPONSIVE HELPERS ===== */
@media (max-width: 640px) {
    .tt-hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
    .tt-hide-desktop { display: none !important; }
}
