/*********** Responsive Styles for All Screens ***********/

/* Base Variables */
:root {
  --primary-color: #00d2ff;
  --secondary-color: #3a7bd5;
  --error-color: #d32f2f;
  --text-color: #fff;
  --placeholder-color: rgba(255, 255, 255, 0.7);
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --form-bg: rgba(255, 255, 255, 0.15);
  --input-bg: rgba(255, 255, 255, 0.1);
  --input-border: rgba(255, 255, 255, 0.2);
  --box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  --navy-blue: #001a33;
  --mobile-padding: 15px;
}

/* Base Styles */
body#login-page {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  background-color: var(--navy-blue);
  width: 100%;
  min-height: 100vh;
}

/* iOS-Specific Fixes Only */
@supports (-webkit-touch-callout: none) {
  body#login-page {
    height: -webkit-fill-available;
    min-height: -webkit-fill-available;
  }
  
  .container {
    position: relative;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 20px auto !important;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    max-height: 80vh;
  }
  
  .form-container {
    width: 100% !important;
    padding: 2rem !important;
  }
  
  input, select, button {
    min-height: 44px;
  }
  
  @media (min-width: 768px) {
    body#login-page {
      background-attachment: scroll;
    }
    
    .container {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(1.15);
    }
  }
}

/* Desktop Background Image */
@media (min-width: 768px) {
  body#login-page {
    background: url('index.jpg') no-repeat center center;
    background-size: 100% auto;
    min-height: 100vh;
    height: auto;
    overflow-y: scroll;
  }
  
  body#login-page::after {
    content: '';
    display: block;
    padding-top: 100%;
    pointer-events: none;
  }

  body#login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    z-index: 0;
    animation: pulseOverlay 2s infinite ease-in-out;
    pointer-events: none;
  }
  
  .container {
    position: relative;
    z-index: 2;
  }
}

/* Mobile Image Container */
.main-image-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35vh;
  width: 100%;
  overflow: hidden;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--navy-blue);
}


.main-image {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  
  /* Linear feathering on all sides */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    white 10%,
    white 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    white 10%,
    white 90%,
    transparent 100%
  );

  /* Add vertical feathering too */
  -webkit-mask-composite: destination-in;
  mask-composite: intersect;
  -webkit-mask-image: 
    linear-gradient(to right, transparent 0%, white 10%, white 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, white 10%, white 90%, transparent 100%);
  mask-image: 
    linear-gradient(to right, transparent 0%, white 10%, white 90%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, white 10%, white 90%, transparent 100%);
}

.main-image-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.05);
  animation: pulseOverlay 2s infinite ease-in-out;
  z-index: 2;
  pointer-events: none;
}

/* Particles container for mobile image */
.main-image-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 4;
}

.main-image-particle {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: float linear infinite;
  will-change: transform;
}

@media (min-width: 768px) {
  .main-image-container,
  .main-image,
  .main-image-particles {
    display: none;
  }
}

/* Container Styles */
.container {
  width: calc(100% - (2 * var(--mobile-padding)));
  max-width: 1200px;
  background: var(--form-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 5px;
  box-shadow: var(--box-shadow);
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  padding: 0 var(--mobile-padding);
  padding-bottom: calc(40vh + 20px);
  box-sizing: border-box;
  margin-top: 60px;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.15);
    margin: 0;
    z-index: 2;
    padding-bottom: 0;
    flex-direction: row;
    padding: 0;
    width: 90%;
    min-height: auto;
    transform-origin: center center;
    /*margin-top: 50px;*/
  }
}

/* Form Container */
.form-container {
  padding: 20px 0;
  width: 100%;
  transition: all 0.6s ease-in-out;
  animation: floatIn 0.6s ease-out both;
  box-sizing: border-box;
  min-width: 0;
}

@media (min-width: 768px) {
  .form-container {
    width: 50%;
    padding: 3rem;
  }
}

/* Small Screen Adjustments (<600px) */
@media (max-width: 599px) {
  :root {
    --mobile-padding: 12px;
  }
  
  .container {
    width: 100%;
    max-width: calc(100vw - (2 * var(--mobile-padding)));
    margin: 10px auto;
    padding-left: max(var(--mobile-padding), env(safe-area-inset-left));
    padding-right: max(var(--mobile-padding), env(safe-area-inset-right));
    margin-top: 80px;
    padding-top: 20px;
  }
  
  input, select, button {
    max-width: 100%;
    touch-action: manipulation;
  }

  .top-nav {
    padding: 8px max(var(--mobile-padding), env(safe-area-inset-left));
  }
}

/* Form Elements */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

h1 {
  color: var(--text-color);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  margin-bottom: 1.5rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input, select, button {
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s;
  width: 100%;
  box-sizing: border-box;
  /* iOS Input Fix */
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder {
  color: var(--placeholder-color);
}

input:focus, select:focus,
a:focus, button:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.2);
}

