* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0a0e27;
    --secondary: #151932;
    --accent: #ff6b6b;
    --gold: #ffd93d;
    --success: #6bcf7f;
    --danger: #ff4757;
    --water: #4ecdc4;
    --charity: #1dd1a1;
    --text: #ffffff;
    --text-secondary: #94a3b8;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --water-gradient: linear-gradient(135deg, #4ecdc4 0%, #1dd1a1 100%);
    --dark-gradient: linear-gradient(180deg, #0a0e27 0%, #151932 100%);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-border: rgba(100, 116, 139, 0.1);
    --pole-width: 20px;      /* your mast-pole width */
    --arm: 40px;             /* connector length from pole to flag */
    --dot: 10px;             /* round "pin" at end of connector */
    --pole-gap: 4px;         /* small gap from pole edge to start of connector */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0a0e27;
    background-image: 
        radial-gradient(ellipse at top left, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography Enhancement */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Professional Header */
header {
    padding: 24px 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a3f2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 16px;
    text-shadow: 0 0 40px rgba(78, 205, 196, 0.3);
}

/* Enhanced Header Styles - FIXED for single line */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.header-main {
    flex: 1;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 5px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.charity-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 15px;
    border: 2px solid var(--water);
    flex-wrap: wrap; /* allow wrapping on smaller screens */
}

.charity-percentage {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--water);
}

.charity-details {
    display: flex;
    flex-direction: row; /* ⬅ inline instead of stacked */
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    flex-wrap: wrap;
}

.charity-text {
    font-size: 1rem;
    color: var(--text-secondary);
}

.charity-link {
    color: var(--water);
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.charity-link:hover {
    transform: translateX(5px);
}

.link-arrow {
    transition: transform 0.3s;
    display: inline-block;
}

.charity-link:hover .link-arrow {
    transform: translateX(3px);
}

.stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-value.charity-amount {
    background: var(--water-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section - Premium Design */
.hero {
    text-align: center;
    padding: 80px 0;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(78, 205, 196, 0.05) 0%, transparent 70%);
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.03) 0%, transparent 70%);
    animation: pulse-slow 8s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.7; }
}

.hero h2 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a3f2 50%, #1dd1a1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.transparency-banner {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-top: 40px;
    padding: 24px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(100, 116, 139, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.transparency-banner span {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

/* Main Layout Container for Mast + Flags Grid */
.main-layout-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ========== ENHANCED MAST VISUALIZATION ========== */
.mast-visualization {
  background: linear-gradient(180deg, 
    rgba(135, 206, 235, 0.05) 0%, 
    rgba(10, 14, 39, 0.1) 100%);
  border-radius: 20px;
  border: 1px solid rgba(78, 205, 196, 0.15);
  padding: 30px 20px;
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overflow-x: hidden;
}

.mast-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 30px;
  background: var(--water-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* Mast Wrapper - Container for the entire mast structure */
.mast-wrapper {
  position: relative;
  min-height: 500px;
  height: 500px; /* Will be dynamically updated by JS */
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 80px; /* Space for flags on sides */
}

/* Golden Finial Cap on Top - FIXED POSITIONING */
.mast-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background: radial-gradient(circle at 30% 30%, 
    #fff8dc 0%, 
    #ffd700 20%, 
    #daa520 50%, 
    #b8860b 80%);
  border-radius: 50%;
  box-shadow: 
    0 0 15px rgba(255, 217, 61, 0.6),
    0 -2px 8px rgba(255, 255, 255, 0.4) inset,
    0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

/* Spike on finial */
.mast-top::after {
  content: '';
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 15px solid #ffd700;
  filter: drop-shadow(0 0 3px rgba(255, 217, 61, 0.5));
}

/* Main Pole - Enhanced Wood Effect */
.mast-pole {
  position: absolute;
  top: 25px; /* Start below the cap */
  bottom: 35px; /* End above the base */
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  background: linear-gradient(90deg,
    #5a4a42 0%,
    #8b7355 15%,
    #a08870 30%,
    #c4a574 45%,
    #d4b896 50%,
    #c4a574 55%,
    #a08870 70%,
    #8b7355 85%,
    #5a4a42 100%);
  border-radius: 7px;
  box-shadow:
    inset -2px 0 4px rgba(0, 0, 0, 0.3),
    inset 2px 0 4px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Wood Grain Texture */
.mast-pole::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(0, 0, 0, 0.05) 1px,
      rgba(0, 0, 0, 0.05) 2px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 20px,
      rgba(0, 0, 0, 0.02) 20px,
      rgba(0, 0, 0, 0.02) 21px
    );
  border-radius: inherit;
  pointer-events: none;
}

/* Base Foundation - FIXED POSITIONING */
.mast-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 25px;
  background: linear-gradient(180deg, 
    #6a5f56 0%, 
    #4a3f36 40%, 
    #2a1f16 100%);
  border-radius: 35px / 12px;
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.4),
    0 -2px 4px rgba(0, 0, 0, 0.2) inset;
  z-index: 11;
}

/* Decorative Ring on Base */
.mast-base::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 45px;
  height: 12px;
  background: linear-gradient(180deg,
    #8b7355 0%,
    #6a5f56 50%,
    #4a3f36 100%);
  border-radius: 50%;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 -1px 2px rgba(255, 255, 255, 0.1) inset;
}

/* FLAGS CONTAINER - FIXED POSITIONING */
.mast-flags {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allow clicks to pass through container */
}

/* FLAG ITEMS - FIXED ABSOLUTE POSITIONING */
.mast-flag-item {
  position: absolute;
  display: flex;
  align-items: center;
  width: 100%;
  height: auto;
  min-height: 30px;  /* Reduced from 40px */
  animation: fadeInFlag 0.5s ease-out backwards;
  pointer-events: none;
}

/* Staggered animation based on rank */
.mast-flag-item[data-rank="1"] { animation-delay: 0.05s; }
.mast-flag-item[data-rank="2"] { animation-delay: 0.1s; }
.mast-flag-item[data-rank="3"] { animation-delay: 0.15s; }
.mast-flag-item[data-rank="4"] { animation-delay: 0.2s; }
.mast-flag-item[data-rank="5"] { animation-delay: 0.25s; }
.mast-flag-item[data-rank="6"] { animation-delay: 0.3s; }
.mast-flag-item[data-rank="7"] { animation-delay: 0.35s; }
.mast-flag-item[data-rank="8"] { animation-delay: 0.4s; }
.mast-flag-item[data-rank="9"] { animation-delay: 0.45s; }
.mast-flag-item[data-rank="10"] { animation-delay: 0.5s; }

/* LEFT SIDE FLAGS */
.mast-flag-item.left {
  justify-content: flex-end;
  padding-right: calc(50% + 8px);  /* Adjusted for pole */
}

/* RIGHT SIDE FLAGS */  
.mast-flag-item.right {
  justify-content: flex-start;
  padding-left: calc(50% + 8px);  /* Adjusted for pole */
}

/* Flag wrapper - Enable interaction */
.flag-wrap {
  display: flex;
  align-items: center;
  gap: 8px;  /* Reduced from 10px */
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;  /* Reduced padding */
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transform-origin: center;
  animation: gentleSway 4s ease-in-out infinite;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  pointer-events: auto;
  user-select: none;
  font-size: 0.85rem;  /* Smaller text */
}

/* Alternating animation delay for natural movement */
.mast-flag-item:nth-child(odd) .flag-wrap {
  animation-delay: 0s;
}

.mast-flag-item:nth-child(even) .flag-wrap {
  animation-delay: 2s;
}

/* Gentle swaying animation */
@keyframes gentleSway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(1deg) translateY(-2px); }
  75% { transform: rotate(-1deg) translateY(2px); }
}

/* Connector lines from pole to flags */
.mast-connector {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, 
    rgba(139, 115, 85, 0.6) 0%, 
    rgba(139, 115, 85, 0.4) 100%);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Left side connector */
.mast-flag-item.left .mast-connector {
  right: 100%;
  left: 50%;
  width: calc(50% - 8px);
}

/* Right side connector */
.mast-flag-item.right .mast-connector {
  left: 100%;
  right: 50%;
  width: calc(50% - 8px);
}

/* ========== MAST FLAG SIZE FIXES ========== */

/* Reduce flag image sizes in mast */
.mast-flag-img {
    height: 24px !important;  /* Reduced from whatever it was */
    max-width: 36px !important;  /* Reduced size */
    width: auto;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Emoji size in mast */
.mast-flag-emoji {
    font-size: 1.4rem !important;  /* Reduced from 2rem or larger */
}

/* Rank badge size */
.mast-rank {
    font-size: 0.75rem !important;
    padding: 2px 6px !important;
    min-width: 28px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    border-radius: 10px;
    font-weight: 600;
}

/* Flag name and position text */
.mast-flag-name {
    font-size: 0.8rem !important;
    font-weight: 500;
}

.mast-flag-position {
    font-size: 0.75rem !important;
    font-weight: 600;
}

/* Special styling for top 3 flags */
.mast-flag-item[data-rank="1"] .mast-rank {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #000 !important;
    font-weight: bold;
}

.mast-flag-item[data-rank="2"] .mast-rank {
    background: linear-gradient(135deg, #C0C0C0, #B8B8B8) !important;
    color: #000 !important;
}

.mast-flag-item[data-rank="3"] .mast-rank {
    background: linear-gradient(135deg, #CD7F32, #B87333) !important;
    color: #fff !important;
}

/* Better hover states for flag interaction */
.flag-wrap {
    user-select: none;
    -webkit-user-select: none;
}

.flag-wrap:active {
    transform: scale(0.98);
}

/* Tooltip on hover showing full stats */
.flag-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 100;
}

.flag-wrap:hover::after {
    opacity: 1;
}

/* Crown indicator for #1 */
.mast-flag-item:first-child .flag-wrap::before {
    content: '👑';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    animation: crownBob 2s ease-in-out infinite;
}

@keyframes crownBob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

@keyframes fadeInFlag {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Loading state for mast */
.mast-flags.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.mast-flags.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(78, 205, 196, 0.2);
    border-top-color: var(--water);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========== RESPONSIVE DESIGN - ENHANCED ========== */

/* Large Desktop */
@media (min-width: 1400px) {
  .main-layout-container {
    grid-template-columns: 450px 1fr;
    gap: 40px;
  }
  
  .mast-visualization {
    max-width: 450px;
  }
}

/* Desktop to Tablet Transition */
@media (max-width: 1200px) {
  .main-layout-container {
    grid-template-columns: 380px 1fr;
    gap: 25px;
    padding: 35px 20px;
  }
  
  .mast-wrapper {
    padding: 0 70px;
  }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
  .main-layout-container {
    grid-template-columns: 350px 1fr;
    gap: 20px;
    padding: 30px 20px;
  }
  
  .mast-visualization {
    position: relative;
    top: auto;
    max-height: 600px;
  }
  
  .mast-wrapper {
    padding: 0 60px;
    min-height: 450px;
  }
  
  .flag-wrap {
    padding: 5px 10px;
    font-size: 0.9rem;
  }
  
  .mast-flag-img {
    height: 28px;
    max-width: 42px;
  }
}

/* Tablet Portrait */
@media (max-width: 768px) {
  .main-layout-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 15px;
  }
  
  .mast-visualization {
    position: relative;
    top: auto;
    max-height: 500px;
    margin-bottom: 30px;
    max-width: 100%;
    order: -1; /* Show mast first on mobile */
  }
  
  .mast-wrapper {
    padding: 0 50px;
    min-height: 400px;
  }
  
  .mast-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }
  
  .flags-column {
    order: 1;
  }
  
  /* Adjust flag sizes on tablet */
  .mast-flag-item:nth-child(1) .mast-flag-img {
    height: 36px;
    max-width: 54px;
  }
  
  .mast-flag-item:nth-child(2) .mast-flag-img {
    height: 32px;
    max-width: 48px;
  }
  
  .mast-flag-item:nth-child(3) .mast-flag-img {
    height: 30px;
    max-width: 45px;
  }
  
  .mast-flag-name {
    font-size: 0.85rem;
  }
  
  .mast-rank {
    font-size: 0.8rem;
    padding: 3px 7px;
  }
  
  .mast-flag-img {
    height: 20px !important;
    max-width: 30px !important;
  }
  
  .mast-flag-emoji {
    font-size: 1.2rem !important;
  }
  
  .flag-wrap {
    padding: 3px 8px;
    gap: 6px;
    font-size: 0.75rem;
  }
  
  .mast-rank {
    font-size: 0.65rem !important;
    padding: 2px 4px !important;
    min-width: 24px !important;
  }
  
  .mast-flag-name {
    font-size: 0.7rem !important;
  }
  
  .mast-flag-position {
    font-size: 0.65rem !important;
  }
}

/* Mobile Landscape */
@media (max-width: 640px) and (orientation: landscape) {
  .mast-visualization {
    max-height: 350px;
  }
  
  .mast-wrapper {
    min-height: 300px;
    padding: 0 40px;
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {
  .mast-visualization {
    padding: 20px 15px;
    max-height: 400px;
  }
  
  .mast-wrapper {
    padding: 0 40px;
    min-height: 350px;
  }
  
  .mast-pole {
    width: 12px;
  }
  
  .mast-top {
    width: 24px;
    height: 24px;
  }
  
  .mast-base {
    width: 60px;
    height: 20px;
  }
  
  .flag-wrap {
    padding: 4px 8px;
    gap: 6px;
  }
  
  .mast-flag-img {
    height: 18px !important;
    max-width: 27px !important;
  }
  
  .mast-flag-emoji {
    font-size: 1rem !important;
  }
  
  .flag-wrap {
    padding: 2px 6px;
    gap: 4px;
  }
  
  .mast-flag-name {
    font-size: 0.75rem;
  }
  
  .mast-flag-position {
    font-size: 0.7rem;
  }
  
  .mast-rank {
    font-size: 0.7rem;
    padding: 2px 5px;
    min-width: 26px;
  }
  
  /* Hide flag names on very small screens to save space */
  .mast-flag-info {
    display: none;
  }
  
  /* Just show rank and flag */
  .mast-rank {
    margin-right: 4px;
  }
  
  /* Simplify animations on mobile for performance */
  .flag-wrap {
    animation: none;
  }
  
  /* Adjust special flag sizes */
  .mast-flag-item:nth-child(1) .mast-flag-img,
  .mast-flag-item:nth-child(2) .mast-flag-img,
  .mast-flag-item:nth-child(3) .mast-flag-img {
    height: 26px;
    max-width: 39px;
    border-width: 1px;
  }
  
  /* Hide mast on very small screens to prioritize main content */
  .mast-visualization {
    display: none;
  }
  
  /* Add a compact leaderboard indicator instead */
  .controls-section::after {
    content: '🏆 View full leaderboard on desktop for best experience';
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 20px;
  }
}

/* Very Small Mobile */
@media (max-width: 360px) {
  .mast-visualization {
    padding: 15px 10px;
  }
  
  .mast-wrapper {
    padding: 0 35px;
    min-height: 300px;
  }
  
  .mast-title {
    font-size: 1.2rem;
  }
  
  /* Hide flag info text on very small screens */
  .mast-flag-info {
    display: none;
  }
  
  .flag-wrap {
    padding: 4px 6px;
  }
}

/* Accessibility - Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  .flag-wrap,
  .crown,
  .mast-flag-item {
    animation: none !important;
  }
  
  * {
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .flag-wrap {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text);
  }
  
  .flag-wrap:hover {
    background: rgba(30, 41, 59, 1);
  }
  
  .mast-flag-name {
    color: var(--text);
  }
  
  .mast-flag-position {
    color: var(--text-secondary);
  }
  
  .mast-visualization {
    background: linear-gradient(180deg, 
      rgba(30, 41, 59, 0.3) 0%, 
      rgba(15, 23, 42, 0.5) 100%);
  }
}

/* Print Styles */
@media print {
  .mast-visualization {
    position: relative;
    top: auto;
    max-height: none;
    page-break-inside: avoid;
    display: none;
  }
  
  .flag-wrap {
    animation: none;
  }
  
  .mast-wrapper {
    min-height: auto;
  }
}

/* Controls Section */
.controls-section {
    padding: 30px 0;
    background: rgba(30, 41, 59, 0.3);
}

.search-filter {
    display: flex;
    gap: 16px;
    margin: 40px 0;
    justify-content: center;
    align-items: center;
}

#searchInput {
    padding: 14px 24px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(30, 41, 59, 0.5);
    color: var(--text);
    width: 320px;
    font-size: 1rem;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

#searchInput:focus {
    outline: none;
    border-color: var(--water);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.1);
}

#filterSelect {
    padding: 14px 24px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: rgba(30, 41, 59, 0.5);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

#filterSelect:hover {
    border-color: rgba(78, 205, 196, 0.3);
}

.view-controls {
    display: flex;
    gap: 10px;
    background: rgba(30, 41, 59, 0.3);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

/* ========== VIEW BUTTON TEXT FIX ========== */

.view-controls .view-btn {
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent !important;
  background-image: none !important;
  border: 2px solid transparent !important;
  color: var(--text-secondary) !important;
  padding: 10px 20px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: none !important;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1) !important;
  cursor: pointer;
}

.view-controls .view-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--water-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 10px;
  z-index: 0;
}

.view-controls .view-btn > span { 
  position: relative; 
  z-index: 1; 
}

.view-controls .view-btn:not(.active):hover {
  background: rgba(30, 41, 59, 0.5) !important;
  color: var(--text) !important;
  transform: translateY(-1px);
}

/* Active state */
.view-controls .view-btn.active {
  background: var(--water-gradient) !important;
  color: white !important;
  box-shadow: 0 0 20px rgba(78,205,196,0.4) !important;
  transform: scale(1.02) !important;
  border-color: transparent !important;
  position: relative;
}

.view-controls .view-btn.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--water-gradient);
  border-radius: 10px;
  z-index: 0;
}

.view-controls .view-btn.active > span {
  position: relative;
  z-index: 1;
  color: white !important;
}

.view-controls .view-btn.active::before { 
  opacity: 1 !important; 
}

/* Flag Notice */
.flag-notice {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 217, 61, 0.1);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
}

.flag-notice p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* Flags Section */
.flags-section {
    padding: 0;
}

.flags-column {
    width: 100%;
}

/* Professional Grid View */
.flags-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

/* Professional Flag Card Design */
.flag-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(100, 116, 139, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.flag-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--water-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.flag-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(78, 205, 196, 0.1);
    border-color: rgba(78, 205, 196, 0.3);
}

