/* CSS Custom Properties for Wedding Theme */
:root {
    --primary-dark: #1a2b4a;
    --primary-blue: #2c4a7a;
    --accent-light: #b8c5d6;
    --accent-gold: #d4af37;
    --text-light: #ffffff;
    --text-muted: #e8eef7;
    --gradient-primary: linear-gradient(135deg, #2c4a7a 0%, #1a2b4a 50%, #0f1a2e 100%);
    --gradient-accent: linear-gradient(45deg, #b8c5d6 0%, #d4af37 100%);
    --gradient-button: linear-gradient(45deg, #d4af37 0%, #b8c5d6 100%);
    --font-script: 'Dancing Script', cursive;
    --font-body: 'Lato', sans-serif;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  
  /* Reset and Base Styles */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html {
    height: 100%; /* Ensures the root HTML element takes the full height of the viewport */
  }
  
  body {
    font-family: var(--font-body);
    background: var(--gradient-primary);
    background-attachment: fixed;
    height: 100%; /* Makes the body element take the full height of its parent (html) */
    min-height: 100vh;
    display: flex; /* Makes the body a flex container */
    flex-direction: column; /* Arranges children in a column */
    color: var(--text-light);
    position: relative;
    overflow-x: hidden;
  }
  
  /* Dense non-uniform starry background effect */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
      radial-gradient(1px 1px at 15% 25%, rgba(255, 255, 255, 0.9), transparent),
      radial-gradient(2px 2px at 85% 15%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(1px 1px at 45% 65%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(3px 3px at 75% 85%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(1px 1px at 25% 45%, rgba(255, 255, 255, 0.9), transparent),
      radial-gradient(2px 2px at 95% 35%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 5% 75%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(2px 2px at 65% 25%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(1px 1px at 35% 85%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(3px 3px at 55% 5%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(1px 1px at 80% 60%, rgba(255, 255, 255, 0.9), transparent),
      radial-gradient(2px 2px at 20% 90%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 90% 80%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(2px 2px at 10% 40%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(1px 1px at 70% 70%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(3px 3px at 40% 20%, rgba(255, 255, 255, 0.9), transparent),
      radial-gradient(1px 1px at 60% 95%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(2px 2px at 30% 55%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(1px 1px at 85% 45%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(2px 2px at 50% 75%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(1px 1px at 18% 8%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(1px 1px at 92% 22%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(2px 2px at 38% 92%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(1px 1px at 72% 38%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(1px 1px at 8% 62%, rgba(255, 255, 255, 0.9), transparent),
      radial-gradient(2px 2px at 62% 8%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 28% 72%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(1px 1px at 82% 92%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(2px 2px at 48% 28%, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(1px 1px at 12% 48%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(1px 1px at 68% 82%, rgba(255, 255, 255, 0.9), transparent),
      radial-gradient(2px 2px at 88% 68%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 52% 12%, rgba(255, 255, 255, 0.7), transparent),
      radial-gradient(1px 1px at 32% 32%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(2px 2px at 78% 52%, rgba(255, 255, 255, 0.8), transparent);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    animation: twinkle 6s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
  }
  
  /* Additional star layer for maximum density */
  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
      radial-gradient(1px 1px at 22% 33%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 78% 67%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 12% 88%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 88% 12%, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(1px 1px at 67% 44%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 33% 77%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 56% 22%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 44% 56%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 77% 33%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 23% 67%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 89% 78%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 11% 22%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 66% 89%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 34% 11%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 92% 55%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 7% 37%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 63% 7%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 37% 63%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 93% 37%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 17% 93%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 73% 17%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 47% 73%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 27% 47%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 83% 27%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 57% 83%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 3% 57%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 97% 3%, rgba(255, 255, 255, 0.5), transparent),
      radial-gradient(1px 1px at 43% 97%, rgba(255, 255, 255, 0.3), transparent),
      radial-gradient(1px 1px at 87% 43%, rgba(255, 255, 255, 0.4), transparent),
      radial-gradient(1px 1px at 13% 87%, rgba(255, 255, 255, 0.5), transparent);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    animation: twinkle-slow 8s ease-in-out infinite alternate-reverse;
    pointer-events: none;
    z-index: 0;
  }
  
  @keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
  }
  
  @keyframes twinkle-slow {
    0% { opacity: 0.2; }
    100% { opacity: 0.8; }
  }
  
  /* Login Section */
  .login-container {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      padding: 20px;
      position: relative;
      z-index: 1;
  }
  
  .login-card {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 25px;
      padding: 40px;
      box-shadow: var(--shadow-soft);
      max-width: 400px;
      width: 100%;
      text-align: center;
  }
  
  .login-header h1 {
      color: var(--text-light);
      font-family: var(--font-script);
      font-size: 2.5em;
      font-weight: 600;
      margin-bottom: 15px;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  
  .wedding-icon {
      margin: 20px 0;
      display: flex;
      justify-content: center;
      align-items: center;
  }
  
  .wedding-icon img {
      width: 60px;
      height: 60px;
      object-fit: contain;
      filter: none;
      animation: none;
      cursor: pointer;
      transition: none;
  }
  
  .wedding-icon img:hover {
      transform: scale(1.1);
  }
  
  @keyframes gentle-glow {
      0% { filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3)); }
      100% { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.6)); }
  }
  
  .login-header p {
      color: var(--text-muted);
      margin-bottom: 30px;
      font-weight: 300;
  }
  
  .login-form {
      text-align: left;
  }
  
  .form-group {
      margin-bottom: 20px;
      transition: all 0.3s ease;
  }
  
  .form-group label {
      display: block;
      margin-bottom: 8px;
      color: var(--text-light);
      font-weight: 500;
  }
  
  .form-group input, .form-group textarea, .form-control {
      width: 100%;
      padding: 15px 16px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 12px;
      font-size: 16px;
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-light);
      backdrop-filter: blur(10px);
      transition: all 0.3s ease;
      font-family: var(--font-body);
      resize: vertical;
  }
  
  .form-group input::placeholder, .form-group textarea::placeholder, .form-control::placeholder {
      color: rgba(255, 255, 255, 0.6);
  }
  
  .form-group input:focus, .form-group textarea:focus, .form-control:focus {
      outline: none;
      border-color: var(--accent-gold);
      background: rgba(255, 255, 255, 0.15);
      box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
  }
  
  .guest-access {
      text-align: center;
  }
  
  .guest-access a {
      text-decoration: none;
  }
  
  /* Admin Section */
  .admin-container {
      background: rgba(255, 255, 255, 0.05);
      position: relative;
      z-index: 1;
      flex-grow: 1; 
      overflow-y: auto;
      overflow-x: hidden;
      height: 0;
      display: flex; 
      flex-direction: column;
      width: 100%;
      max-width: 100vw;
  }
  
  .admin-header {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      padding: 20px 0;
      position: sticky;
      top: 0;
      z-index: 100;
      position: sticky;
  }
  
  .header-content {
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding: 0 13px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      white-space: nowrap;
      box-sizing: border-box;
  }

  .header-content > * {
      flex-shrink: 1;
      min-width: 0;
  }

  .header-content h1 {
      color: var(--text-light);
      font-family: var(--font-script);
      font-size: 2em;
      font-weight: 600;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  
  .header-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      position: relative;
      margin-left: auto; /* Push to the right */
  }
  
  /* Header hamburger menu and dropdown styles */
.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 20px;
  cursor: pointer;
  padding: 0;
  border: none;
  background: transparent;
  transition: transform 0.3s ease;
}

.hamburger-menu:hover {
  transform: scale(1.1);
}

.hamburger-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-light);
  transition: transform 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: #1e2a4a;
  border: 2px solid #3a4a6b;
  border-radius: 12px;
  padding: 12px 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  display: none; /* Use display instead of opacity/visibility */
  z-index: 1000;
}

.dropdown.active .dropdown-menu {
  display: block;
  animation: dropdownFade 0.2s ease forwards;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-light);
  text-decoration: none;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: #3a4a6b; /* Solid hover background instead of semi-transparent */
}

.dropdown-item i {
  font-size: 16px;
  color: var(--accent-gold);
}
  
  /* Additional dropdown styles - removed duplicate definition */
  
  .dropdown-item {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 12px 16px;
      border: none;
      background: none;
      color: #ffffff;
      font-size: 14px;
      font-weight: 500;
      text-align: left;
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.2s ease;
  }
  
  .dropdown-item:hover {
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
      color: #ffffff;
      transform: translateX(2px);
  }
  
  .dropdown-item.danger {
      color: #ff6b6b;
  }
  
  .dropdown-item.danger:hover {
      background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 77, 77, 0.1));
      color: #ff4444;
  }
  
  .dropdown-item .icon {
      font-size: 16px;
      opacity: 1;
      min-width: 20px;
      text-align: center;
  }
  
  .dropdown-item .text {
      flex-grow: 1;
      font-weight: 500;
  }
  
  .dropdown-divider {
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
      margin: 8px 12px;
  }
  
  /* Statistics Cards */
  .stats-container {
      display: flex;
      justify-content: space-between;
      gap: 1vw;
      width: calc(100% - 26px);  /* Account for margins */
      margin: 30px 13px;
      padding: 0;
      flex-wrap: nowrap !important;
      min-width: 0;
      overflow: hidden; /* Prevent horizontal scroll */
  }
  
  .stat-card {
      position: relative;
      background: rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 1vw;  /* Always relative to viewport */
      padding: 1vw;  /* Always relative to viewport */
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      overflow: hidden;
      flex: 1 1 0;  /* Equal flex with no minimum */
      min-width: 0;  /* Allow shrinking below content size */
      width: 0;  /* Force equal distribution */
  }
  
  .stat-card:hover {
      transform: translateY(-5px);
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(212, 175, 55, 0.3);
      box-shadow: 
          0 15px 45px rgba(0, 0, 0, 0.2),
          0 0 30px rgba(212, 175, 55, 0.2);
  }
  
  .stat-card-inner {
      position: relative;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 0.5vw;
      min-width: 0;  /* Allow content to shrink */
  }
  
  /* Icons removed for cleaner design */
  
  .stat-content {
      flex-grow: 1;
      min-width: 0;
  }
  
  .stat-number {
      font-size: 2vw;  /* Always relative to viewport */
      font-weight: 700;
      color: var(--text-light);
      margin-bottom: clamp(2px, 0.5vw, 5px);
      background: linear-gradient(to right, #ffffff, #d4af37);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }
  
  .stat-label {
      color: var(--text-muted);
      font-size: 1vw;  /* Always relative to viewport */
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: clamp(0.2px, 0.05vw, 0.5px);
      opacity: 0.9;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }
  
  .stat-card-background {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: 
          radial-gradient(circle at clamp(5%, 10%, 15%) clamp(5%, 10%, 15%), rgba(255, 255, 255, 0.1), transparent clamp(30%, 50%, 60%)),
          radial-gradient(circle at clamp(85%, 90%, 95%) clamp(85%, 90%, 95%), rgba(212, 175, 55, 0.1), transparent clamp(30%, 50%, 60%));
      opacity: 0;
      transition: opacity 0.4s ease;
      transform: scale(1);  /* Ensures the background scales with card size */
  }
  
  .stat-card:hover .stat-card-background {
      opacity: 1;
  }
  
  /* Table Container */
  .table-container {
      width: calc(100% - 26px); /* Account for margins */
      box-sizing: border-box;
      margin: 0 13px 30px 13px;
      padding: 0;
      flex-grow: 1; 
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow-x: hidden;
  }

  .table-wrapper {
      width: 100%;
      min-width: 0;  /* Allow shrinking */
      overflow-x: auto;  /* Enable horizontal scrolling if needed */
  }
  
  .table-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
  }
  
  .table-header h2 {
      color: var(--text-light);
      font-size: 1.5em;
      font-family: var(--font-body);
      font-weight: 500;
  }
  
  .search-input {
      padding: 12px 16px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-radius: 25px;
      font-size: 14px;
      width: 250px;
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-light);
      backdrop-filter: blur(10px);
      transition: all 0.3s ease;
      font-family: var(--font-body);
  }
  
  .search-input::placeholder {
      color: rgba(255, 255, 255, 0.6);
  }
  
  .search-input:focus {
      outline: none;
      border-color: var(--accent-gold);
      background: rgba(255, 255, 255, 0.15);
      box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
  }
  
  .table-wrapper {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 20px;
      overflow: hidden; /* Changed to hidden to prevent scroll appearance affecting rounded corners */
      flex-grow: 1;
      box-shadow: var(--shadow-soft);
      max-width: 100%;
      box-sizing: border-box;
      padding: 0;
      position: relative;
  }

  .table-wrapper::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: 20px; /* Width of the curved edge */
      background: inherit;
      border-top-right-radius: 20px;
      border-bottom-right-radius: 20px;
      pointer-events: none;
  }

  .table-scroll {
      width: 100%;
      overflow-x: auto;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-right: 0;
      margin-right: 0;
      max-height: calc(100vh - 250px);
      background: transparent;
  }
  
  .uploads-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 1200px; /* Ensure table has minimum width to trigger scrolling */
      background: transparent;
  }
   .uploads-table th,
  .uploads-table td {
      padding: 15px;
      text-align: left;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      white-space: nowrap; /* Prevent text wrapping in table cells by default */
  }

  /* Override nowrap for message column */
  .uploads-table td.message-cell {
      white-space: normal;
      min-width: 200px;
      max-width: 300px;
  }

  .uploads-table th {
      background: var(--primary-dark);
      font-weight: 600;
      position: sticky;
      top: 0;
      z-index: 10;
      color: var(--text-light);
      font-family: var(--font-body);
  }
  
  .uploads-table td {
      color: var(--text-muted);
  }
  
  .uploads-table tr:hover {
      background: rgba(255, 255, 255, 0.05);
  }
   .message-text {
      font-style: italic;
      color: var(--text-muted);
  }
  
  .no-message {
      color: rgba(255, 255, 255, 0.5);
      font-style: italic;
  }
  
  /* Buttons */
  .btn {
      padding: 12px 20px;
      border: none;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      font-family: var(--font-body);
      cursor: pointer;
      transition: all 0.3s ease;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
  }
  
  .btn-primary {
      background: var(--gradient-button);
      color: var(--primary-dark);
      box-shadow: var(--shadow-glow);
  }
  
  .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
      background: linear-gradient(45deg, #f0c14b 0%, #c9b037 100%);
  }
  
  .btn-secondary {
      background: rgba(255, 255, 255, 0.2);
      color: var(--text-light);
      border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.3);
      transform: translateY(-2px);
  }
  
  .btn-danger {
      background: linear-gradient(45deg, #e74c3c, #c0392b);
      color: white;
  }
  
  .btn-danger:hover {
      background: linear-gradient(45deg, #c0392b, #a93226);
      transform: translateY(-2px);
  }
  
  .btn-logout {
      background: linear-gradient(45deg, #8e44ad, #7d3c98);
      color: white;
  }
  
  .btn-logout:hover {
      background: linear-gradient(45deg, #7d3c98, #6c3483);
      transform: translateY(-2px);
  }
  
  .btn-small {
      padding: 8px 12px;
      font-size: 12px;
  }
  
  .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
  }
   /* Action Buttons */
  .action-buttons {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap; /* Allow buttons to wrap on small screens */
  }

  /* Modal Styles */
  .modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(5px);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
  }
  
  .modal-content {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 20px;
      max-width: 90vw;
      max-height: 90vh;
      overflow: hidden;
      box-shadow: var(--shadow-soft);
  }
  
  .modal-header {
      padding: 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255, 255, 255, 0.05);
  }
  
  .modal-header h2 {
      color: var(--text-light);
      margin: 0;
      font-family: var(--font-body);
      font-weight: 500;
  }
  
  .close-btn {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: var(--text-muted);
      padding: 0;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: all 0.2s ease;
  }
  
  .close-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      color: var(--text-light);
  }
  
  .modal-body {
      padding: 20px;
      max-height: 70vh;
      overflow-y: auto;
  }
  
  .confirm-modal .modal-content {
      max-width: 400px;
  }
  
  .confirm-actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 20px;
  }
  
  /* Delete All Modal Specific Styles */
  .warning-box {
      background: rgba(231, 76, 60, 0.1);
      border: 2px solid rgba(231, 76, 60, 0.3);
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 20px;
  }
  
  .warning-box p {
      color: var(--text-light);
      margin-bottom: 10px;
      font-weight: 500;
  }
  
  .warning-box p:last-child {
      margin-bottom: 0;
      color: #ff6b6b;
      font-weight: 600;
  }
  
  /* Settings Modal Styles */
  .settings-modal-content {
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .settings-modal-content .modal-body {
    overflow-y: auto;
    padding: 0;
  }

  /* Settings Tabs */
  .settings-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px 12px 0 0;
    padding: 4px;
    margin: 0 20px 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
  }

  .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
  }

  .tab-btn.active {
    background: var(--gradient-accent);
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: var(--shadow-glow);
  }

  /* Tab Content */
  .tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
  }

  .tab-content.active {
    display: block;
  }

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

  /* Settings Grid Layout */
  .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    max-width: 100%;
  }

  /* Settings Cards */
  .settings-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
  }

  .settings-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }

  .card-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .card-header h3 {
    color: var(--text-light);
    margin: 0 0 4px 0;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.1em;
  }

  .card-subtitle {
    color: var(--text-muted);
    font-size: 0.85em;
    opacity: 0.8;
  }

  .card-body {
    padding: 20px;
  }

  /* Input Groups */
  .input-group {
    margin-bottom: 20px;
  }

  .input-group:last-child {
    margin-bottom: 0;
  }

  .input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9em;
  }

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

  .label-unit {
    color: var(--accent-gold);
    font-size: 0.8em;
    font-weight: 400;
  }

  .input-help {
    display: block;
    color: var(--text-muted);
    font-size: 0.8em;
    margin-top: 6px;
    opacity: 0.7;
    line-height: 1.3;
  }

  /* Toggle Groups for Checkboxes */
  .toggle-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .toggle-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
  }

  .toggle-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
  }

  .toggle-label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    margin: 0;
  }

  .toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    transition: background 0.3s ease;
    flex-shrink: 0;
  }

  .toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .toggle-label input[type="checkbox"] {
    display: none;
  }

  .toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--accent-gold);
  }

  .toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
  }

  .toggle-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .toggle-title {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95em;
  }

  .toggle-description {
    color: var(--text-muted);
    font-size: 0.8em;
    opacity: 0.8;
    line-height: 1.3;
  }

  /* Rate Limiting Specific Layouts */
  .rate-limit-card {
    opacity: 0.6;
    transition: opacity 0.3s ease;
  }

  .rate-limit-card.enabled {
    opacity: 1;
  }

  .rate-limit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .rate-limit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
  }

  .password-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* Enhanced Form Controls */
  .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.9em;
    transition: all 0.3s ease;
    width: 100%;
  }

  .form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  }

  .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
  }

  /* Enhanced Action Buttons */
  .settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin: 20px 20px 20px 20px; /* Added bottom margin for breathing room */
    padding: 20px 0 10px 0; /* Added bottom padding */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .settings-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
  }

  .btn-icon {
    font-size: 1em;
  }

  .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
  }

  .btn-primary {
    background: var(--gradient-accent);
    color: var(--primary-dark);
    border: none;
    box-shadow: var(--shadow-glow);
  }

  .btn-primary:hover {
    background: var(--gradient-button);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
  }

  .btn-primary:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
  }

  /* Responsive Design */
  @media (max-width: 768px) {
    .settings-modal-content {
      max-width: 95vw;
      max-height: 90vh;
    }

    .settings-grid {
      grid-template-columns: 1fr;
      gap: 16px;
    }

    .settings-tabs {
      margin: 0 10px;
    }

    .tab-content {
      padding: 16px;
    }

    .tab-btn {
      padding: 10px 8px;
      font-size: 0.8em;
    }

    .rate-limit-row,
    .password-row {
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .rate-limit-grid {
      grid-template-columns: 1fr;
    }

    .settings-actions {
      margin: 16px 10px 20px 10px; /* Added bottom margin for mobile */
      flex-direction: column-reverse;
    }

    .settings-actions .btn {
      width: 100%;
    }
  }

  /* Legacy settings styles - kept for compatibility */
  .settings-section {
      margin-bottom: 30px;
      padding-bottom: 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .settings-section:last-child {
      border-bottom: none;
      margin-bottom: 0;
  }
  
  .settings-section h3 {
      color: var(--text-light);
      margin-bottom: 15px;
      font-family: var(--font-body);
      font-weight: 500;
      font-size: 1.2em;
  }
  
  .settings-section h4 {
      color: var(--text-muted);
      margin: 20px 0 15px 0;
      font-family: var(--font-body);
      font-weight: 400;
      font-size: 1em;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      padding-top: 15px;
  }
  
  .form-row {
      display: flex;
      gap: 15px;
  }
  
  .form-row .form-group {
      flex: 1;
  }
  
  .form-group small {
      display: block;
      color: var(--text-muted);
      font-size: 0.85em;
      margin-top: 5px;
      opacity: 0.8;
  }
  
  .form-group label input[type="checkbox"] {
      width: auto;
      margin-right: 8px;
      transform: scale(1.2);
  }
  
  /* Settings Info Icons and Tooltips */
  .form-label-with-info {
      display: flex;
      align-items: center;
      gap: 8px;
  }
  
  .info-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: rgba(212, 175, 55, 0.2);
      border: 1px solid var(--accent-gold);
      color: var(--accent-gold);
      font-size: 12px;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.3s ease;
      position: relative;
  }
  
  .info-icon:hover {
      background: var(--accent-gold);
      color: var(--primary-dark);
      transform: scale(1.1);
  }
  
  .tooltip {
      position: absolute;
      bottom: 25px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--primary-dark);
      border: 1px solid var(--accent-gold);
      border-radius: 8px;
      padding: 12px 16px;
      color: var(--text-light);
      font-size: 13px;
      line-height: 1.4;
      white-space: nowrap;
      max-width: 300px;
      white-space: normal;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
  }
  
  .tooltip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 6px solid transparent;
      border-top-color: var(--accent-gold);
  }
  
  .info-icon:hover .tooltip {
      opacity: 1;
      visibility: visible;
  }
  
  /* Responsive tooltip positioning */
  @media (max-width: 768px) {
      .tooltip {
          max-width: 250px;
          font-size: 12px;
          padding: 10px 12px;
      }
  }
  
  /* Upload Info */
  .upload-info {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      padding: 20px;
      border-radius: 15px;
      margin-bottom: 20px;
  }
  
  .upload-info h3 {
      color: var(--text-light);
      margin-bottom: 10px;
      font-family: var(--font-body);
      font-weight: 500;
  }
  
  .upload-info p {
      color: var(--text-muted);
      margin-bottom: 5px;
  }
  
  /* Files Grid */
  .files-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 20px;
      padding: 20px;
  }
  
  .file-item {
      position: relative;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      overflow: hidden;
      transition: transform 0.3s ease;
      cursor: pointer;
  }
  
  .file-item:hover {
      transform: scale(1.02);
  }
  
  .file-item img,
  .file-item video {
      width: 100%;
      height: 200px;
      object-fit: cover;
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.2);
  }
  
  .video-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      transition: background-color 0.3s ease;
  }
  
  .file-item:hover .video-overlay {
      background: rgba(0, 0, 0, 0.5);
  }
  
  .play-icon {
      color: white;
      font-size: 24px;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
      transform: scale(1);
      transition: transform 0.3s ease;
  }
  
  .file-item:hover .play-icon {
      transform: scale(1.2);
  }
  
  /* Lightbox Modal Styles */
  .lightbox-modal {
      background: rgba(0, 0, 0, 0.95);
      backdrop-filter: blur(10px);
  }
  
  .lightbox-content {
      position: relative;
      max-width: 90vw;
      max-height: 90vh;
      margin: auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: none;
      box-shadow: none;
  }
  
  .lightbox-media {
      max-width: 90vw;
      max-height: 85vh;
      object-fit: contain;
      border-radius: 4px;
      margin: 0 auto;
  }
  
  .lightbox-nav {
      position: absolute;
      width: 100%;
      display: flex;
      justify-content: space-between;
      padding: 0 20px;
      top: 50%;
      transform: translateY(-50%);
      pointer-events: none;
  }
  
  .nav-button {
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: white;
      padding: 15px 20px;
      font-size: 24px;
      border-radius: 50%;
      cursor: pointer;
      transition: all 0.3s ease;
      pointer-events: auto;
  }
  
  .nav-button:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.1);
  }
  
  #closeLightbox {
      position: absolute;
      top: 15px;
      right: 15px;
      z-index: 1000;
      background: rgba(255, 255, 255, 0.1);
      color: white;
      border: none;
      width: 40px;
      height: 40px;
      font-size: 24px;
      border-radius: 50%;
      cursor: pointer;
      transition: all 0.3s ease;
  }
  
  #closeLightbox:hover {
      background: rgba(255, 255, 255, 0.2);
      transform: scale(1.1);
  }
  
  /* Empty State */
  .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--text-muted);
  }
  
  .empty-icon {
      font-size: 4em;
      margin-bottom: 20px;
      opacity: 0.5;
  }
  
  .empty-state h3 {
      margin-bottom: 10px;
      color: var(--text-light);
  }
  
  /* Loading Spinner */
  .loading-spinner {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 40px;
  }
  
  .spinner {
      width: 40px;
      height: 40px;
      border: 4px solid rgba(255, 255, 255, 0.3);
      border-top: 4px solid var(--accent-gold);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 15px;
  }
  
  @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
  }
  
  /* Toast Notifications */
  .toast-container {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 2000;
  }
  
  .toast {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 10px;
      padding: 15px 20px;
      margin-bottom: 10px;
      box-shadow: var(--shadow-soft);
      border-left: 4px solid var(--accent-gold);
      animation: slideIn 0.3s ease;
      max-width: 300px;
      color: var(--text-light);
  }
  
  .toast.success {
      border-left-color: #2ecc71;
  }
  
  .toast.error {
      border-left-color: #e74c3c;
  }
  
  .toast.warning {
      border-left-color: #f39c12;
  }
  
  @keyframes slideIn {
      from {
          transform: translateX(100%);
          opacity: 0;
      }
      to {
          transform: translateX(0);
          opacity: 1;
      }
  }
  
  /* Error Message */
  .error-message {
      background: linear-gradient(45deg, #e74c3c, #c0392b);
      color: white;
      padding: 15px 16px;
      border-radius: 10px;
      margin-top: 15px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: var(--shadow-soft);
  }
  
  /* Live Updates Animations */
@keyframes slideInFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uploads-table tr {
    transition: all 0.3s ease-out;
}

.uploads-table tr.new-upload {
    animation: slideInFadeIn 0.3s ease-out;
}

/* Toast animations for live updates */
.toast.info {
    border-left-color: #3498db;
    animation: slideInFadeIn 0.3s ease-out, fadeOut 0.3s ease-out 4.7s forwards;
}

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

/* Responsive Design */
  @media (max-width: 768px) {
      .header-content {
          flex-direction: column;
          gap: 15px;
          text-align: center;
      }
      
      .header-actions {
          justify-content: center;
          flex-wrap: wrap;
      }
      
      .table-header {
          flex-direction: column;
          gap: 15px;
          align-items: stretch;
      }
      
      .search-input {
          width: 100%;
      }
      
      .uploads-table {
          font-size: 14px;
      }
      
      .uploads-table th,
      .uploads-table td {
          padding: 10px 8px;
      }
      
      .action-buttons {
          flex-direction: column;
          gap: 5px;
      }
      
      .modal-content {
          margin: 20px;
          max-width: calc(100vw - 40px);
      }
      
      .files-grid {
          grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
          gap: 15px;
      }
      
      .form-row {
          flex-direction: column;
          gap: 0;
      }
      
      .settings-actions {
          flex-direction: column;
      }
      
      /* Improve table scrolling on mobile */
      .table-wrapper {
          border-radius: 15px;
          /* Add scroll indicator */
          background: 
              /* Shadow covers */
              linear-gradient(90deg, rgba(255,255,255,0.1) 30%, rgba(255,255,255,0)) left,
              linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.1) 70%) right;
          background-repeat: no-repeat;
          background-size: 20px 100%, 20px 100%;
          background-attachment: local, local;
      }
  }
  
  @media (max-width: 480px) {
      .login-card {
          padding: 30px 20px;
          margin: 20px;
      }
      
      .stat-card {
          padding: 20px 15px;
      }
      
      .stat-icon {
          width: 50px;
          height: 50px;
          font-size: 1.8em;
      }
      
      .stat-number {
          font-size: 1.5em;
      }
  
      .wedding-icon img {
          width: 50px;
          height: 50px;
      }
  
      .login-header h1 {
          font-size: 2em;
      }
      
      /* Further optimize table for very small screens */
      .uploads-table {
          min-width: 600px; /* Reduce minimum width for very small screens */
      }
      
      .uploads-table th,
      .uploads-table td {
          padding: 8px 6px;
          font-size: 12px;
      }
      
      .btn-small {
          padding: 6px 8px;
          font-size: 10px;
      }
  }
  
  /* Animation for page load */
  .login-card, .admin-container {
      animation: fadeInUp 0.8s ease-out;
  }
  
  /* Animation for page load */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }