/* ============================================
   VALORANT TRACKER - MATERIAL DESIGN + VALORANT THEME
   Design System: Material Design 3 + Valorant Brand
   ============================================ */

/* --- FONT IMPORTS --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* --- VALORANT COLOR PALETTE --- */
  --val-red-primary: #FF4655;
  --val-red-dark: #FD4556;
  --val-red-glow: rgba(255, 70, 85, 0.6);
  
  --val-bg-darkest: #0F1923;
  --val-bg-dark: #1C252E;
  --val-bg-card: #212A34;
  --val-bg-elevated: #2A3540;
  
  --val-accent-gold: #ECE8DF;
  --val-accent-teal: #00C9B7;
  --val-accent-blue: #0F5CFF;
  
  /* --- TEXT COLORS --- */
  --text-primary: #FFFFFF;
  --text-secondary: #A8B9C4;
  --text-tertiary: #6B7C8C;
  --text-disabled: #4A5560;
  
  /* --- MATERIAL DESIGN ELEVATION SHADOWS --- */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3),
               0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.3),
               0 4px 6px -1px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 6px -2px rgba(0, 0, 0, 0.3),
               0 10px 15px -3px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 10px 25px -3px rgba(0, 0, 0, 0.3),
               0 20px 25px -5px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  
  /* --- GLOW EFFECTS (VALORANT STYLE) --- */
  --glow-red: 0 0 20px var(--val-red-glow),
              0 0 40px var(--val-red-glow);
  --glow-teal: 0 0 20px rgba(0, 201, 183, 0.5),
               0 0 40px rgba(0, 201, 183, 0.3);
  
  /* --- SPACING SYSTEM (4px base) --- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* --- BORDER RADIUS --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* --- TYPOGRAPHY --- */
  --font-primary: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Roboto', 'Inter', sans-serif;
  
  /* --- TRANSITIONS --- */
  --transition-quick: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-standard: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-complex: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-emphasized: 400ms cubic-bezier(0.05, 0.7, 0.1, 1);
  
  /* --- Z-INDEX LAYERS --- */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--val-bg-darkest);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- TYPOGRAPHY SCALE --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 { font-size: 3rem; font-weight: 900; letter-spacing: -0.5px; }
h2 { font-size: 2.25rem; font-weight: 700; }
h3 { font-size: 1.875rem; font-weight: 700; }
h4 { font-size: 1.5rem; font-weight: 600; }
h5 { font-size: 1.25rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: var(--space-md); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

/* --- MATERIAL DESIGN COMPONENTS --- */

/* CARDS */
.card {
  background: var(--val-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-standard);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.card-elevated {
  background: var(--val-bg-elevated);
  box-shadow: var(--shadow-xl);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-standard);
  position: relative;
  overflow: hidden;
  min-height: 48px; /* Touch target */
}

.btn-primary {
  background: var(--val-red-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--val-red-dark);
  box-shadow: var(--shadow-lg), var(--glow-red);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--val-bg-elevated);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: var(--val-bg-card);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  padding: var(--space-md);
  min-width: 48px;
  min-height: 48px;
  border-radius: var(--radius-full);
}

/* FAB (Floating Action Button) */
.fab {
  position: fixed;
  bottom: var(--space-2xl);
  right: var(--space-2xl);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--val-red-primary);
  color: var(--text-primary);
  border: none;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  transition: all var(--transition-standard);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-fixed);
}

.fab:hover {
  box-shadow: var(--shadow-2xl), var(--glow-red);
  transform: scale(1.1);
}

/* INPUTS */
.input-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.input {
  width: 100%;
  padding: var(--space-md);
  background: var(--val-bg-dark);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all var(--transition-standard);
  outline: none;
}

.input:focus {
  border-color: var(--val-red-primary);
  background: var(--val-bg-card);
  box-shadow: 0 0 0 4px rgba(255, 70, 85, 0.1);
}

.input::placeholder {
  color: var(--text-tertiary);
}

/* SEARCH BAR (MATERIAL STYLE) */
.search-container {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--val-bg-darkest);
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--val-bg-dark);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-standard);
}