/* Password Container */
.password-container {
  position: relative;
  width: 100%;
}

.password-container input[type="password"],
.password-container input[type="text"] {
  padding-right: 2.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  color: #666;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Date of Birth Fields */
.dob-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.dob-container h4 {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 0.875rem;
  font-weight: normal;
}

.dob-fields {
  display: flex;
  gap: 0.5rem;
}

.dob-fields select {
  flex: 1;
  min-width: 0;
}

/* Buttons */
button, button[type="submit"] {
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  color: white;
  font-weight: bold;
  cursor: pointer;
  border: none;
  margin-top: 1rem;
  padding: 0.8rem;
  /* iOS Button Fix */
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 210, 255, 0.4);
}

/* Error Messages */
.error-box {
  color: var(--error-color);
  background-color: #fce4e4;
  border: 1px solid #f3c1c1;
  padding: 0.8rem;
  border-radius: 4px;
  margin: 1rem 0;
  display: none;
}

/* Particles Animation */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: float linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}

/* Animations */
@keyframes pulseOverlay {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.8; }
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-100px) translateX(50px); }
  100% { transform: translateY(-200px) translateX(0); }
}

/* Select Dropdown Styling */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 2rem;
}

select option {
  color: #000;
  background: #fff;
}

/* Top Navigation Bar */
.top-nav {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 10px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  will-change: transform;
  /* iOS Safe Area */
  padding-top: env(safe-area-inset-top);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 10px auto;
  padding: 0 20px;
  /* iOS Safe Area */
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.social-links a, .support-email a {
  color: white;
  text-decoration: none;
  margin: 0 10px;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.social-links a:hover, .support-email a:hover {
  color: var(--primary-color);
}

.social-links a i {
  font-size: 1.2rem;
  margin-right: 5px;
}

/* Tooltips for social links */
.social-links a {
  position: relative;
}

.social-links a::after {
  content: attr(data-platform);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.social-links a:hover::after {
  opacity: 1;
}

/* Responsive Breakpoints */
@media (min-width: 600px) {
  .container {
    width: 90%;
  }
  
  .form-container {
    padding: 2.5rem 0;
  }
}

@media (min-width: 1024px) {
  .form-container {
    padding: 3.5rem;
  }
  
  h1 {
    margin-bottom: 2rem;
  }
}

@media (max-width: 600px) {
  .nav-container {
    flex-direction: column;
    padding: 10px;
    gap: 8px; /* Added gap between stacked elements */
  }
  
  .social-links, .support-email {
    margin: 5px 0;
    text-align: center; /* Center align the links */
  }

  /* Reduce icon sizes slightly on mobile */
  .social-links a i {
    font-size: 1rem;
  }
}

/* Print Styles */
@media print {
  .top-nav, .particles, .main-image-container {
    display: none;
  }
}

/* ==================== */
/* iPhone Scroll & Spacing Fixes */
/* ==================== */

/* General iOS Scroll Fix (for all iPhones) */
@supports (-webkit-touch-callout: none) {
  .container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    margin-top: calc(60px + env(safe-area-inset-top)) !important;
  }
  
  @media (max-width: 599px) {
    .container {
      margin-top: calc(80px + env(safe-area-inset-top)) !important;
    }
  }
}

/* iPhone 16 Pro Max Specific Fix */
@supports (-webkit-touch-callout: none) {
  @media only screen 
    and (device-width: 430px) 
    and (device-height: 932px) 
    and (-webkit-device-pixel-ratio: 3) {
    
    body#login-page {
      height: 100%;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .container {
      margin-top: calc(100px + env(safe-area-inset-top)) !important;
      padding-top: 20px !important;
      position: relative;
      top: auto;
      left: auto;
      transform: none;
      margin: 20px auto;
      max-height: none;
    }

    .main-image-container {
        height: 35vh;
    }
    
    ::-webkit-scrollbar {
      -webkit-appearance: none;
      width: 8px;
    }
    ::-webkit-scrollbar-thumb {
      background-color: rgba(255, 255, 255, 0.3);
      border-radius: 4px;
    }
  }
}



/*************** profile********************/

/* Body and Background Fixes */
body#profile-page {
    font-family: 'Segoe UI', sans-serif;
    background: url('profile.jpeg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    /* iOS Viewport Fix */
    height: 100vh;
    max-height: -webkit-fill-available;
}

/* Background Image Layer (mobile and desktop) */
body#profile-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('profile.jpeg') no-repeat center center;
    background-size: cover;
    z-index: -2;
}

/* Background Overlay Fix */
body#profile-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
    animation: pulseOverlay 2s infinite ease-in-out;
    /* iOS Fixed Background Fix */
    transform: translate3d(0,0,0);
    -webkit-transform: translate3d(0,0,0);
}

