/**
 * Modern Minecraft Server Status Display
 * Clean design with server icon and centered MOTD
 */

.mc-server-status {
  max-width: 900px;
  margin: 40px auto;
  background: #fff;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #999;
}

/* Status Header */
.mc-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #999;
  flex-wrap: wrap;
  gap: 15px;
}

.mc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #333;
  background: #f8f9fa;
  border: 1px solid #999;
}

.mc-status-badge.online {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.mc-status-badge.offline {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Pulsing Status Indicator */
.mc-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.mc-status-badge.online .mc-status-indicator {
  background: #28a745;
  box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  animation: pulse-green 2s infinite;
}

.mc-status-badge.offline .mc-status-indicator {
  background: #dc3545;
  box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

.mc-players-count {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #999;
}

.mc-players-icon {
  font-size: 18px;
  color: #666;
}

.mc-players-text {
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.mc-players-number {
  font-weight: 700;
  font-size: 18px;
  color: #ff1493;
}

.mc-players-max {
  color: #999;
  font-size: 14px;
}

/* MOTD Display with Server Icon */
.mc-motd-container {
  background: url('../images/mc-pattern.png') repeat;
  background-size: 64px 64px;
  border-radius: 10px;
  padding: 20px 25px;
  margin-top: 20px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
}

.mc-motd-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  pointer-events: none;
  z-index: 0;
}

.mc-server-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid #666;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  position: relative;
  z-index: 1;
}

.mc-motd-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.mc-motd-text {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
  word-wrap: break-word;
  text-align: center;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

/* Preserve Minecraft color codes */
.mc-motd-text b,
.mc-motd-text span {
  font-weight: inherit;
}

/* Server Info Grid */
.mc-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.mc-info-item {
  background: #f8f9fa;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid #999;
  text-align: center;
}

.mc-info-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
}

.mc-info-value {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

/* Ping Display */
.mc-ping-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mc-ping-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.mc-ping-bar {
  width: 3px;
  background: #28a745;
  border-radius: 1px;
}

.mc-ping-bar:nth-child(1) { height: 40%; }
.mc-ping-bar:nth-child(2) { height: 65%; }
.mc-ping-bar:nth-child(3) { height: 90%; }
.mc-ping-bar:nth-child(4) { height: 100%; }

/* Ping Colors */
.mc-ping-excellent .mc-ping-bar { background: #28a745; }
.mc-ping-good .mc-ping-bar { background: #5cb85c; }
.mc-ping-fair .mc-ping-bar { background: #f0ad4e; }
.mc-ping-poor .mc-ping-bar { background: #d9534f; }

.mc-ping-fair .mc-ping-bar:nth-child(4) { opacity: 0.3; }
.mc-ping-poor .mc-ping-bar:nth-child(3),
.mc-ping-poor .mc-ping-bar:nth-child(4) { opacity: 0.3; }

/* Offline State */
.mc-server-status.offline {
  background: #fff;
  border-color: #999;
}

.mc-offline-message {
  text-align: center;
  padding: 30px;
  color: #666;
}

.mc-offline-icon {
  font-size: 48px;
  color: #dc3545;
  margin-bottom: 15px;
}

.mc-offline-text {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* Loading State */
.mc-status-loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mc-server-status {
    padding: 20px;
    margin: 30px 15px;
  }
  
  .mc-status-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mc-status-badge,
  .mc-players-count {
    justify-content: center;
  }
  
  .mc-motd-container {
    padding: 15px 20px;
    flex-direction: column;
    text-align: center;
  }
  
  .mc-server-icon {
    width: 48px;
    height: 48px;
  }
  
  .mc-motd-text {
    font-size: 14px;
  }
  
  .mc-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .mc-server-status {
    padding: 15px;
    margin: 20px 10px;
  }
  
  .mc-status-badge {
    font-size: 14px;
    padding: 10px 20px;
  }
  
  .mc-players-count {
    padding: 10px 20px;
  }
  
  .mc-players-text {
    font-size: 14px;
  }
  
  .mc-players-number {
    font-size: 16px;
  }
  
  .mc-server-icon {
    width: 40px;
    height: 40px;
  }
  
  .mc-motd-text {
    font-size: 13px;
  }
}
