/* Modern Dark Theme with Animations */
:root {
  --primary: #6c5ce7;
  --primary-hover: #7d6cf3;
  --secondary: #2ecc71;
  --dark-bg: #131419;
  --card-bg: #1e1f26;
  --light-text: #f5f6fa;
  --muted-text: #8a8d98;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(30, 31, 38, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* Smooth scrolling and base styles */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--dark-bg);
  color: var(--light-text);
  font-family: 'Poppins', 'Arial', sans-serif;
  overflow-x: hidden;
  transition: all 0.3s ease;
  position: relative;
  min-height: 100vh;
}

/* Background particles */
body::before {
  content: '';
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%232A2F45' stroke-width='1'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63'/%3E%3Cpath d='M-31 229L237 261 390 382 603 493 308.5 537.5 101.5 381.5M370 905L295 764'/%3E%3Cpath d='M520 660L578 842 731 737 840 599 603 493 520 660 295 764 309 538 390 382 539 269 769 229 577.5 41.5 370 105 295 -36 126.5 79.5 237 261 102 382 40 599 -69 737 127 880'/%3E%3Cpath d='M520-140L578.5 42.5 731-63M603 493L539 269 237 261 370 105M902 382L539 269M390 382L102 382'/%3E%3Cpath d='M-222 42L126.5 79.5 370 105 539 269 577.5 41.5 927 80 769 229 902 382 603 493 731 737M295-36L577.5 41.5M578 842L295 764M40-201L127 80M102 382L-261 269'/%3E%3C/g%3E%3Cg fill='%233F4971'%3E%3Ccircle cx='769' cy='229' r='5'/%3E%3Ccircle cx='539' cy='269' r='5'/%3E%3Ccircle cx='603' cy='493' r='5'/%3E%3Ccircle cx='731' cy='737' r='5'/%3E%3Ccircle cx='520' cy='660' r='5'/%3E%3Ccircle cx='309' cy='538' r='5'/%3E%3Ccircle cx='295' cy='764' r='5'/%3E%3Ccircle cx='40' cy='599' r='5'/%3E%3Ccircle cx='102' cy='382' r='5'/%3E%3Ccircle cx='127' cy='80' r='5'/%3E%3Ccircle cx='370' cy='105' r='5'/%3E%3Ccircle cx='578' cy='42' r='5'/%3E%3Ccircle cx='237' cy='261' r='5'/%3E%3Ccircle cx='390' cy='382' r='5'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.4;
  z-index: -1;
}

/* Navbar styling */
.navbar {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background-color: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  padding: 15px 0;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.6rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px rgba(108, 92, 231, 0.5);
  }
  100% {
    text-shadow: 0 0 20px rgba(108, 92, 231, 0.8);
  }
}

/* Container */
.container {
  max-width: 1000px;
  padding: 0 20px;
}