/* Add mobile-specific background fix */
@media (max-width: 767px) {
    body#profile-page {
        background-attachment: scroll;
    }
    
    body#profile-page::after {
        background-attachment: scroll;
    }
}

/* Safari/iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    body#profile-page {
        height: -webkit-fill-available;
        padding-top: env(safe-area-inset-top);
    }
    
    .profile-container {
        position: absolute;
    }
}

/* Navbar Styles with iOS Fixes */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    padding: 12px max(1rem, env(safe-area-inset-left));
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* iOS Navbar Fix */
    padding-top: calc(12px + env(safe-area-inset-top));
    box-sizing: border-box;
    font-family: 'Space Mono', monospace;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s;
    white-space: nowrap;
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* Profile Container with iOS Fixes */
.profile-container {
    position: relative;
    max-width: 560px;
    width: calc(100% - 40px);
    margin: 80px auto 20px;
    padding: 2rem max(1rem, env(safe-area-inset-left));
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    animation: floatIn 0.6s ease-out;
    overflow-y: visible;
    z-index: 1;
    box-sizing: border-box;
    /* iOS Scroll Fix */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .profile-container {
        position: relative; /* Changed from absolute */
        top: auto;
        left: auto;
        transform: none;
        margin: 80px auto;
    }
}

/* Mobile - Consolidated all mobile styles */
@media (max-width: 767px) {
    .profile-container {
        width: calc(100% - 30px);
        margin: 70px auto 20px;
        padding: 1.5rem;
        max-height: calc(100vh - 100px);
        /* Remove any transform/position that might conflict */
        transform: none;
        left: auto;
    }
    
    /* Landscape */
    @media (orientation: landscape) {
        .profile-container {
            max-height: 70vh;
            margin-top: 60px;
        }
    }
}

/* Small Phones Portrait */
@media (max-width: 600px) {
    .profile-container {
        padding: 1.5rem max(0.5rem, env(safe-area-inset-left));
        width: calc(100% - 30px);
        margin-top: calc(70px + env(safe-area-inset-top));
        max-height: calc(100vh - 100px);
    }
    
    .navbar {
        padding: 10px max(0.5rem, env(safe-area-inset-left));
        gap: 10px;
        flex-wrap: wrap;
        padding-top: calc(10px + env(safe-area-inset-top));
    }
    
    .navbar a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
}

/* Extra Small Phones */
@media (max-width: 480px) {
    .profile-container {
        width: calc(100% - 20px);
        padding: 1rem;
    }
    
    .profile-header {
        font-size: 1.8rem;
    }

    .profile-detail {
        flex-direction: column;
        gap: 5px;
        text-align: left; /* Container alignment */
    }
    
    .detail-label {
        text-align: left;
        flex: 0 0 100%; /* Take full width */
    }
    
    .detail-value {
        text-align: right; /* Right-align the value */
        flex: 0 0 100%; /* Take full width */
        margin-top: 4px;
    }
}