.flag-card:hover::before {
    transform: scaleX(1);
}

/* Flag Rank Badge */
.flag-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.crown-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

/* Flag Visual Elements */
.flag-visual {
    height: 120px;
    position: relative;
    margin-bottom: 20px;
}

.flag-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.flag-card:hover .flag-glow {
    opacity: 1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Flag Display Elements */
.flag-display-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.flag-img {
    max-width: 100px;
    max-height: 60px;
    width: auto;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.flag-card:hover .flag-img {
    transform: scale(1.1) rotate(3deg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.flag-emoji-fallback {
    font-size: 5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: all 0.4s;
}

.flag-card:hover .flag-emoji-fallback {
    transform: scale(1.1) rotate(3deg);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.flag-wave {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--water-gradient);
    opacity: 0.3;
    animation: wave 3s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateX(-50%) scaleX(0.8); }
    50% { transform: translateX(-50%) scaleX(1.2); }
}

/* Flag Info Section */
.flag-info {
    margin-bottom: 20px;
}

.flag-name {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text);
}

.flag-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    transition: background 0.3s;
}

.flag-card:hover .stat-row {
    background: rgba(15, 23, 42, 0.7);
}

.stat-row .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-row .stat-value {
    font-size: 1rem;
    font-weight: 600;
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.negative {
    color: var(--danger);
}

.stat-value.gold {
    color: var(--gold);
}

/* Professional Support Button */
.support-button {
    width: 100%;
    padding: 14px 24px;
    background: var(--water-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

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

.support-button:hover::before {
    width: 300px;
    height: 300px;
}

.support-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

.button-icon {
    transition: transform 0.3s;
}

.support-button:hover .button-icon {
    transform: translateX(4px);
}

/* List View Specific Styles */
.flag-display-list {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 40px;
    margin-right: 15px;
}

.flag-display-list .flag-img {
    max-width: 50px;
    max-height: 35px;
}

.flag-display-list .flag-emoji-fallback {
    font-size: 2.5rem;
}

/* Professional Leaderboard View */
.flags-container.leaderboard-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1000px;
    margin: 40px auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-radius: 16px;
    padding: 20px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(100, 116, 139, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--water-gradient);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaderboard-item:hover::before {
    transform: scaleY(1);
}

.leaderboard-item:hover {
    background: linear-gradient(135deg, rgba(30, 41, 59, 1) 0%, rgba(30, 41, 59, 0.8) 100%);
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.leading-item {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%);
    border-color: rgba(255, 217, 61, 0.3);
}

.rank-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 24px;
    min-width: 60px;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 10px;
}

.crown {
    font-size: 1.2rem;
    animation: rotate-crown 3s ease-in-out infinite;
}

@keyframes rotate-crown {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.leaderboard-item .flag-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.flag-details {
    flex: 1;
}

.flag-details .flag-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.flag-category {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.flag-metrics {
    display: flex;
    gap: 32px;
    margin-right: 24px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.metric-value.positive {
    color: var(--success);
}

.metric-value.negative {
    color: var(--danger);
}

.metric-value.gold {
    color: var(--gold);
}

.support-button-inline {
    padding: 10px 24px;
    background: var(--water-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.support-button-inline:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

/* Transparency Section - Premium Design */
.transparency-section {
    padding: 80px 0;
    background: rgba(30, 41, 59, 0.2);
    border-radius: 24px;
    margin: 60px 0;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.transparency-section h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 48px;
    background: var(--water-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.transparency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.transparency-card {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid rgba(100, 116, 139, 0.1);
    transition: all 0.3s;
}

.transparency-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(78, 205, 196, 0.2);
}

.transparency-card h3 {
    color: var(--water);
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 700;
}

.period-name {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--gold) 0%, #ffb347 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    font-weight: 700;
}

/* Payment Modal - Professional Redesign */
.payment-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(21, 25, 50, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    margin: 3% auto;
    padding: 48px;
    border-radius: 24px;
    width: 90%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.1);
}

.close:hover {
    color: var(--text);
    background: rgba(100, 116, 139, 0.2);
    transform: rotate(90deg);
}

#modalTitle {
    font-size: 2rem;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 700;
}

.flag-preview {
    font-size: 6rem;
    text-align: center;
    margin: 32px 0;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.modal-flag-img {
    animation: modalFlagWave 4s ease-in-out infinite;
    transform-origin: left center;
}

@keyframes modalFlagWave {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(10deg); }
}

.current-position {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 32px;
    color: var(--text-secondary);
}

.current-position span {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--water-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== FOOTER LINK STYLING ========== */

footer {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5) 0%, rgba(10, 14, 39, 0.9) 100%);
    padding: 60px 0 40px;
    margin-top: 100px;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
}

footer a {
    color: var(--water);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--water-gradient);
    transition: width 0.3s ease;
}

footer a:hover {
    color: var(--charity);
    transform: translateX(3px);
}

footer a:hover::after {
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
}

.footer-section h4 {
    color: var(--water);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 12px 0;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.footer-section ul li a {
    color: var(--text-secondary);
    padding: 2px 0;
}

.footer-section ul li a:hover {
    color: var(--water);
}

.footer-section ul li:hover {
    color: var(--text);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 50%;
    margin: 0 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.2rem;
}

.social-links a:hover {
    background: var(--water-gradient);
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

.social-links a::after {
    display: none;  /* Remove underline from social icons */
}

/* ========== EMAIL OBFUSCATION STYLES ========== */

/* Style for obfuscated email links */
.email-link {
    cursor: pointer;
    color: var(--water);
    text-decoration: none;
    transition: all 0.3s ease;
}

.email-link:hover {
    color: var(--charity);
}

/* Protected email display */
.email-protected::before {
    content: attr(data-user);
}

.email-protected::after {
    content: "@" attr(data-domain);
}

/* Leading Flag Special Effects */
.leading-flag {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.1) 0%, rgba(30, 41, 59, 0.9) 100%) !important;
    border-color: rgba(255, 217, 61, 0.3) !important;
    box-shadow: 0 0 30px rgba(255, 217, 61, 0.2);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--water) 0%, var(--charity) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--charity) 0%, var(--water) 100%);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout-container {
        grid-template-columns: 1fr;
    }
    
    .mast-visualization {
        position: relative;
        top: auto;
        max-height: 500px;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .flags-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    #searchInput {
        width: 100%;
    }
    
    .transparency-banner {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 32px 24px;
    }
    
    .charity-badge {
        flex-direction: column;
        text-align: center;
    }
    
    .mast-visualization {
        display: none;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 25%, rgba(30, 41, 59, 0.7) 50%, rgba(30, 41, 59, 0.5) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.loading-message {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(78, 205, 196, 0.3);
    border-top-color: var(--water);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Amount Selector - Professional Design */
.amount-selector {
    margin-top: 32px;
    padding: 32px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--water-gradient);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1rem;
}

.step-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.amount-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.amount-buttons button {
    padding: 16px 20px;
    border: 2px solid rgba(100, 116, 139, 0.2);
    background: rgba(30, 41, 59, 0.5);
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.amount-buttons button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--water-gradient);
    opacity: 0.3;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.amount-buttons button:hover::before {
    width: 150px;
    height: 150px;
}

.amount-buttons button:hover {
    transform: translateY(-2px);
    border-color: var(--water);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
}

.amount-buttons button.selected {
    background: var(--water-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

/* Custom Amount Input - Professional Design */
.custom-amount-wrapper {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
}

.custom-amount-wrapper label {
    display: block;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.custom-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    max-width: 320px;
    margin: 0 auto;
}

.currency-symbol {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

#customAmount {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid rgba(100, 116, 139, 0.2);
    background: rgba(30, 41, 59, 0.5);
    color: var(--text);
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
}

#customAmount:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 4px rgba(255, 217, 61, 0.1);
}

/* Action Buttons - Professional Design */
.action-selector {
    margin-top: 32px;
    padding: 32px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.action-buttons button {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.raise-btn {
    background: linear-gradient(135deg, #6bcf7f 0%, #4caf50 100%);
}

.raise-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(76, 175, 80, 0.4);
}

.lower-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
}

.lower-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(255, 71, 87, 0.4);
}

/* Charity Info - Professional Design */
.charity-info {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.08) 0%, rgba(29, 209, 161, 0.08) 100%);
    border-radius: 16px;
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.amount-breakdown {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 24px;
}

.amount-breakdown h4 {
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.breakdown-divider {
    border-top: 1px solid rgba(100, 116, 139, 0.2);
    margin: 16px 0;
}

.highlight-charity {
    background: linear-gradient(90deg, rgba(29, 209, 161, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%);
    padding: 14px 12px;
    border-radius: 8px;
    margin: 8px -12px;
    font-weight: 600;
}

.fee-amount {
    color: var(--danger);
}

.charity-amount {
    color: var(--water);
    font-weight: 600;
}

.operations-amount {
    color: var(--text-secondary);
}

/* Payment Status Messages */
#paymentStatus {
    margin-top: 24px;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    display: none;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

#paymentStatus.success {
    background: rgba(107, 207, 127, 0.1);
    border: 1px solid rgba(107, 207, 127, 0.3);
    color: var(--success);
}

#paymentStatus.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--danger);
}

#paymentStatus.info {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    color: var(--water);
}

/* Error highlight for amount selector */
.error-highlight {
    animation: shake 0.5s;
    border-color: var(--danger) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success Animation Styles */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Live Notification Styles */
.live-notification {
    animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 3s forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Transparency Section Additional Styles */
.transparency-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.trans-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.trans-stat.highlight {
    background: rgba(78, 205, 196, 0.1);
    padding: 15px 10px;
    border-radius: 8px;
    margin: 10px -10px;
}

.trans-label {
    color: var(--text-secondary);
}

.trans-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.trans-value.charity {
    color: var(--water);
}

.next-donation {
    margin-top: 20px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 10px;
    text-align: center;
}

.past-periods {
    margin-top: 40px;
}

.past-periods h3 {
    color: var(--water);
    margin-bottom: 20px;
}

.periods-list {
    display: grid;
    gap: 20px;
}

.past-period {
    background: rgba(30, 41, 59, 0.4);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.past-period.disbursed {
    border-color: rgba(107, 207, 127, 0.3);
}

.past-period h4 {
    color: var(--gold);
    margin-bottom: 15px;
}

.period-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.period-stats span {
    color: var(--text-secondary);
}

.disbursed-badge {
    background: rgba(107, 207, 127, 0.2);
    color: var(--success);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.pending-badge {
    background: rgba(255, 217, 61, 0.2);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    background: rgba(30, 41, 59, 0.2);
    border-radius: 12px;
    border: 1px dashed rgba(100, 116, 139, 0.3);
}

.verification-links {
    color: var(--water);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.verify-link {
    color: var(--water);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

/* Hide data attributes from being displayed */
.email-protected[data-user]::before,
.email-protected[data-user]::after,
.email-protected[data-domain]::before,
.email-protected[data-domain]::after {
    content: none !important;
    display: none !important;
}

/* Ensure email links show pointer cursor */
.email-protected {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 6px !important;
    color: var(--water, #3b82f6) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    user-select: none !important;
    position: relative !important;
    z-index: 10 !important;
    font-size: 0.95rem !important;
}

/* Ready state - when email element is properly set up */
.email-protected.email-ready {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hover effects */
.email-protected:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: var(--water, #3b82f6) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

/* Active/click state */
.email-protected:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2) !important;
}

/* Icon spacing */
.email-protected span {
    font-size: 1em !important;
    line-height: 1 !important;
}

/* Button variant styles */
.btn.email-protected {
    padding: 12px 24px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    background: var(--water, #3b82f6) !important;
    color: white !important;
    border: none !important;
}

.btn.email-protected:hover {
    background: #2563eb !important;
    color: white !important;
}

/* Hide any leftover template variables if they somehow appear */
*:not(script):not(style) {
    /* Remove any visible template variables from display */
}

/* Specific fix for the verification links */
.verification-links .email-protected {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-light, #e5e7eb) !important;
}

.verification-links .email-protected:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Ensure footer email links display correctly */
footer .email-protected {
    padding: 6px 12px !important;
    font-size: 0.9rem !important;
    background: rgba(59, 130, 246, 0.15) !important;
    color: var(--water, #3b82f6) !important;
}

/* Prevent data attributes from being selected or copied */
[data-user],
[data-domain] {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Loading state */
.email-protected[data-original-content] {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

/* Success state animation */
@keyframes emailSuccess {
    0% { background-color: rgba(34, 197, 94, 0.1); }
    50% { background-color: rgba(34, 197, 94, 0.2); }
    100% { background-color: rgba(59, 130, 246, 0.1); }
}

.email-protected.success {
    animation: emailSuccess 0.5s ease !important;
}

/* Error state */
.email-protected.error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
    cursor: not-allowed !important;
}

.email-protected.error:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Ensure visibility and proper layering */
.email-protected {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-flex !important;
    z-index: 10 !important;
}

/* Remove any conflicting link styles */
a.email-protected {
    text-decoration: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

a.email-protected:hover,
a.email-protected:focus,
a.email-protected:visited {
    text-decoration: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .email-protected {
        padding: 10px 14px !important;
        font-size: 0.9rem !important;
        gap: 4px !important;
    }
    
    .btn.email-protected {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
    }
    
    .verification-links .email-protected {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .email-protected {
        border: 2px solid currentColor !important;
        background: rgba(255, 255, 255, 0.9) !important;
        color: #1f2937 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .email-protected {
        transition: none !important;
    }
    
    .email-protected:hover {
        transform: none !important;
    }
    
    .email-protected.success {
        animation: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .email-protected {
        background: rgba(59, 130, 246, 0.15) !important;
        border-color: rgba(59, 130, 246, 0.4) !important;
        color: #60a5fa !important;
    }
    
    .email-protected:hover {
        background: rgba(59, 130, 246, 0.25) !important;
    }
}

/* Ensure elements stay visible during loading */
.email-protected:not(.email-ready) {
    opacity: 0.8 !important;
    background: rgba(156, 163, 175, 0.1) !important;
}

/* Debug mode (add .debug class to body for testing) */
body.debug .email-protected {
    outline: 2px dashed #ff6b6b !important;
    outline-offset: 2px !important;
}

body.debug .email-protected::before {
    content: "📧" !important;
    position: absolute !important;
    top: -20px !important;
    left: 0 !important;
    font-size: 12px !important;
    background: #ff6b6b !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    z-index: 1000 !important;
}

body.debug .email-protected[data-email-processed]::after {
    content: "✅" !important;
    position: absolute !important;
    top: -20px !important;
    right: 0 !important;
    font-size: 12px !important;
    background: #22c55e !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    z-index: 1000 !important;
}

/* ========== UPDATED MAST STYLES - Only Winner ========== */
/* ADD these new styles to styles.css */

.mast-wrapper-simple {
  position: relative;
  min-height: 350px;
  height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 40px;
}

.mast-pole-simple {
  position: absolute;
  top: 25px;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  background: linear-gradient(90deg,
    #5a4a42 0%,
    #8b7355 15%,
    #a08870 30%,
    #c4a574 45%,
    #d4b896 50%,
    #c4a574 55%,
    #a08870 70%,
    #8b7355 85%,
    #5a4a42 100%);
  border-radius: 7px;
  box-shadow:
    inset -2px 0 4px rgba(0, 0, 0, 0.3),
    inset 2px 0 4px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Winner flag container */
.mast-winner-container {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 20;
}

.mast-winner-flag {
  cursor: pointer;
  transition: all 0.3s ease;
}

.mast-winner-flag:hover {
  transform: scale(1.05);
}

/* Winner flag image - NO BORDER */
.mast-winner-flag-img {
  width: 120px !important;
  height: auto !important;
  max-height: 80px !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  animation: flagWave 3s ease-in-out infinite;
  transform-origin: left center;
  display: block;
  margin: 0 auto;
}

/* Winner emoji fallback */
.mast-winner-flag-emoji {
  font-size: 5rem !important;
  display: block;
  animation: flagWave 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes flagWave {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* Winner info */
.mast-winner-info {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.winner-badge {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 8px;
  animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.winner-name {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
  margin: 8px 0;
}

.winner-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 0.9rem;
  color: #666;
  margin-top: 8px;
}

.winner-position {
  font-weight: 600;
  color: var(--success);
}

.winner-raised {
  font-weight: 600;
  color: var(--gold);
}

/* ========== MOBILE HEADER FIXES ========== */
/* REPLACE the existing mobile header styles in the @media sections */

/* Mobile-specific header fixes */
@media (max-width: 768px) {
  /* Compact header on mobile */
  header {
    padding: 12px 0;
    position: relative; /* Changed from sticky to prevent overlapping */
  }
  
  .header-content {
    flex-direction: column;
    gap: 12px;
  }
  
  .header-main {
    text-align: center;
  }
  
  .logo {
    font-size: 1.8rem !important;
    margin-bottom: 4px;
  }
  
  .tagline {
    font-size: 0.85rem !important;
    display: none; /* Hide tagline on mobile to save space */
  }
  
  /* Compact charity badge on mobile */
  .header-info {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  
  .charity-badge {
    padding: 8px 12px;
    font-size: 0.9rem;
    justify-content: center;
    border-width: 1px;
  }
  
  .charity-percentage {
    font-size: 1rem;
  }
  
  .charity-text {
    font-size: 0.85rem;
  }
  
  .charity-link {
    font-size: 0.9rem;
  }
  
  /* Hide stats on mobile or make them compact */
  .stats {
    display: none; /* Hide stats completely on mobile */
  }
  
  /* Alternative: Make stats very compact (uncomment if you want to keep them) */
  /*
  .stats {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid rgba(100, 116, 139, 0.1);
  }
  
  .stat-item {
    gap: 2px;
  }
  
  .stat-label {
    font-size: 0.6rem !important;
  }
  
  .stat-value {
    font-size: 0.9rem !important;
  }
  */
  
  /* Reduce hero section padding on mobile */
  .hero {
    padding: 40px 0;
  }
  
  .hero h2 {
    font-size: 1.8rem !important;
    margin-bottom: 12px;
  }
  
  .hero p {
    font-size: 1rem;
    padding: 0 15px;
  }
  
  .transparency-banner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    font-size: 0.8rem;
  }
  
  .transparency-banner span {
    font-size: 0.8rem;
  }
  
  /* Ensure main content isn't hidden behind header */
  .controls-section {
    padding-top: 20px;
  }
  
  /* Simplified mast on mobile */
  .mast-visualization {
    margin-top: 20px;
    padding: 20px 15px;
  }
  
  .mast-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .mast-wrapper-simple {
    min-height: 250px;
    height: 250px;
    padding: 0 20px;
  }
  
  .mast-winner-flag-img {
    width: 80px !important;
    max-height: 60px !important;
  }
  
  .mast-winner-flag-emoji {
    font-size: 3rem !important;
  }
  
  .winner-name {
    font-size: 1.1rem;
  }
  
  .winner-stats {
    flex-direction: column;
    gap: 5px;
    font-size: 0.8rem;
  }
}

/* Very small mobile screens */
@media (max-width: 360px) {
  header {
    padding: 10px 0;
  }
  
  .logo {
    font-size: 1.5rem !important;
  }
  
  .charity-badge {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .hero h2 {
    font-size: 1.5rem !important;
  }
  
  .mast-winner-flag-img {
    width: 60px !important;
    max-height: 45px !important;
  }
}

/* Ensure content is not hidden on mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
  header {
    padding: 8px 0;
    position: relative;
  }
  
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .stats {
    display: none;
  }
  
  .hero {
    padding: 30px 0;
  }
}

/* ========== LIST VIEW FIXES ========== */

/* Fix leaderboard item layout to prevent text cutoff */
.leaderboard-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-radius: 16px;
    padding: 20px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(100, 116, 139, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    min-height: 80px; /* Ensure consistent height */
}

/* Fix flag metrics layout - prevent text cutoff */
.flag-metrics {
    display: flex;
    gap: 32px;
    margin-right: 24px;
    min-width: 180px; /* Ensure enough space for text */
    flex-shrink: 0; /* Prevent shrinking */
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 80px; /* Ensure each metric has enough space */
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap; /* Prevent label wrapping */
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap; /* Prevent value wrapping */
}

.metric-value.positive {
    color: var(--success);
}

.metric-value.negative {
    color: var(--danger);
}

.metric-value.gold {
    color: var(--gold);
}

/* Fix support button styling in list view */
.support-button-inline {
    padding: 12px 20px;
    background: var(--water-gradient);
    color: white !important;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent button from shrinking */
    min-width: 80px;
    font-size: 0.95rem;
}

.support-button-inline:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    color: white !important;
}

/* Ensure flag info section doesn't overflow */
.leaderboard-item .flag-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0; /* Allow flex items to shrink */
}

.flag-details {
    flex: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.flag-details .flag-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flag-category {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    white-space: nowrap;
}

/* ========== VIEW BUTTON COLOR FIXES ========== */

/* Completely reset and fix view button styles */
.view-controls {
    display: flex;
    gap: 10px;
    background: rgba(30, 41, 59, 0.3);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.view-controls .view-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px solid transparent !important;
    color: var(--text-secondary) !important;
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: none !important;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1) !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

/* Remove any pseudo-elements that might interfere */
.view-controls .view-btn::before,
.view-controls .view-btn::after {
    display: none !important;
}

/* Hover state for inactive buttons */
.view-controls .view-btn:not(.active):hover {
    background: rgba(30, 41, 59, 0.5) !important;
    color: var(--text) !important;
    transform: translateY(-1px);
}

/* Active state with proper contrast */
.view-controls .view-btn.active {
    background: var(--water) !important;
    background-image: linear-gradient(135deg, #4ecdc4 0%, #1dd1a1 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 0 20px rgba(78,205,196,0.4) !important;
    transform: scale(1.02) !important;
}

/* Ensure spans inside active buttons are white */
.view-controls .view-btn.active span {
    color: #ffffff !important;
}

/* Force text color override for active state */
.view-controls .view-btn.active,
.view-controls .view-btn.active * {
    color: #ffffff !important;
}

/* ========== EMAIL BUTTON FIXES ========== */

/* Hide data attributes and @ symbols completely */
.email-protected[data-user]::before,
.email-protected[data-user]::after,
.email-protected[data-domain]::before,
.email-protected[data-domain]::after {
    content: none !important;
    display: none !important;
}

/* Clean up any visible @ symbols */
.email-protected::before,
.email-protected::after {
    content: none !important;
}

/* Ensure proper styling for email links */
.email-protected {
    cursor: pointer;
    color: var(--water);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.email-protected:hover {
    color: var(--charity);
    transform: translateX(3px);
}

/* Specific fixes for footer email links */
.footer-section .email-protected {
    color: var(--text-secondary);
    padding: 2px 0;
}

.footer-section .email-protected:hover {
    color: var(--water);
}

/* Verification links styling */
.verification-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.verify-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    color: var(--water);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.verify-link:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
}

.verify-link span {
    font-size: 1.1rem;
}

/* ========== RESPONSIVE FIXES ========== */

/* Mobile adjustments for list view */
@media (max-width: 768px) {
    .flag-metrics {
        gap: 20px;
        margin-right: 15px;
        min-width: 140px;
    }
    
    .metric {
        min-width: 65px;
    }
    
    .metric-label {
        font-size: 0.7rem;
    }
    
    .metric-value {
        font-size: 1rem;
    }
    
    .support-button-inline {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .leaderboard-item {
        padding: 15px 20px;
        min-height: 70px;
    }
    
    .flag-details .flag-name {
        font-size: 1.1rem;
    }
    
    .verification-links {
        flex-direction: column;
        align-items: center;
    }
    
    .verify-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .flag-metrics {
        flex-direction: column;
        gap: 8px;
        margin-right: 10px;
        min-width: 80px;
    }
    
    .metric {
        align-items: center;
        min-width: auto;
    }
    
    .metric-label {
        font-size: 0.65rem;
    }
    
    .metric-value {
        font-size: 0.9rem;
    }
    
    .support-button-inline {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: 60px;
    }
}

/* ========== ADDITIONAL FIXES ========== */

/* Ensure consistent flag display in list */
.flag-display-list {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 40px;
    margin-right: 15px;
    flex-shrink: 0;
}

.flag-display-list .flag-img {
    max-width: 50px;
    max-height: 35px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flag-display-list .flag-emoji-fallback {
    font-size: 2.5rem;
}

/* Fix any container overflow issues */
.flags-container.leaderboard-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1000px;
    margin: 40px auto;
    overflow: hidden; /* Prevent horizontal scroll */
}

/* Ensure proper text selection for debugging */
.leaderboard-item * {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* ========== ENHANCED EMAIL LINK STYLES ========== */

/* Base styling for all email-protected elements */
.email-protected {
    /* Essential functionality */
    cursor: pointer !important;
    text-decoration: none !important;
    
    /* Visual styling */
    color: var(--water) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    
    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    
    /* Ensure proper positioning */
    position: relative !important;
    
    /* Prevent text selection issues */
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Hover effects for email links */
.email-protected:hover {
    color: var(--charity) !important;
    transform: translateX(3px) !important;
}

/* Active state for email links */
.email-protected:active {
    transform: translateX(3px) scale(0.98) !important;
}

/* Focus state for accessibility */
.email-protected:focus {
    outline: 2px solid var(--water) !important;
    outline-offset: 2px !important;
}

/* Prevent any pseudo-elements from interfering */
.email-protected::before,
.email-protected::after {
    content: none !important;
    display: none !important;
}

/* Hide any data attributes that might leak through */
.email-protected[data-user]::before,
.email-protected[data-user]::after,
.email-protected[data-domain]::before,
.email-protected[data-domain]::after,
.email-protected[data-email-processed]::before,
.email-protected[data-email-processed]::after {
    content: none !important;
    display: none !important;
}

/* Footer specific email link styling */
.footer-section .email-protected {
    color: var(--text-secondary) !important;
    padding: 2px 0 !important;
    font-size: inherit !important;
}

.footer-section .email-protected:hover {
    color: var(--water) !important;
}

/* Verification links specific styling */
.verification-links .email-protected {
    color: var(--water) !important;
    text-decoration: none !important;
    position: relative !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    background: rgba(78, 205, 196, 0.1) !important;
    border: 1px solid rgba(78, 205, 196, 0.2) !important;
}

.verification-links .email-protected:hover {
    background: rgba(78, 205, 196, 0.2) !important;
    border-color: rgba(78, 205, 196, 0.4) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3) !important;
}

/* Button style email links */
.btn.email-protected {
    background: var(--water-gradient) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.btn.email-protected:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4) !important;
}

.btn.secondary.email-protected {
    background: transparent !important;
    color: var(--water) !important;
    border: 2px solid var(--water) !important;
}

.btn.secondary.email-protected:hover {
    background: var(--water) !important;
    color: white !important;
}

/* Ensure icons within email links are properly styled */
.email-protected span,
.email-protected i {
    color: inherit !important;
    pointer-events: none !important;
    font-style: normal !important;
}

/* Loading state for email links (optional) */
.email-protected.loading {
    opacity: 0.7 !important;
    cursor: wait !important;
    transform: none !important;
}

.email-protected.loading::after {
    content: "..." !important;
    animation: emailLinkLoading 1s infinite !important;
}

@keyframes emailLinkLoading {
    0%, 33% { content: "." !important; }
    34%, 66% { content: ".." !important; }
    67%, 100% { content: "..." !important; }
}

/* Error state for email links (if mailto fails) */
.email-protected.error {
    color: #ef4444 !important;
    cursor: not-allowed !important;
}

.email-protected.error:hover {
    transform: none !important;
}

/* Success state for email links (brief feedback) */
.email-protected.success {
    color: var(--success) !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .email-protected {
        font-size: 0.9rem !important;
        gap: 3px !important;
    }
    
    .verification-links .email-protected {
        padding: 6px 10px !important;
        font-size: 0.85rem !important;
    }
    
    .btn.email-protected {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .email-protected {
        border: 1px solid currentColor !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .email-protected {
        transition: none !important;
    }
    
    .email-protected:hover {
        transform: none !important;
    }
}

/* Force visibility of email links (override any hiding styles) */
.email-protected {
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-flex !important;
}

/* Ensure email links are above other elements */
.email-protected {
    z-index: 10 !important;
}

/* Clear any conflicting link styles */
a.email-protected {
    text-decoration: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

a.email-protected:hover {
    text-decoration: none !important;
    border-bottom: none !important;
    background-image: none !important;
}

/* Debug mode styles (add 'debug' class to body for testing) */
body.debug .email-protected {
    border: 2px dashed #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
}

body.debug .email-protected::before {
    content: "📧" !important;
    display: inline !important;
    margin-right: 5px !important;
}

body.debug .email-protected[data-email-processed]::after {
    content: "✅" !important;
    display: inline !important;
    margin-left: 5px !important;
}