/* Main card */
.card {
  background-color: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  animation: fadeIn 0.6s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

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

/* Form elements */
.form-control {
  background-color: rgba(30, 31, 38, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--light-text);
  padding: 12px 15px;
  transition: all 0.3s ease;
}

.form-control:focus {
  background-color: rgba(30, 31, 38, 0.7);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
  color: var(--light-text);
}

.form-label {
  color: var(--light-text);
  font-weight: 500;
  margin-bottom: 8px;
}

.form-text {
  color: var(--muted-text);
}

small a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

small a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Button styling */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 12px 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    transform: scale(40, 40);
    opacity: 0;
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border: none;
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7d6cf3, #6366f1);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary), #38d39f);
  border: none;
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.btn-success:hover {
  background: linear-gradient(135deg, #38e47d, #38d39f);
  box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5);
  transform: translateY(-2px);
}

.btn-success:disabled {
  background: linear-gradient(135deg, #6c9687, #6c9680);
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

/* Cosmetics gallery */
.cosmetics-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 15px;
  margin-top: 20px;
  perspective: 1000px;
}

.cosmetic-item {
  position: relative;
  aspect-ratio: 1/1;
  background-color: rgba(30, 31, 38, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  animation: fadeInGrid 0.5s ease backwards;
}

.cosmetic-item:nth-child(3n+1) { animation-delay: 0.1s; }
.cosmetic-item:nth-child(3n+2) { animation-delay: 0.2s; }
.cosmetic-item:nth-child(3n+3) { animation-delay: 0.3s; }

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

.cosmetic-item:hover {
  transform: scale(1.08) translateZ(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.cosmetic-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cosmetic-item:hover::before {
  opacity: 1;
}

.cosmetic-item img {
  width: 100%;
  height: calc(100% - 25px);
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  transition: transform 0.3s ease;
}

.cosmetic-item:hover img {
  transform: scale(1.05);
}

.cosmetic-item p {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 5px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.3s ease;
}

.cosmetic-item:hover p {
  background-color: rgba(108, 92, 231, 0.7);
}

.more-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px dashed rgba(108, 92, 231, 0.3);
}

.more-count {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

/* Stats container */
.stats-container {
  display: flex;
  justify-content: space-evenly;
  margin: 20px 0;
  padding: 20px 15px;
  background-color: var(--glass-bg);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  flex-wrap: wrap;
  gap: 15px;
  animation: fadeIn 0.8s ease;
}

.stats-item {
  text-align: center;
  min-width: 100px;
  transition: transform 0.3s ease;
}

.stats-item:hover {
  transform: translateY(-5px);
}

.stats-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
  text-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
  background: linear-gradient(135deg, var(--primary), #a55eea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-label {
  font-size: 0.85rem;
  color: var(--light-text);
  font-weight: 500;
}

/* Preview section */
.preview-container {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-container h5 {
  margin-bottom: 20px;
  text-align: center;
  color: var(--light-text);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Tabs styling */
.nav-tabs {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 5px;
}

.nav-tabs .nav-link {
  margin-bottom: -1px;
  border: 1px solid transparent;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  color: var(--muted-text);
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 10px 20px;
}

.nav-tabs .nav-link:hover:not(.active) {
  border-color: transparent;
  color: var(--light-text);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  background-color: rgba(108, 92, 231, 0.1);
  border-color: rgba(108, 92, 231, 0.3);
  border-bottom-color: transparent;
  font-weight: 600;
}

/* Checkbox Hierarchy Styles */
.sub-checkbox {
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

.sub-checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sub-checkbox:disabled + label {
  opacity: 0.5;
  cursor: not-allowed;
}

#post-in-site + label {
  font-weight: 600;
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 8px;
  margin-left: -8px;
}

.ms-4 .form-check {
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(108, 92, 231, 0.2);
  margin-left: 8px;
  transition: all 0.3s ease;
}

.ms-4 .form-check:hover {
  border-left-color: rgba(108, 92, 231, 0.5);
  background: linear-gradient(90deg, rgba(108, 92, 231, 0.05) 0%, transparent 100%);
}

/* Footer */
footer {
  position: relative;
  margin-top: 60px;
  padding: 20px 0;
  background-color: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

/* Animations for empty state */
.alert-secondary {
  background-color: rgba(108, 92, 231, 0.05);
  border-color: rgba(108, 92, 231, 0.1);
  color: var(--muted-text);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* Responsive styles */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.4rem;
  }
  
  .stats-item {
    min-width: 80px;
    margin-bottom: 10px;
  }
  
  .stats-value {
    font-size: 1.5rem;
  }
  
  .nav-tabs .nav-link {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
  
  .cosmetics-gallery {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

@media (max-width: 576px) {
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .nav-tabs::-webkit-scrollbar {
    height: 3px;
  }
  
  .nav-tabs::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
  }
  
  .cosmetic-item p {
    font-size: 0.65rem;
  }
}

/* 3D Animation for cards */
.download-btn {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.download-btn:hover:not(:disabled) {
  transform: rotateX(10deg) translateY(-5px);
}

/* Loading animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Easter egg hover effects for certain elements */
.navbar-brand:hover {
  animation: rubberBand 1s;
}

@keyframes rubberBand {
  from { transform: scale3d(1, 1, 1); }
  30% { transform: scale3d(1.25, 0.75, 1); }
  40% { transform: scale3d(0.75, 1.25, 1); }
  50% { transform: scale3d(1.15, 0.85, 1); }
  65% { transform: scale3d(0.95, 1.05, 1); }
  75% { transform: scale3d(1.05, 0.95, 1); }
  to { transform: scale3d(1, 1, 1); }
}

/* Custom Device Authentication Modal Styles */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(19, 20, 25, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.custom-modal-dialog {
  position: relative;
  z-index: 10000;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.custom-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  position: relative;
}

.custom-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  padding: 20px 25px;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.custom-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.custom-modal-body {
  padding: 30px 25px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-step-container {
  width: 100%;
  max-width: 400px;
}

.auth-info-card,
.auth-success-card,
.auth-error-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 25px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-icon,
.success-icon,
.error-icon {
  font-size: 2.5rem;
  opacity: 0.9;
}

.user-code-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid var(--glass-border);
}

.user-code {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
  letter-spacing: 3px;
  padding: 10px;
  background: rgba(108, 92, 231, 0.1);
  border-radius: 8px;
  border: 2px solid var(--primary);
  margin: 8px 0;
  text-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  transition: all 0.3s ease;
}

.user-code:hover {
  background: rgba(108, 92, 231, 0.2);
  box-shadow: 0 0 15px rgba(108, 92, 231, 0.4);
  transform: scale(1.02);
}

.auth-steps {
  text-align: left;
}

.step-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  opacity: 0.9;
}

.step-number {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  margin-right: 12px;
  flex-shrink: 0;
}

.step-text {
  color: var(--light-text);
  font-size: 0.9rem;
}

.epic-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
  position: relative;
  overflow: hidden;
}

.epic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.epic-btn:active {
  transform: translateY(0);
}

.epic-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.epic-btn:hover::before {
  left: 100%;
}

.waiting-indicator {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fade in animation for modal steps */
.auth-step-container {
  animation: fadeInUp 0.5s ease-out;
}

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

/* Pulse animation for waiting states */
.waiting-indicator .spinner-border {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Ensure all interactive elements work properly */
.custom-modal button {
  cursor: pointer;
  user-select: none;
}

.custom-modal * {
  user-select: text;
}

.custom-modal button,
.custom-modal .step-number {
  user-select: none;
}
