/*
 * This is a manifest file that'll be compiled into application.css.
 * WikiRater Color Theme:
 * - Primary: #9BB4C0 (Soft blue-gray)
 * - Secondary: #E1D0B3 (Warm beige)
 * - Accent: #A18D6D (Tan/taupe)
 * - Dark: #703B3B (Dark reddish-brown)
 */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #9BB4C0;
  min-height: 100vh;
  padding: 0;
  padding-top: 80px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  background: #E1D0B3;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(112, 59, 59, 0.3);
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand .logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-brand .logo-link:hover {
  opacity: 0.8;
}

.nav-brand .logo {
  height: 80px;
  width: auto;
  display: block;
}

.nav-brand .brand-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: #703B3B;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: #703B3B;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #A18D6D;
}

.nav-link.admin-link {
  background: #A18D6D;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

.nav-link.admin-link:hover {
  background: #8a7a5e;
  color: white;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #703B3B;
  font-weight: 500;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #A18D6D;
}

.btn-login, .btn-logout {
  background: #A18D6D;
  color: white;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-login:hover, .btn-logout:hover {
  background: #8a7a5e;
}

/* Alerts */
.alert {
  max-width: 1200px;
  margin: 20px auto;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 500;
}

.alert-notice {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #4caf50;
}

.alert-alert {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #f44336;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 2.5em;
  color: #703B3B;
  margin-bottom: 10px;
  font-weight: 700;
}

.subtitle {
  color: #703B3B;
  font-size: 1.1em;
  opacity: 0.8;
}

/* Search Section */
.search-section {
  background: rgba(255, 255, 255, 0.7);
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 30px;
}

.search-section h2 {
  margin-bottom: 20px;
  color: #333;
}

.search-form {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #703B3B;
}

.quality-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #A18D6D;
  border-radius: 8px;
  font-size: 1em;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

.quality-select:hover, .quality-select:focus {
  border-color: #9BB4C0;
  outline: none;
}

/* Buttons */
.btn-primary {
  background: #A18D6D;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(155, 180, 192, 0.5);
  background: #8a7a5e;
}

.btn-secondary {
  background: #A18D6D;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: #8a7a5e;
}

.btn-wiki {
  background: #703B3B;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.3s;
}

.btn-wiki:hover {
  background: #8d4d4d;
}

.btn-wiki-large {
  background: #703B3B;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1em;
  display: inline-block;
  transition: background 0.3s;
  font-weight: 600;
}

.btn-wiki-large:hover {
  background: #8d4d4d;
}

/* Stats */
.stats {
  text-align: center;
  margin-bottom: 30px;
  padding: 15px;
  background: rgba(155, 180, 192, 0.3);
  border-radius: 10px;
}

.stats strong {
  color: #703B3B;
  font-size: 1.3em;
}

/* Articles Section */
.articles-section h2 {
  margin-bottom: 25px;
  color: #333;
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
  background: white;
}

.article-card:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.article-rank {
  font-size: 2em;
  font-weight: bold;
  color: #A18D6D;
  min-width: 50px;
  text-align: center;
}

.article-content {
  flex: 1;
}

.article-title {
  margin-bottom: 10px;
}

.article-title a {
  color: #703B3B;
  text-decoration: none;
  font-size: 1.3em;
  transition: color 0.3s;
}

.article-title a:hover {
  color: #9BB4C0;
}

.article-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

.score {
  color: #666;
}

.score strong {
  font-size: 1.2em;
}

.rating-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  color: white;
}

.rating-badge.excellent { background: #28a745; }
.rating-badge.good { background: #17a2b8; }
.rating-badge.solid { background: #6c757d; }
.rating-badge.developing { background: #ffc107; color: #333; }
.rating-badge.stub { background: #fd7e14; }
.rating-badge.minimal { background: #dc3545; }

.article-stats {
  display: flex;
  gap: 15px;
  color: #666;
  font-size: 0.9em;
}

.article-stats span {
  background: #f8f9fa;
  padding: 4px 10px;
  border-radius: 5px;
}

.article-actions {
  display: flex;
  gap: 10px;
  flex-direction: column;
}

/* Article Detail Page */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #9BB4C0;
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
  color: #703B3B;
}

.article-detail {
  max-width: 900px;
  margin: 0 auto;
}

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

.article-header h1 {
  flex: 1;
  color: #703B3B;
}

.article-score-large {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-weight: bold;
  padding: 15px 25px;
  border-radius: 10px;
  background: #f8f9fa;
}

.score-number {
  font-size: 3em;
  line-height: 1;
}

.score-label {
  font-size: 1.5em;
  color: #999;
}

.article-score-large.excellent { background: #d4edda; color: #28a745; }
.article-score-large.good { background: #d1ecf1; color: #17a2b8; }
.article-score-large.solid { background: #e2e3e5; color: #6c757d; }
.article-score-large.developing { background: #fff3cd; color: #856404; }
.article-score-large.stub { background: #ffe5d0; color: #fd7e14; }
.article-score-large.minimal { background: #f8d7da; color: #dc3545; }

.rating-badge-large {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 25px;
  font-size: 1.2em;
  font-weight: 600;
  color: white;
  margin-bottom: 20px;
}

.rating-badge-large.excellent { background: #28a745; }
.rating-badge-large.good { background: #17a2b8; }
.rating-badge-large.solid { background: #6c757d; }
.rating-badge-large.developing { background: #ffc107; color: #333; }
.rating-badge-large.stub { background: #fd7e14; }
.rating-badge-large.minimal { background: #dc3545; }

.article-links {
  margin-bottom: 30px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 40px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.6);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid rgba(155, 180, 192, 0.3);
}

.metric-value {
  font-size: 2em;
  font-weight: bold;
  color: #703B3B;
  margin-bottom: 5px;
}

.metric-label {
  color: #A18D6D;
  font-size: 0.9em;
}

.scores-section {
  margin-bottom: 40px;
}

.scores-section h2 {
  margin-bottom: 20px;
  color: #703B3B;
}

.scores-breakdown {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.score-item {
  background: rgba(255, 255, 255, 0.6);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(155, 180, 192, 0.3);
}

.score-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.score-metric {
  font-weight: 600;
  color: #703B3B;
}

.score-value {
  color: #9BB4C0;
  font-weight: 600;
}

.score-bar-bg {
  height: 10px;
  background: rgba(161, 141, 109, 0.2);
  border-radius: 5px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  background: #9BB4C0;
  border-radius: 5px;
  transition: width 0.3s;
}

.recommendations-section {
  margin-bottom: 40px;
}

.recommendations-section h2 {
  margin-bottom: 15px;
  color: #333;
}

.recommendations-list {
  list-style: none;
  padding: 0;
}

.recommendations-list li {
  background: #fff3cd;
  padding: 12px 15px;
  margin-bottom: 10px;
  border-left: 4px solid #ffc107;
  border-radius: 5px;
}

.metadata-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
}

.metadata-section h3 {
  margin-bottom: 15px;
  color: #333;
}

.metadata-section dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.metadata-section dt {
  font-weight: 600;
  color: #666;
}

.metadata-section dd {
  color: #333;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 1.1em;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-notice {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-alert {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Like Button and Article Actions */
.article-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 8px;
}

.like-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-like {
  background: white;
  border: 2px solid #A18D6D;
  color: #703B3B;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-like:hover {
  background: #f5f5f5;
  transform: scale(1.05);
}

.btn-like.liked {
  background: #A18D6D;
  color: white;
  border-color: #A18D6D;
}

.btn-like.liked:hover {
  background: #8a7a5e;
  border-color: #8a7a5e;
}

.like-info {
  color: #703B3B;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-prompt {
  color: #999;
  font-weight: normal;
  font-size: 0.9rem;
}

.discoverer-info {
  color: #666;
  font-size: 0.95rem;
}

.discoverer-info strong {
  color: #703B3B;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .article-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-actions {
    flex-direction: row;
    width: 100%;
  }

  .search-form {
    flex-direction: column;
  }

  .article-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-actions-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .like-section {
    flex-direction: column;
    width: 100%;
  }

  .article-links {
    width: 100%;
  }
}
