/**
 * Minecraft Serverlist - MineRank Style
 * Modern, responsive design with Minecraft aesthetics
 */

:root {
  --mc-green: #55AA55;
  --mc-green-dark: #3d7a3d;
  --mc-green-light: #7ec47e;
  --mc-stone: #888888;
  --mc-dirt: #866043;
  --mc-gold: #FFAA00;
  --mc-red: #AA0000;
  --mc-blue: #5555FF;
  --mc-bg-primary: #1a1a1a;
  --mc-bg-secondary: #252525;
  --mc-bg-card: #2d2d2d;
  --mc-text: #FFFFFF;
  --mc-text-muted: #AAAAAA;
  --mc-border: #444444;
  --mc-shadow: rgba(0,0,0,0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--mc-bg-primary);
  color: var(--mc-text);
  line-height: 1.6;
  min-height: 100vh;
  background-image: 
    linear-gradient(rgba(26, 26, 26, 0.95), rgba(26, 26, 26, 0.95)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect fill='%23222' width='100' height='100'/%3E%3Crect fill='%232a2a2a' x='0' y='0' width='50' height='50'/%3E%3Crect fill='%232a2a2a' x='50' y='50' width='50' height='50'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: linear-gradient(180deg, #2d2d2d 0%, #1a1a1a 100%);
  border-bottom: 4px solid var(--mc-green);
  padding: 1rem 0;
  box-shadow: 0 4px 20px var(--mc-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--mc-green);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 2px 2px 0 #000;
}

.logo::before {
  content: "⛏️";
  font-size: 2rem;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  color: var(--mc-text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.nav a:hover, .nav a.active {
  color: var(--mc-green);
  background: rgba(85, 170, 85, 0.1);
}

.nav .btn-nav {
  background: var(--mc-green);
  color: #000 !important;
}

.nav .btn-nav:hover {
  background: var(--mc-green-light);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, rgba(85,170,85,0.1) 0%, transparent 100%);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--mc-text);
  text-shadow: 3px 3px 0 #000;
}

.hero p {
  font-size: 1.1rem;
  color: var(--mc-text-muted);
  max-width: 600px;
  margin: 0 auto 30px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.btn-primary {
  background: var(--mc-green);
  color: #000;
}

.btn-primary:hover {
  background: var(--mc-green-light);
}

.btn-secondary {
  background: var(--mc-stone);
  color: #fff;
}

.btn-secondary:hover {
  background: #666;
}

.btn-gold {
  background: var(--mc-gold);
  color: #000;
}

.btn-gold:hover {
  background: #ffcc00;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Server Grid */
.section {
  padding: 40px 20px;
}

.section-title {
  color: var(--mc-green);
  margin-bottom: 30px;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.server-card {
  background: var(--mc-bg-card);
  border: 2px solid var(--mc-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  position: relative;
}

.server-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--mc-green);
}

.server-card:hover {
  transform: translateY(-5px);
  border-color: var(--mc-green);
  box-shadow: 0 10px 30px rgba(85, 170, 85, 0.2);
}

.server-banner {
  height: 100px;
  background: linear-gradient(135deg, #3d3d3d 0%, #2d2d2d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
}

.server-status {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mc-red);
  border: 2px solid #fff;
  box-shadow: 0 0 10px currentColor;
}

.server-status.online {
  background: var(--mc-green);
  box-shadow: 0 0 10px var(--mc-green);
}

.server-info {
  padding: 20px;
}

.server-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--mc-text);
  margin-bottom: 5px;
}

.server-ip {
  color: var(--mc-green);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin-bottom: 10px;
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.server-description {
  color: var(--mc-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.server-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  font-size: 0.85rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--mc-text-muted);
}

.stat.online {
  color: var(--mc-green);
}

.server-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--mc-border);
}

.vote-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  color: var(--mc-gold);
  font-size: 1.1rem;
}

/* Forms */
.form-container {
  max-width: 600px;
  margin: 40px auto;
  background: var(--mc-bg-card);
  padding: 40px;
  border-radius: 8px;
  border: 2px solid var(--mc-border);
}

.form-title {
  color: var(--mc-green);
  margin-bottom: 30px;
  text-align: center;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--mc-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--mc-bg-primary);
  border: 2px solid var(--mc-border);
  border-radius: 4px;
  color: var(--mc-text);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--mc-green);
}

.form-group input::placeholder {
  color: #666;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Auth Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--mc-bg-card);
  border: 2px solid var(--mc-border);
  border-radius: 8px;
  padding: 40px;
  max-width: 450px;
  width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--mc-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--mc-red);
}

/* Footer */
.footer {
  background: var(--mc-bg-secondary);
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 4px solid var(--mc-border);
  text-align: center;
}

.footer p {
  color: var(--mc-text-muted);
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.footer a {
  color: var(--mc-green);
  text-decoration: none;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--mc-text-muted);
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--mc-border);
  border-top: 4px solid var(--mc-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

/* Error/Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.empty-state h3 {
  color: var(--mc-text-muted);
  margin-bottom: 15px;
}

.error-message {
  background: rgba(170, 0, 0, 0.1);
  border: 2px solid var(--mc-red);
  color: var(--mc-red);
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.success-message {
  background: rgba(85, 170, 85, 0.1);
  border: 2px solid var(--mc-green);
  color: var(--mc-green);
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .nav {
    justify-content: center;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .server-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-container {
    padding: 20px;
  }
}

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

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Vote Button Styles */
.vote-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.vote-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(85, 170, 85, 0.4);
}

.vote-btn:active:not(:disabled) {
  transform: translateY(0);
}

.vote-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.vote-btn.voted {
  background: var(--mc-green) !important;
  color: #000 !important;
  font-weight: bold;
}

.vote-btn.voted::after {
  content: ' ✓';
}

/* Vote animation */
@keyframes votePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.vote-btn.animating {
  animation: votePulse 0.3s ease;
}

/* Cooldown state */
.vote-btn.cooldown {
  background: var(--mc-stone) !important;
  font-size: 0.85rem;
}

/* Vote count highlight */
.vote-count {
  transition: all 0.3s ease;
}

.vote-count.updated {
  color: var(--mc-green);
  transform: scale(1.1);
}