.search-bar:focus-within {
  box-shadow: var(--shadow-lg);
  background: var(--val-bg-card);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  padding: var(--space-sm) 0;
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

/* TABS (MATERIAL DESIGN) */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-standard);
  white-space: nowrap;
  min-height: 48px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--val-red-primary);
  transform: scaleX(0);
  transition: transform var(--transition-standard);
}

.tab.active {
  color: var(--val-red-primary);
}

.tab.active::after {
  transform: scaleX(1);
}

.tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* BADGES & CHIPS */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-red {
  background: rgba(255, 70, 85, 0.2);
  color: var(--val-red-primary);
  border: 1px solid var(--val-red-primary);
}

.badge-teal {
  background: rgba(0, 201, 183, 0.2);
  color: var(--val-accent-teal);
  border: 1px solid var(--val-accent-teal);
}

.badge-gold {
  background: rgba(236, 232, 223, 0.2);
  color: var(--val-accent-gold);
  border: 1px solid var(--val-accent-gold);
}

/* VALORANT ANGULAR CUTS (DIAMOND PATTERN) */
.angular-cut {
  clip-path: polygon(0 8px, 8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px));
}

.angular-header {
  position: relative;
  padding: var(--space-2xl) var(--space-lg);
  background: linear-gradient(135deg, var(--val-red-dark) 0%, var(--val-red-primary) 100%);
}

.angular-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
  clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%);
}

/* RANK BADGE WITH GLOW */
.rank-badge {
  position: relative;
  padding: var(--space-lg);
  background: var(--val-bg-elevated);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 2px solid transparent;
  transition: all var(--transition-complex);
}

.rank-badge.radiant {
  border-color: var(--val-accent-gold);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(236, 232, 223, 0.4);
}

.rank-badge.immortal {
  border-color: var(--val-red-primary);
  box-shadow: var(--shadow-xl), var(--glow-red);
}

.rank-badge img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* SKELETON LOADER (MATERIAL) */
.skeleton {
  background: linear-gradient(90deg, var(--val-bg-dark) 25%, var(--val-bg-card) 50%, var(--val-bg-dark) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* GRID LAYOUTS */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

/* --- RESPONSIVE BREAKPOINTS --- */

/* Mobile < 768px (default styles above) */

/* Tablet 768px - 1024px */
@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  
  .container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
  }
  
  .grid-md-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-md-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Desktop > 1024px */
@media (min-width: 1024px) {
  h1 { font-size: 4rem; }
  
  .container {
    max-width: 1024px;
  }
  
  .grid-lg-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-lg-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Large Desktop > 1440px */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}

/* Mobile: Single column, touch-optimized */
@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4, .grid-6 {
    grid-template-columns: 1fr;
  }
  
  .fab {
    bottom: var(--space-lg);
    right: var(--space-lg);
  }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
}

/* --- UTILITY CLASSES --- */
.hidden { display: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--val-bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--val-bg-elevated);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* RIPPLE EFFECT (MATERIAL) */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* SKIN QUALITY GRADIENT BORDERS */
.skin-quality-5 {
  border: 2px solid;
  border-image: linear-gradient(135deg, #FFD700, #FFA500) 1;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.skin-quality-4 {
  border: 2px solid;
  border-image: linear-gradient(135deg, #FF8C00, #FF4500) 1;
  box-shadow: 0 0 15px rgba(255, 140, 0, 0.4);
}

.skin-quality-3 {
  border: 2px solid;
  border-image: linear-gradient(135deg, #FF69B4, #FF1493) 1;
  box-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
}

.skin-quality-2 {
  border: 2px solid;
  border-image: linear-gradient(135deg, #00FF7F, #32CD32) 1;
  box-shadow: 0 0 15px rgba(0, 255, 127, 0.4);
}

.skin-quality-1 {
  border: 2px solid;
  border-image: linear-gradient(135deg, #1E90FF, #00BFFF) 1;
  box-shadow: 0 0 15px rgba(30, 144, 255, 0.4);
}
