/**
 * game-rockets.de - Dark Mode Design (Grau + Rot)
 * Modernes responsives CSS für Gaming-News-Aggregator
 */

/* ============================================
   CSS VARIABLEN (Dark Mode Farbschema)
   ============================================ */

:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --bg-card: #252525;
  --bg-card-hover: #2f2f2f;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  --accent-red: #e63946;
  --accent-red-hover: #d62828;
  --accent-red-dark: #c1121f;
  --border-color: #3a3a3a;
  --shadow: rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET & GRUNDLAGEN
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--accent-red);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-red-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--accent-red);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px var(--shadow);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 10px rgba(230, 57, 70, 0.4), 0 0 15px rgba(230, 57, 70, 0.2);
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}

.logo-name {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 10px rgba(230, 57, 70, 0.4), 0 0 15px rgba(230, 57, 70, 0.2);
}

.logo-tagline {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.8px;
  margin-top: 0.25rem;
  line-height: 1;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.25), 0 0 8px rgba(230, 57, 70, 0.3);
}

.logo span {
  color: var(--accent-red);
}

.logo-image {
  max-height: 50px;
  height: auto;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.admin-header .logo-image {
  max-height: 35px;
  max-width: 150px;
}

.nav-categories {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-categories a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.25), 0 0 8px rgba(230, 57, 70, 0.3);
}

.nav-categories a:hover,
.nav-categories a.active {
  background-color: var(--accent-red);
  color: white;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
}

/* ============================================
   NEWS GRID
   ============================================ */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--shadow), 0 0 20px rgba(230, 57, 70, 0.2);
  border-color: var(--accent-red);
}

.news-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: var(--bg-secondary);
  position: relative;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.05);
}

.news-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  color: var(--text-muted);
  font-size: 3rem;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card-category {
  display: inline-block;
  background-color: var(--accent-red);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.news-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.news-card-source {
  font-weight: 600;
  color: var(--accent-red);
}

.news-card-date {
  font-style: italic;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.pagination .active {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background-color: var(--bg-secondary);
  border-top: 2px solid var(--accent-red);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-red);
}

.footer-powered {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-powered a {
  color: var(--accent-red);
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-powered a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
  position: fixed !important;
  top: auto !important;
  right: 2rem !important;
  left: auto !important;
  bottom: 4rem !important;
  transform: none !important;
  width: 50px;
  height: 50px;
  background: var(--accent-red);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.scroll-to-top:hover {
  background: var(--accent-red-hover);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(230, 57, 70, 0.4);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    text-align: center;
  }
  
  .nav-categories {
    justify-content: center;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .container {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .logo {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-categories {
    gap: 0.5rem;
  }
  
  .nav-categories a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .news-card-content {
    padding: 1rem;
  }
  
  .news-card-title {
    font-size: 1.1rem;
  }
}

/* ============================================
   ADMIN-SPEZIFISCHE STYLES
   ============================================ */

.admin-header {
  background-color: var(--bg-secondary);
  padding: 1rem 2rem;
  border-bottom: 2px solid var(--accent-red);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-nav {
  display: flex;
  gap: 1.5rem;
}

.admin-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--accent-red);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--accent-red);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn:hover {
  background-color: var(--accent-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--shadow);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-danger {
  background-color: #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
}

.table {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover {
  background-color: var(--bg-card-hover);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-red);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.alert {
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.2);
  border: 1px solid #28a745;
  color: #28a745;
}

.alert-error {
  background-color: rgba(220, 53, 69, 0.2);
  border: 1px solid #dc3545;
  color: #dc3545;
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.2);
  border: 1px solid #17a2b8;
  color: #17a2b8;
}

/* ============================================
   CARD INTERACTIONS (Reactions + Kommentare)
   ============================================ */

.card-interactions {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.12);
}

.interactions-separator {
  flex: 1;
}

.reaction-btn,
.comments-toggle-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.reaction-btn {
  color: var(--text-muted);
}

.reaction-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.reaction-btn svg {
  display: block;
  flex-shrink: 0;
}

/* Like aktiv → grün */
.like-btn.active {
  color: #4ade80;
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

/* Dislike aktiv → rot */
.dislike-btn.active {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(230, 57, 70, 0.1);
}

.comments-toggle-btn {
  color: var(--text-muted);
  margin-left: auto;
}

.comments-toggle-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ============================================
   KOMMENTARE SEKTION
   ============================================ */

.comments-section {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.1);
}

.comments-loading,
.comments-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.75rem 0;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comment {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.comment-author {
  font-weight: 600;
  color: var(--accent-red);
}

.comment-date {
  color: var(--text-muted);
  font-style: italic;
}

.comment-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

/* Kommentar-Formular */

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.comment-form-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.comment-form-row {
  display: flex;
}

.comment-form .form-control {
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
}

.comment-form textarea.form-control {
  min-height: 70px;
  resize: vertical;
}

.comment-submit-btn {
  align-self: flex-start;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.comment-form-feedback {
  font-size: 0.85rem;
  min-height: 1.2em;
}

.feedback-success {
  color: #28a745;
}

.feedback-error {
  color: var(--accent-red);
}