/* Profile Content */
.profile-header {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.profile-detail {
    display: flex;
    flex-direction: column; /* Stack vertically */
    gap: 5px;
    text-align: left;
    margin: 1rem 0;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.detail-label {
    font-weight: bold;
    color: #f8f8f8;
    /* Add this to ensure labels stay left-aligned */
    text-align: left;
    flex: 0 0 100%; /* Full width */
    min-width: 120px; /* Give labels minimum width */
}

.detail-value {
    font-weight: bold;
    color: #ffeb3b;
    text-align: right;
    flex: 0 0 100%; /* Full width */
    margin-top: 4px;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    min-width: 0;
}

/* Message Styles */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1rem;
}

.success {
    background-color: rgba(76, 175, 80, 0.9);
}

.error {
    background-color: rgba(244, 67, 54, 0.9);
}

/* Animated Elements */
.star {
    animation: pulse 2s infinite, colorshift 3s infinite;
    display: inline-block;
}

.rank-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    background: linear-gradient(to right, #4b6cb7, #182848);
    margin: 0 3px;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
}

.vote-id {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    margin: 2px;
    transition: all 0.3s;
    font-size: 0.9em;
}

.vote-id:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Refresh Indicator */
#refresh-indicator {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: max(20px, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    display: none;
    z-index: 1000;
    font-size: clamp(14px, 3vw, 16px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    align-items: center;
    max-width: calc(100% - 40px);
}

.spinner {
    display: inline-block;
    margin-right: 10px;
    animation: spin 1s linear infinite;
    font-size: 20px;
}

/* Animations */
@keyframes pulseOverlay {
    0%, 100% { background-color: rgba(0, 0, 0, 0.3); }
    50% { background-color: rgba(0, 0, 0, 0.6); }
}

@keyframes floatIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeInOut {
    0% { opacity: 0.8;}
    50% { opacity: 1; }
    100% { opacity: 0.8;}
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes colorshift {
    0% { color: #ffeb3b; }
    33% { color: #ff9800; }
    66% { color: #f44336; }
    100% { color: #ffeb3b; }
}

/* Add to very end of CSS as a safeguard */
@supports (-webkit-touch-callout: none) {
    /* iOS-specific centering fix */
    .profile-container {
        margin-left: auto;
        margin-right: auto;
    }
}

/************* edit profile *********/
body#edit-profile-page-container {
    background: url('profile.jpeg') no-repeat center center;
    background-size: cover;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    /* iOS Viewport Fix */
    @supports (-webkit-touch-callout: none) and (not (-webkit-overflow-scrolling: none)) {
        height: -webkit-fill-available;
    }
}

/* Background Image Layer */
body#edit-profile-page-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('profile.jpeg') no-repeat center center;
    background-size: cover;
    z-index: -2;
}

/* Pulse Overlay Layer */
body#edit-profile-page-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: -1;
    /* iOS Fixed Background Fix */
    transform: translate3d(0,0,0);
    -webkit-transform: translate3d(0,0,0);
}

/* Mobile background fix */
@media (max-width: 767px) {
    body#edit-profile-page-container {
        background-attachment: scroll;
    }
    
    body#edit-profile-page-container::after {
        background-attachment: scroll;
    }
}

/* Main Container */
.edit-profile-container {
    max-width: 450px;
    width: calc(100% - 40px);
    margin: 80px auto 40px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: white;
    animation: floatIn 0.6s ease-out;
    position: relative;
    min-height: auto;
    /* Chrome fix */
    transform: translateZ(0);
    /* iOS Scroll Fix */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* Desktop Positioning */
@media (min-width: 768px) {
    .edit-profile-container {
        margin: 80px auto;
    }
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .edit-profile-container {
        width: calc(100% - 30px);
        margin: 70px auto 30px;
    }
    
    /* Stack form fields on small screens */
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .form-full-width, .dob-profile-container {
        grid-column: span 1 !important;
    }
}

/* Extra Small Phones */
@media (max-width: 480px) {
    .edit-profile-container {
        width: calc(100% - 20px);
        margin: 60px auto 20px;
    }
    
    .dob-fields {
        flex-direction: column;
        gap: 8px;
        flex-direction: row;
    }
}

/* Form Styles */
.edit-profile-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 15px;
}

.form-full-width {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.edit-profile-container input,
.edit-profile-container select {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    box-sizing: border-box;
    /* iOS Input Fix */
    /*-webkit-appearance: none;*/
    min-height: 44px; /* Better touch target */
}

.edit-profile-container input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.edit-profile-container select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 25px;
}

/* Date of Birth Section */
.dob-profile-container {
    grid-column: span 2;
    margin-top: 5px;
}

.dob-profile-container h4 {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.dob-fields {
    display: flex;
    gap: 10px;
    flex-direction: row;
}

.dob-fields select {
    flex: 1;
}

/* Messages */
.error-message, .success-message {
    grid-column: span 2;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    text-align: center;
    font-size: 0.9rem;
}

.error-message {
    color: #ff6b6b;
    background: rgba(255, 0, 0, 0.1);
}

.success-message {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

/* Password Toggle */
.edit-password-container {
    position: relative;
    width: 100%;
}

.edit-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    /* iOS Button Fix */
    -webkit-tap-highlight-color: transparent;
}

.edit-password-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.edit-password-container input {
    padding-right: 30px !important;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.action-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #2E3192, #1BFFFF);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    max-width: 200px;
    text-align: center;
    /* iOS Button Fix */
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* Better touch target */
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Animations */
@keyframes floatIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Add this at the end of your CSS */
@supports (-webkit-touch-callout: none) {
  /* Chrome on iOS specific fixes */
  _::-webkit-full-page-media, _:future, :root body#edit-profile-page-container {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    height: auto !important;
  }
  
  _::-webkit-full-page-media, _:future, :root .edit-profile-container {
    position: relative !important;
    transform: none !important;
  }
}

/* Chrome-specific scroll fix */
@media screen and (-webkit-min-device-pixel-ratio:0) {
  body#edit-profile-page-container {
    overflow: auto;
    height: auto;
  }
}


/**************navigation bar***************/

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(30, 30, 30, 0.85); /* Semi-transparent dark */
  backdrop-filter: blur(8px); /* Frosted glass effect */
  color: white;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0 10px;
  height: 50px; /* Fixed height */
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 0 15px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  position: relative;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-right: 10px; /* Added space between links */
}

/* Animated underline effect */
.navbar a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #fdbb2d, #b21f1f);
  transition: width 0.3s ease;
}

