/* Icecast-KH Modern Theme */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --background-dark: #1a1a1a;
  --background-light: #f5f5f5;
  --text-light: #ffffff;
  --text-dark: #333333;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background-light);
  transition: all 0.3s ease;
}

body.dark-mode {
  background-color: var(--background-dark);
  color: var(--text-light);
}

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

/* Header Styles */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--text-light);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.logo-icon {
  font-size: 2rem;
}

.controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Theme Switch */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--secondary-color);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(30px);
}

/* Main Content */
main {
  padding: 2rem 0 !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

body.dark-mode .stat-card {
  background-color: #2d2d2d;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

body.dark-mode .stat-card h3 {
  border-bottom: 1px solid #444;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin: 10px 0;
}

body.dark-mode .stat-value {
  color: var(--text-light);
}

.stat-label {
  font-size: 0.9rem;
  color: #777;
}

body.dark-mode .stat-label {
  color: #aaa;
}

/* Player Section */
.player-section {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--card-shadow);
  margin-bottom: 30px;
}

body.dark-mode .player-section {
  background-color: #2d2d2d;
}

.player-section h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.album-art {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
}

.track-info {
  flex: 1;
}

.track-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.track-artist {
  font-size: 1.1rem;
  color: #777;
  margin-bottom: 10px;
}

body.dark-mode .track-artist {
  color: #aaa;
}

.audio-controls {
  width: 100%;
  margin-top: 15px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.volume-slider {
  flex: 1;
}

/* Listeners Table */
.listeners-section {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--card-shadow);
}

body.dark-mode .listeners-section {
  background-color: #2d2d2d;
}

.listeners-section h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

.listeners-table {
  width: 100%;
  border-collapse: collapse;
}

.listeners-table th,
.listeners-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

body.dark-mode .listeners-table th,
body.dark-mode .listenerse-table td {
  border-bottom: 1px solid #444;
}

.listeners-table th {
  background-color: #f8f8f8;
  font-weight: 600;
}

body.dark-mode .listeners-table th {
  background-color: #333;
}

.listeners-table tr:hover {
  background-color: #f5f5f5;
}

body.dark-mode .listeners-table tr:hover {
  background-color: #333;
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: var(--text-light);
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright a {
	color: var(--text-light);
	text-decoration: none;
	transition: color 0.3s ease;
}

.copyright a:hover {
  color: var(--primary-color);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* Дополнительные стили для интеграции */
.nav-menu {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  justify-content: center;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.detail-item {
    display: flex;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
    justify-content: space-between;
    flex-direction: column;
    align-items: flex-start;
}

body.dark-mode .detail-item {
  background-color: #333;
  border-left-color: var(--accent-color);
}

.detail-label {
  font-weight: bold;
  color: #555;
}

body.dark-mode .detail-label {
  color: #aaa;
}

.detail-value {
  color: #333;
  text-align: right;
}

body.dark-mode .detail-value {
  color: #fff;
}

.stream-details {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

body.dark-mode .stream-details {
  border-top: 1px solid #444;
}

.stream-details h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

/* Адаптивность для аудиоплеера */
audio {
  width: 100%;
  margin-top: 10px;
  height: 40px;
}

/* Стили для неактивных точек монтирования */
.player-section p {
  text-align: center;
  padding: 20px;
  color: #777;
  font-style: italic;
  background-color: #f5f5f5;
  border-radius: 5px;
}

body.dark-mode .player-section p {
  color: #aaa;
  background-color: #2a2a2a;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background-color: #2980b9;
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #1e2a36;
}

/* Form Elements */
input[type="range"] {
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

body.dark-mode input[type="range"] {
  background: #555;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .now-playing {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-menu {
    flex-direction: column;
  }
  
  .nav-menu a {
    text-align: center;
  }
  
  .detail-item {
    flex-direction: column;
  }
  
  .detail-value {
    text-align: left;
    margin-top: 5px;
  }
  
  .listeners-table {
    display: block;
    overflow-x: auto;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

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

.loading {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

body.dark-mode .loading {
  border: 4px solid #333;
  border-top: 4px solid var(--primary-color);
}

/* Error message styling */
.error-message {
  background-color: #ffebee;
  color: #c62828;
  padding: 15px;
  border-radius: var(--border-radius);
  margin: 15px 0;
  border-left: 4px solid #c62828;
}

body.dark-mode .error-message {
  background-color: #2a0f0f;
  color: #f44336;
  border-left-color: #f44336;
}

/* Success message styling */
.success-message {
  background-color: #e8f5e9;
  color: #2e7d32;
  padding: 15px;
  border-radius: var(--border-radius);
  margin: 15px 0;
  border-left: 4px solid #2e7d32;
}

body.dark-mode .success-message {
  background-color: #0f1f10;
  color: #4caf50;
  border-left-color: #4caf50;
}

/* Table improvements for mobile */
@media (max-width: 480px) {
  .listeners-table th,
  .listeners-table td {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
  
  .stat-card {
    padding: 15px;
  }
  
  .player-section {
    padding: 15px;
  }
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

body.dark-mode ::-webkit-scrollbar-track {
  background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2980b9;
}