/* Enhanced Modern Server Dashboard - Elegant Dark Theme */
:root {
  --primary: #9D6B63;
  --primary-light: #B58B83;
  --primary-dark: #7A4F48;
  --secondary: #E0B8AC;
  --dark: #2D2226;
  --darker: #22181C;
  --light: #F8F3EB;
  --gray: #C5B6B6;
  --success: #9DB89D;
  --error: #E0B8AC;
  --accent: #E0C8B8;
  --glow: rgba(157, 107, 99, 0.4);
}

.server-dashboard {
  min-height: 100vh;
  padding: 6rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--light);
  isolation: isolate;
}



@keyframes gradientFlow {
  0% { 
    transform: rotate(0deg) scale(1); 
    opacity: 0.8;
  }
  50% { 
    transform: rotate(180deg) scale(1.3);
    opacity: 1;
  }
  100% { 
    transform: rotate(360deg) scale(1); 
    opacity: 0.8;
  }
}

.server-header {
  text-align: center;
  margin-bottom: 15px;
  max-width: 900px;
  position: relative;
  z-index: 2;
}

.server-header h2 {
  color: var(--light);
  font-size: 4rem;
  margin-bottom: 1.8rem;
  margin-top: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, var(--light) 0%, var(--primary-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
  text-shadow: 0 4px 15px rgba(157, 107, 99, 0.4);
  animation: textGlow 6s ease-in-out infinite alternate;
}

.server-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem auto;
  padding: 0 1rem;
  max-width: 1200px;
}

.category-btn {
  font-size: 1.1rem;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(145deg, #3a2e31, #2e2527);
  color: #ffddb0;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.category-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #ffd36933, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.category-btn:hover::before {
  opacity: 1;
}

.category-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, #483536, #2e2527);
}

.category-btn.active {
  background: linear-gradient(145deg, #b8735b, #9a5442);
  color: #fff;
  box-shadow:
    0 6px 20px rgba(186, 100, 70, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}


@keyframes textGlow {
  0% { text-shadow: 0 4px 15px rgba(157, 107, 99, 0.4); }
  50% { text-shadow: 0 6px 25px rgba(157, 107, 99, 0.7); }
  100% { text-shadow: 0 4px 15px rgba(224, 200, 184, 0.5); }
}

.server-header h2::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 38%;
  transform: translateX(-50%);
  width: 140px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  filter: drop-shadow(0 0 16px var(--glow));
  animation: pulse 3.5s ease infinite;
}

.server-header p {
  color: var(--gray);
  font-size: 1.4rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 400;
  position: relative;
  animation: fadeIn 1.5s ease-out;
}

.server-gallery {
  display: flex;
  justify-content: center;     /* horizontal centering */
  align-items: flex-start;     /* ✅ align to top instead of middle */
  flex-wrap: wrap;
  gap: 3rem;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  min-height: 480px;
  padding: 2rem 0;
}




.server-card {
  position: relative;
  width: 360px;                    
  flex: 0 1 360px;                 
  height: 460px;
  border-radius: 32px;
  overflow: hidden;
  background: rgba(45, 34, 38, 0.6);
  border: 1px solid rgba(157, 107, 99, 0.4);
  box-shadow: 
    0 16px 50px rgba(34, 24, 28, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-style: preserve-3d;
  perspective: 1000px;
  transform: translateY(0) rotateX(0);
  will-change: transform, box-shadow;
  opacity: 0;
  animation: cardEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--order) * 0.15s);
}


.server-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(157, 107, 99, 0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: -1;
}

.server-card:hover {
  transform: translateY(-16px) rotateX(8deg) scale(1.04);
  box-shadow: 
    0 24px 60px rgba(34, 24, 28, 0.8),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-color: rgba(224, 184, 172, 0.5);
}

.server-card:hover::before {
  opacity: 1;
  transform: scale(1.08);
}

.server-illustration {
  height: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.server-illustration::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, rgba(45, 34, 38, 0.95) 0%, transparent 100%);
  transition: height 0.6s ease;
}

.server-card:hover .server-illustration {
  transform: scale(1.1);
}

.server-card:hover .server-illustration::after {
  height: 120px;
}

.server-details {
  padding: 2.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to top, rgba(34, 24, 28, 0.85) 0%, transparent 100%);
}

.server-details h3 {
  color: var(--light);
  font-size: 1.8rem;
  margin: 0 0 1.4rem 0;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.server-details h3::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 4px;
  background: var(--primary);
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left;
}

.server-card:hover .server-details h3::after {
  width: 80px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.server-meta {
  display: flex;
  gap: 1.4rem;
  margin-bottom: 1.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.server-status {
  font-size: 1rem;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.5s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.server-status.en-ligne {
  background: rgba(157, 184, 157, 0.25);
  color: #F0F8F0;
  border: 1px solid rgba(157, 184, 157, 0.5);
  box-shadow: 0 4px 12px rgba(157, 184, 157, 0.15);
}

.server-status.en-ligne::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 12px var(--success);
  animation: pulse 2s infinite;
}

.server-players {
  color: var(--gray);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.4s ease;
}

.server-card:hover .server-players {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(224, 200, 184, 0.3);
}

.server-players svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.4s ease;
}

.server-card:hover .server-players svg {
  transform: scale(1.3) rotate(10deg);
}

.server-description {
  color: var(--gray);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  flex-grow: 1;
  transition: color 0.4s ease;
}

.server-card:hover .server-description {
  color: var(--light);
}

.server-connect {
  margin-top: auto;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: white;
  padding: 1.2rem 2rem;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.1rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 6px 20px rgba(157, 107, 99, 0.4);
}

.server-connect::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
  opacity: 0;
  transition: all 0.6s ease;
  z-index: -1;
}