.navbar a:hover::after {
  width: 70%;
}

.navbar a:hover {
  color: #fdbb2d; /* Gold color on hover */
  background-color: rgba(255, 255, 255, 0.05);
}

/* Add subtle animation on page load */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar {
  animation: fadeInDown 0.5s ease-out;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .navbar {
    justify-content: center;
    padding: 0 10px;
    height: 45px;
  }
  
  .navbar a {
    padding: 0 10px;
    font-size: 0.75rem;
  }
}

/**********votes*********/
/* Vote Page Base Styles */
body#vote-page {
  background: url('index.jpg') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 70px 0 20px; /* Removed left/right padding to eliminate gap */
  font-family: 'Space Mono', monospace;
  color: white; /* Set default text color to white */
  /* iOS Viewport Fix */
  height: 100vh;
  max-height: -webkit-fill-available;
}

/* Background Image Layer (mobile and desktop) */
body#vote-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('index.jpg') no-repeat center center;
  background-size: cover;
  z-index: -2;
  /* iOS Fixed Background Fix */
  transform: translate3d(0,0,0);
  -webkit-transform: translate3d(0,0,0);
}

body#vote-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: -1;
  /* iOS Fixed Background Fix */
  transform: translate3d(0,0,0);
  -webkit-transform: translate3d(0,0,0);
}

@supports (-webkit-touch-callout: none) {
  body#vote-page {
    background-attachment: initial;
  }
}

/* Mobile-specific background fix */
@media (max-width: 767px) {
  body#vote-page {
    background-attachment: scroll;
  }
  
  body#vote-page::after {
    background-attachment: scroll;
  }
}


/* Main Layout Container - New */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; 
  gap: 30px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  overflow-x: hidden; /* Prevents horizontal overflow */
}


/* Votes Container - Updated */
.votes-container,
.create-vote {
  font-family: 'Space Mono', monospace;
  background: rgba(30, 30, 30, 0.7);
  border-radius: 15px;
  padding: 20px;
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: white;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  box-sizing: border-box; /* Include padding in width calculation */
}


/* Tablet layout - Not sure about it (need to test using ipad)*/
@media (max-width: 1199px) and (min-width: 768px) {
  .main-content {
    max-width: 1200px;
    padding: 20px 40px;
  }
}

.votes-container h1 {
  color: #fdbb2d; 
  margin-top: 0;
}

.votes-list {
  font-family: 'Space Mono', monospace;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0;
  padding-left: 10px; /* Space for scrollbar */
  direction: rtl; /* Right-to-left moves scrollbar to left */
  scrollbar-width: thin;
  scrollbar-color: #fdbb2d rgba(0,0,0,0.2);
}

/* Reset direction for content */
.votes-list > * {
  direction: ltr; /* Left-to-right for the actual content */
}

.votes-list::-webkit-scrollbar {
  width: 6px;
}

.votes-list::-webkit-scrollbar-thumb {
  background-color: #fdbb2d;
  border-radius: 3px;
}

/* Fix for answer fields in same row */
.vote-item form {
  display: flex;
  /*flex-direction: row; /* Keep main form as column */
  gap: 15px;
  position: relative; /* Needed for absolute button positioning */
}

/* Vote Item Cards */
.vote-item {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  border-radius: 12px;
  padding: 20px;
  /*padding-top: 20px; /* Creates space for top button */
  margin-bottom: 20px;
  color: white;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.vote-item h2 {
  margin-top: 0;
  font-size: 1.3rem;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}


/* Template and Option in same row */
.vote-item .template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 8px 0;
}

.vote-item .template-row p {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.vote-item .label {
  font-weight: normal;
  min-width: 60px;
  display: inline-block;
  color: rgba(255,255,255,0.8);
}

.vote-item .value {
  font-weight: bold;
  color: #000;
}

/* Answer Fields Grid */
/*.answer-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 15px 0;
}*/

/* Answers in same line */
.answer-fields-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
}

/* Template and Option in same line */
.vote-item p {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
  /*margin-bottom: 8px;*/
}


