:root {
    --primary-pink: #ff69b4;
    --dark-pink: #ff1493;
    --light-pink: #ffb6c1;
    --accent-gold: #ffd700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--light-pink), var(--primary-pink));
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Optimized image loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Top Navigation */
.top-bar {
    background: linear-gradient(90deg, var(--dark-pink), var(--primary-pink));
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 60px;
    padding: 0 1rem;
    /* Ensure consistent height on mobile */
}

@media (max-width: 640px) {
    .top-bar {
        height: 60px; /* Fixed height on mobile */
    }
}

.contestant-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.contestant-photo {
    position: relative; /* Required for absolute positioning of logo */
    width: 100%;
    height: 250px;
}

.contestant-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contestant-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    z-index: 100; /* Ensures logo stays on top */
}

/* Vote Button */
.vote-button {
    background: linear-gradient(45deg, var(--dark-pink), var(--accent-gold));
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-button:hover {
    background: linear-gradient(45deg, var(--accent-gold), var(--dark-pink));
    transform: scale(1.05);
}

/* Share Button */
.share-btn {
    background: linear-gradient(45deg, var(--primary-pink), var(--accent-gold));
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.contestant-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: white;
}

.contestant-photo {
    position: relative;
    width: 100%;
    height: 250px; /* Fixed height for uniformity */
}

.contestant-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contestant-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    z-index: 10;
}

.contestant-info {
    padding: 12px;
    text-align: center;
}

.contestant-info h3 {
    font-weight: bold;
    margin-bottom: 4px;
}

.contestant-info p {
    color: #666;
    margin-bottom: 8px;
}

.vote-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.vote-btn:hover {
    background-color: #45a049;
}
/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.4);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

/* Form Inputs */
.form-input {
    border: 2px solid var(--light-pink);
    transition: all 0.3s ease;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.form-input:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.2);
    outline: none;
}

/* Payment Steps */
.payment-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.payment-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* News Ticker */
.news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #000;
    color: white;
    padding: 0.75rem 0;
    overflow: hidden;
    z-index: 50;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: tickerScroll 20s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Top Ten Scroller */
.top-ten-scroller {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 50px;
    overflow: hidden;
    z-index: 90;
    /* Ensure it stays on top of other content */
}

.top-ten-container {
    display: flex;
    height: 100%;
    align-items: center;
    animation: scroll 30s linear infinite;
    width: max-content;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.top-ten-item {
    display: flex;
    align-items: center;
    margin: 0 1rem;
    flex-shrink: 0;
}

/* Share Popup */
.share-popup {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
    z-index: 20;
    display: none;
    width: 180px;
}

.share-popup.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.share-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2px 0;
}

.share-option:hover {
    background: #f5f5f5;
    transform: translateX(2px);
}

.share-option i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-size: 18px;
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .top-bar {
        height: auto;
        padding: 0.5rem;
    }

    /* Keep top ten scroller at top on mobile */
    .top-ten-scroller {
        top: 60px; /* Adjusted to account for smaller header */
        height: 40px; /* Slightly smaller on mobile */
    }

    .contestants-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
    }

    .share-popup {
        width: 160px;
        right: -10px;
    }
}

/* Performance optimizations */
.will-change {
    will-change: transform, opacity;
}

.top-ten-scroller {
  overflow: hidden;
  white-space: nowrap;
  background-color: #fff0f5;
  border-top: 1px solid #f472b6;
  border-bottom: 1px solid #f472b6;
  padding: 10px 0;
}

.top-ten-container {
  display: inline-block;
  animation: scroll-left 20s linear infinite;
  padding-left: 100%;
  font-weight: bold;
  color: #b91c1c;
}

.top-ten-container span {
  margin-right: 50px;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}