.server-connect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0) 35%,
    rgba(255,255,255,0.15) 45%,
    rgba(255,255,255,0) 55%,
    rgba(255,255,255,0) 100%
  );
  transform: translateX(-100%) rotate(30deg);
  transition: transform 0.8s ease;
}

.server-connect:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(157, 107, 99, 0.6);
  letter-spacing: 1.2px;
}

.server-connect:hover::before {
  opacity: 1;
}

.server-connect:hover::after {
  transform: translateX(100%) rotate(30deg);
}

.server-connect svg {
  width: 20px;
  height: 20px;
  transition: all 0.6s ease;
}

.server-connect:hover svg {
  transform: translateX(8px) scale(1.2);
}

/* Enhanced floating elements */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: float 20s ease-in-out infinite;
  will-change: transform;
  filter: blur(60px);
  opacity: 0.7;
}

.floating-shape:nth-child(1) {
  width: 500px;
  height: 500px;
  top: 10%;
  left: 5%;
  animation-delay: 0s;
  background: radial-gradient(circle, rgba(157, 107, 99, 0.15) 0%, transparent 70%);
}

.floating-shape:nth-child(2) {
  width: 400px;
  height: 400px;
  bottom: 15%;
  right: 10%;
  animation-delay: 5s;
  background: radial-gradient(circle, rgba(224, 184, 172, 0.15) 0%, transparent 70%);
}

.floating-shape:nth-child(3) {
  width: 300px;
  height: 300px;
  top: 60%;
  left: 20%;
  animation-delay: 10s;
  background: radial-gradient(circle, rgba(224, 200, 184, 0.15) 0%, transparent 70%);
}

@keyframes float {
  0%, 100% { 
    transform: translate(0, 0) rotate(0deg) scale(1); 
  }
  25% { 
    transform: translate(30px, -40px) rotate(8deg) scale(1.08);
  }
  50% { 
    transform: translate(-20px, 30px) rotate(-8deg) scale(0.95);
  }
  75% { 
    transform: translate(15px, 15px) rotate(5deg) scale(1.05);
  }
}

/* Particle background */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: rgba(224, 200, 184, 0.4);
  border-radius: 50%;
  pointer-events: none;
  animation: particle-float linear infinite;
  filter: blur(1px);
}

@keyframes particle-float {
  to {
    transform: translateY(-100vh);
  }
}

/* Card entrance animation */
@keyframes cardEntrance {
  from { 
    opacity: 0; 
    transform: translateY(80px) rotateX(-20deg) scale(0.9);
    filter: blur(8px);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) rotateX(0) scale(1);
    filter: blur(0);
  }
}

/* Glow effect for cards */
.server-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  border-radius: 32px;
  box-shadow: 0 0 60px rgba(157, 107, 99, 0);
  transition: box-shadow 0.8s ease;
  pointer-events: none;
}

.server-card:hover::after {
  box-shadow: 0 0 60px rgba(157, 107, 99, 0.6);
}

/* Responsive Design */
@media (max-width: 1600px) {
  .server-gallery {
    gap: 2.5rem;
  }
}

@media (max-width: 1400px) {
  .server-header h2 {
    font-size: 3.6rem;
  }
  
  .server-header p {
    font-size: 1.3rem;
  }
  
  .server-card {
    height: 440px;
  }
}

@media (max-width: 1200px) {
  .server-gallery {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  }
  
  .server-header h2 {
    font-size: 3.2rem;
  }
}

@media (max-width: 992px) {
  .server-header {
    margin-bottom: 5rem;
  }
  
  .server-header h2 {
    font-size: 2.8rem;
  }
  
  .server-header p {
    font-size: 1.2rem;
  }
  
  .server-dashboard {
    padding: 5rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .server-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .server-header h2 {
    font-size: 2.5rem;
  }
  
  .server-card {
    height: 420px;
    border-radius: 28px;
  }
}

@media (max-width: 576px) {
  .server-gallery {
    grid-template-columns: 1fr;
    max-width: 500px;
    gap: 1.8rem;
  }
  
  .server-header h2 {
    font-size: 2.2rem;
  }
  
  .server-header p {
    font-size: 1.1rem;
  }
  
  .server-dashboard {
    padding: 4rem 1rem;
  }
  
  .server-card {
    height: 400px;
    border-radius: 24px;
  }
}

/* Hover effects for touch devices */
@media (hover: none) {
  .server-card:hover {
    transform: none;
    box-shadow: 
      0 16px 50px rgba(34, 24, 28, 0.5),
      inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  }
  
  .server-card:hover .server-illustration {
    transform: none;
  }
  
  .server-connect:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(157, 107, 99, 0.4);
    letter-spacing: 0.8px;
  }
  
  .server-card:hover::after {
    box-shadow: none;
  }
}

/* Loading animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-card {
  position: relative;
  overflow: hidden;
}

.loading-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(45, 34, 38, 0) 0%,
    rgba(157, 107, 99, 0.1) 50%,
    rgba(45, 34, 38, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}


/* Add to your existing CSS */
.server-card.joined {
    border: 2px solid #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: slide-in 0.3s ease-out;
}

.toast-success {
    background-color: #4CAF50;
}

.toast-error {
    background-color: #f44336;
}

.toast-info {
    background-color: #2196F3;
}

.fade-out {
    animation: fade-out 0.5s ease-out forwards;
}

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

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}