/* Special container for answer fields */
.vote-item .answers-container {
  display: flex !important; /* Override parent flex-direction */
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.vote-item .answer-field {
  min-width: 100px;
  max-width: 150px;
  margin: 0;
  flex: 1 0 auto; /* Allow growth but keep base size */
  /*display: inline-block;*/
}


.vote-item .answer-field select {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: white;
  font-family: 'Space Mono', monospace;
  padding: 6px 8px; /* Slightly tighter padding */
  font-size: 0.85rem; /* Slightly smaller font */
}

/* Style for disabled options in select */
.answer-field option:disabled {
  /*color: #999 !important;*/
  /*background-color: #333 !important;*/
  background-color: #f5f5f5;
  color: #aaa;
}

/* Timer with Emoji */
.timer {
  display: inline-flex; /* Changed from inline to inline-flex */
  align-items: center;
  gap: 5px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
}

/* Spin animation only for active timers */
.timer:not(.deadline)::before {
  content: "⏳";
  display: inline-block;
  animation: spin 2s linear infinite;
}

/* Static emoji for expired timer */
.timer.deadline::before {
  content: "⏳";
  display: inline-block;
  animation: none; /* No animation */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.vote-item .timer {
  /*width: 33%;*/
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
}

.timer.green { color: #4cff4c; }
.timer.orange { color: #ffb347; }
.timer.red { color: #ff4d4d /*#ff6961*/; }
.timer.deadline { color: #000000; }

/* Vote Button Positioning */
/*vote-item .vote-button-container {
  position: absolute;
  top: 20px;
  right: 20px;
}*/

.vote-item button {
  position: static;
  margin: 0;
  /* Keep other button styles */
  /*background: rgba(0,0,0,0.7);*/
  background: linear-gradient(135deg, #2E3192, #1BFFFF);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 17px;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1.05rem;
  white-space: nowrap;
}

.vote-item button:before {
  content: "📣 ";
}

.vote-item button:hover {
  background: #3a56a0;
  transform: translateY(-2px);
}

.vote-item button:disabled {
  background: rgba(0,0,0,0.3);
  color: #000;
  font-size: 1.05rem;
  cursor: not-allowed;
}

.vote-item button:disabled:before {
  content: "🔒 "; /* Lock emoji for expired */
}

.create-vote > * {
  margin-top: 0;
  margin-bottom: 0; /* Adjust this value to control spacing */
}

.create-vote > *:last-child {
  margin-bottom: 0;
}


.create-vote h1 {
  margin-top: 0;
  /*font-size: 1.5rem;*/
  margin-bottom: 1.5rem;
  color: #fdbb2d;
}

.create-vote label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.create-vote select {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: white;
  margin-bottom: 15px;
  font-family: 'Space Mono', monospace;
}

/* ===== Mobile Breakpoints (Fixed Spacing) ===== */

/* Small Tablet (600px-767px) */
@media (max-width: 767px) and (min-width: 600px) {
  .votes-container,
  .create-vote {
    max-width: 90%; /* Leaves 5% space on each side */
  }
}

/* Mobile (480px-599px) */
@media (max-width: 599px) {
  .main-content {
    padding: 15px; /* Adds equal space on left & right */
  }
  
  .votes-container,
  .create-vote {
    max-width: 100%; /* Takes full width but respects .main-content padding */
    width: calc(100% - 30px); /* Optional: Force a fixed margin (15px each side) */
  }
}

/* Tiny Mobile (Below 480px) */
@media (max-width: 479px) {
  .main-content {
    padding: 10px; /* Smaller but equal spacing */
  }
  
  .votes-container,
  .create-vote {
    width: calc(100% - 20px); /* 10px margin on each side */
  }
}

/* Mobile override for votes-list */
@media (max-width: 767px) {
  .votes-list {
    direction: ltr; /* Reset to normal direction */
    padding-left: 0; /* Remove scrollbar space */
    width: 100%; /* Full width */
    margin: 0; /* Remove any margins */
    padding-right: 0; /* Ensure no right padding */
  }

  /* Reset content direction */
  .votes-list > * {
    direction: ltr; /* Already set, but ensure it's maintained */
  }

  /* Optional: Make scrollbar less prominent on mobile */
  .votes-list::-webkit-scrollbar {
    width: 4px;
  }
}

/* Vote Question Styling */
/*#vote-question { 
  font-size: 1.1rem;
  font-weight: bold;
  margin: 15px 0;
  color: hsl(191, 100%, 50%) !important;
  background: rgba(0,0,0,0.2);
  padding: 10px;
  border-radius: 8px;
}*//*old*/

#vote-question {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 0 auto 15px; /* Centering with auto margins */
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fdbb2d;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 12px 15px;
  width: 100%; /* Full width of container */
  max-width: 600px; /* Maximum width */
  box-sizing: border-box; /* Include padding in width */
  display: block; /* Ensure margin auto works */
}

.answer-choices {
    font-size: 0.9em;
    color: #d1cfd1;
    margin-top: 5px;
}

/* Player Image Voting Styles */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.player-option {
    display: block;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.player-option:hover {
    transform: translateY(-3px);
}

.player-image-container {
    width: 110px;
    height: 140px;
    position: relative;
    margin: 0 auto;
}


.player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    background: #f0f0f0;
    display: block;
}

.player-option input[type="radio"] {
    display: none;
}

.player-option input[type="radio"]:checked + .player-image-container {
    outline: 3px solid #4CAF50;
    outline-offset: -3px;
}

.percentage-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/******************/
/* Image Grid */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.player-option {
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.player-image-container {
    position: relative;
    width: 110px;
    height: 140px;
    margin: 0 auto;
    border: 2px solid #4CAF50; /* Outline color */
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    /*background: #f5f5f5;*/
    overflow: hidden;
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: transparent;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.player-image[src] {
    background: none;
}

.player-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background-color: rgba(255, 255, 255, 0.1);
}

.player-name {
    margin-top: 5px;
    font-size: 14px;
}

.percentage-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: #fdbb2d;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    z-index: 2;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.vote-prompt {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.player-option:hover .player-image-container {
    border-color: #2E7D32; /* Darker green */
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

/* Mobile Responsiveness (below 768px) */
@media (max-width: 767px) {
    /* Smaller player cards */
    .answers-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }
    
    .player-image-container {
        width: 80px;
        height: 100px; /* More square aspect ratio */
    }
    
    /* Adjust percentage badge */
    .percentage-badge {
        font-size: 10px;
        padding: 1px 5px;
        bottom: 3px;
        right: 3px;
    }
    
    /* Smaller player names */
    .player-name {
        font-size: 12px;
        margin-top: 3px;
    }
    
    /* Smaller initials fallback */
    .player-initials {
        font-size: 18px;
    }

    .player-option {
        min-height: 130px; /* Ensures tap area is large enough */
    }
}

/* Prevent grid overflow */
.vote-item {
    overflow: hidden; /* Contain all child elements */
}

.answers-grid {
    max-width: 100%;
    overflow: visible; /* Allow natural grid expansion */
    will-change: transform; /* Improves mobile scrolling */
}
/*****************/

/* For multiple selections */
.player-option select {
    display: none; /* Hide original select */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .answers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Form actions container */
.form-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Error Message */
.error-message {
  color: #440200;
  font-weight: bold;
  background: rgba(0,0,0,0.2);
  border-radius: 5px;
  /*padding: 15px;*/
  display: inline-block;
  flex-grow: 1; /* Takes remaining space */
}

/* Spacing between labels and values */
.template-option-row .label {
  display: inline-block;
  min-width: 70px;
  margin-right: 10px; /* Space after label */
}

/**********Create Vote**********/

.vote-design {
  position: relative; /* Changed from fixed to relative */
  border-radius: 15px;
  padding: 25px;
  backdrop-filter: blur(5px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 700px;
  margin: 20px auto; /* Centering with auto margins */
  color: white;
  background: rgba(30, 30, 30, 0.7); /* Added background for readability */
  z-index: 1; /* Ensure it stays above background elements */
  overflow-x: hidden;
}

@media (max-width: 767px) {
  .vote-design {
    width: calc(100% - 40px); /* Allows for 20px padding on each side */
    padding: 20px;
    margin: 20px auto;
  }

  #vote-question {
    font-size: 1.1rem;
    padding: 10px 12px;
    max-width: 100%; /* Full width on mobile */
    margin: 0 auto 12px;
  }
}

@media (max-width: 479px) {
  .vote-design {
    width: calc(100% - 30px);
    padding: 15px;
  }
  #vote-question {
    font-size: 1rem;
    padding: 8px 10px;
  }
}


/* Style for select dropdown arrows */
.create-vote select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

/* For answer fields in vote creation */
.filter-fields select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  padding-right: 25px;
}

.filter-fields {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.filter-headers {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.answer-group {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
}

.answer-group select {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  padding: 10px;
  color: white;
  font-family: 'Space Mono', monospace;
}

/* Dropdown arrows */
.answer-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

/* Submit button */
.vote-form button[type="submit"] {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 25px;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: block;
  margin: 25px auto 0;
  font-size: 1rem;
}

.vote-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Position lock indicator (when position is auto-set) */
.position-lock {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  margin-left: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .answer-group {
    flex-direction: row;
    gap: 10px;
  }
  
  .answer-group select {
    width: 100%;
  }
  
  .filter-headers {
    flex-direction: row;
    gap: 10px;
    text-align: center;
  }
}

.vote-form button:before {
  content: "🚀 ";
}

.percentages {
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.8);
    color: #fdbb2d;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
}

.percentages span {
    margin-right: 8px;
    white-space: nowrap;
    display: inline-block;
}

.vote-prompt {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-left: 10px;
    font-style: italic;
}

.vote-link {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.vote-link:hover {
    color: #fdbb2d;
    text-decoration: underline;
}

/*********vote_details***/
/* Vote Details Page Styles */
#vote-details-page {
    background: url('index.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#vote-details-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.temp-container {
    width: 90%; /* Responsive width */
    max-width: 800px; /* Maximum width */
    margin: 20px auto; /* Centering */
    padding: 25px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: white;
    position: relative; /* Changed from fixed */
    top: auto;
    left: auto;
    transform: none;
}

/* Responsive Adjustments */
@media (min-width: 1200px) {
    .temp-container {
        width: 85%;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .temp-container {
        width: calc(100% - 40px); /* More padding on sides */
        margin: 20px auto;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .temp-container {
        width: calc(100% - 30px);
        padding: 15px;
        margin: 15px auto;
    }
    
    .under-construction {
        padding: 30px 15px;
    }
    
    .under-construction p {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .temp-action-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.under-construction {
    text-align: center;
    padding: 40px 20px;
}

.under-construction p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #fdbb2d;
}

.temp-action-button {
    display: inline-block;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    margin-top: 20px;
}

.temp-action-button:hover {
    background: #3a56a0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Style for disabled position options */
select[id^="position_"] option:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    font-style: italic;
}

/* Style for enabled position options */
select[id^="position_"] option:not(:disabled) {
    background-color: #fff;
    color: #333;
}

/* Style for disabled position options */
select[id^="answer_"] option:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    font-style: italic;
}

/* Style for enabled position options */
select[id^="answer_"] option:not(:disabled) {
    background-color: #fff;
    color: #333;
}

/**********Votes loading in votes page********/
#loading-indicator {
    text-align: center;
    padding: 20px;
    display: none;
    color: #666;
}
.no-more-votes {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}
#load-more-btn {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#load-more-btn:hover {
    background-color: #45a049;
}
#load-more-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
.error-message-load-votes {
    color: #d9534f;
    font-weight: bold;
}



/********** Verification and Password Reset Pages********/
.message-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.message-box h1 {
    margin-bottom: 1rem;
    color: #333;
}

.message-box p {
    margin-bottom: 2rem;
    color: #555;
}

.btn {
    display: inline-block;
    background: #4a6fa5;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn:hover {
    background: #3a5a80;
}

.forgot-password {
    text-align: right;
    /*margin: 0.5rem 0 1rem;*/
}

.forgot-password a {
    color: #4a6fa5;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.back-to-login {
    margin-top: 1rem;
    text-align: center;
}

.back-to-login a {
    color: #4a6fa5;
    text-decoration: none;
}

.back-to-login a:hover {
    text-decoration: underline;
}

.error-box {
    color: #d9534f;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    display: none;
}

.success-box {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* Resend Verification Link */
.resend-verification {
    /*margin: 1rem 0;*/
    text-align: center;
    font-size: 0.9rem;
    color: #a1a1a1;
}

.resend-verification a {
    color: #4a6fa5;
    text-decoration: none;
    font-weight: bold;
}

.resend-verification a:hover {
    text-decoration: underline;
}

/***********enhancement for pasword reset**********/
/* Shared Form Styles */
.forgot-password-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    padding: 20px;
}

.form-forgot-password-container, .message-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    /*width: 100%;*/
    max-width: 500px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: #333;
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Input Fields */
.reset-password-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-input {
    /*width: 100%;*/
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
    color: #333;
}

.form-input:focus {
    border-color: #4a6fa5;
    outline: none;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

/* Button Styles */
.btn-submit {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #4a6fa5;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    text-decoration: none;
    margin-top: 1rem;
}

.btn-submit:hover {
    background-color: #3a5a80;
}

/* Error Handling */
.error-box {
    color: #d9534f;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.error-text {
    color: #d9534f;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: block;
}

.error-field {
    border-color: #d9534f !important;
}

.success-box {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* Links */
.forgot-password,
.resend-verification {
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    /*margin-top: 1rem;*/
}

.forgot-password a,
.resend-verification a {
    color: #4a6fa5;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password a:hover,
.resend-verification a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .form-container, .message-box {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/*****************/
/* Styles specifically for reset-password-container */
.reset-password-container, .form-forgot-password-container {
  /* Input text color fix */
  & input[type="email"],
  & input[type="password"],
  & input[type="text"] {
      color: #333; /* Explicit text color */
      width: 100%;
      padding-right: 30px; /* Makes space for the toggle button */
      box-sizing: border-box; /* Ensures padding is included in width */
  }

  /* Placeholder text styling */
  & ::placeholder {
      color: #999 !important;
      opacity: 1 !important;
  }

  /* For Edge */
  & ::-ms-input-placeholder {
      color: #999;
  }

  /* For IE10-11 */
  & :-ms-input-placeholder {
      color: #999;
  }

  /* Password toggle visibility enhancement */
  & input {
      padding-right: 40px; /* Ensure space for toggle button */
  }

  @media (prefers-color-scheme: dark) {
    & input[type="email"],
    & input[type="password"],
    & input[type="text"] {
        color: #eee;
        background-color: #333;
    }
    
    & ::placeholder {
        color: #bbb !important;
    }
  }
}