/* public/css/styles.css */

/* Base styles */
* {
    box-sizing: border-box;
  }
  
  body {
    font-family: sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #222;
    background-color: #f8f9fa;
  }
  
  /* Header styles */
  header {
    background-color: #fff;
    border-bottom: 1px solid #a2a9b1;
    padding: 0.5rem;
  }
  
  .header-container {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .logo-container {
    display: flex;
    align-items: center;
  }
  
  .menu-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
  }
  
  .logo {
    width: 50px;
    height: 50px;
    margin-right: 0.5rem;
  }
  
  h1 {
    font-family: serif;
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.2;
  }
  
  .subtitle {
    display: block;
    font-size: 0.6rem;
    color: #54595d;
  }
  
  .search-container {
    margin-left: auto;
    display: flex;
  }
  
  .search-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    width: 300px;
  }
  
  .search-button {
    margin-left: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    cursor: pointer;
  }
  
  /* Main container */
  .main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  .page-title {
    font-family: serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 0.2rem;
  }
  
  /* Tab navigation */
  .tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #a2a9b1;
  }
  
  .tab {
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    text-decoration: none;
    color: #0645ad;
  }
  
  .tab.active {
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-bottom: none;
  }
  
  .language-selector {
    margin-left: auto;
    color: #0645ad;
    cursor: pointer;
  }
  
  .subtitle-info {
    color: #54595d;
    margin-bottom: 1rem;
  }
  
  /* Main header */
  .main-header {
    font-size: 2.5rem;
    text-align: center;
    margin: 1.5rem 0;
    font-weight: bold;
  }
  
  /* Update information */
  .update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 3px;
  }
  
  .last-updated {
    font-size: 0.9rem;
    color: #555;
  }
  
  .refresh-button {
    padding: 0.4rem 0.8rem;
    background-color: #0645ad;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
  }
  
  .refresh-button:hover {
    background-color: #0b0080;
  }
  
  .refresh-button:disabled {
    background-color: #a2a9b1;
    cursor: not-allowed;
  }
  
  .refresh-icon {
    margin-right: 0.4rem;
  }
  
  /* Loading indicator */
  .loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0645ad;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .hidden {
    display: none;
  }
  
  /* Error message */
  .error-message {
    padding: 1rem;
    background-color: #fee7e6;
    border: 1px solid #d33;
    color: #d33;
    margin: 1rem 0;
    border-radius: 3px;
  }
  
  /* Navigation links */
  .navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid #a2a9b1;
    border-bottom: 1px solid #a2a9b1;
  }
  
  .nav-link {
    color: #0645ad;
    text-decoration: none;
  }
  
  .nav-link:hover {
    text-decoration: underline;
  }
  
  /* Section title */
  .section-title {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.5rem;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 0.2rem;
  }
  
  .prepared-by {
    font-style: italic;
    margin-bottom: 1rem;
    color: #555;
  }
  
  .edit-link {
    font-size: 0.8rem;
    color: #0645ad;
    text-decoration: none;
    margin-left: 0.5rem;
  }
  
  .summary {
    margin-bottom: 1rem;
  }
  
  /* Article table */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
  }
  
  th, td {
    border: 1px solid #a2a9b1;
    padding: 0.5rem;
    vertical-align: top;
  }
  
  th {
    background-color: #f8f9fa;
    text-align: left;
    font-weight: bold;
  }
  
  tr:hover {
    background-color: #f8f9fa;
  }
  
  .rank-cell {
    text-align: center;
    width: 50px;
    font-weight: bold;
  }
  
  .article-cell {
    width: 15%;
  }
  
  .class-cell {
    text-align: center;
    width: 80px;
  }
  
  .views-cell {
    text-align: right;
    width: 120px;
    font-family: monospace;
  }
  
  .image-cell {
    width: 100px;
    padding: 5px;
}

.image-container {
    width: 100px;
    height: 75px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 3px;
    overflow: hidden;
}

.article-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}
 
.wiki-logo-fallback {
    max-width: 60%;
    max-height: 60%;
    opacity: 0.7;
}

  .loading .article-image {
    animation: pulse 1.5s infinite;
    opacity: 0.7;
  }
  
  @keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
  }
  
  .notes-cell {
    width: auto;
  }
  
  .article-link {
    color: #0645ad;
    text-decoration: none;
  }
  
  .article-link:hover {
    text-decoration: underline;
  }
  
  /* Article Class Badges */
  .badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-weight: bold;
    color: white;
  }
  
  .badge-gold {
    background-color: #FFD700;
  }
  
  .badge-green {
    background-color: #008000;
  }
  
  .badge-orange {
    background-color: #FFA500;
  }
  
  .badge-blue {
    background-color: #0066CC;
  }
  
  .badge-gray {
    background-color: #808080;
  }
  
  /* Note section */
  .note {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    font-size: 0.9rem;
    color: #555;
  }
  
  /* Loading state for table */
  table.loading {
    opacity: 0.6;
  }
  
  /* Footer */
  footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    background-color: #f8f9fa;
    border-top: 1px solid #a2a9b1;
    font-size: 0.8rem;
    color: #555;
  }
  
  /* Responsive design */
  @media (max-width: 768px) {
    .header-container {
      flex-direction: column;
      align-items: flex-start;
    }
    
    .search-container {
      margin-left: 0;
      margin-top: 1rem;
      width: 100%;
    }
    
    .search-input {
      width: 100%;
    }
    
    .main-header {
      font-size: 2rem;
    }
    
    .navigation {
      flex-direction: column;
      align-items: center;
    }
    
    /* Reduce padding in table cells for mobile */
    th, td {
      padding: 0.3rem;
    }
    
    /* Update image cell for mobile instead of hiding it */
    .image-cell {
      width: 60px; /* Smaller width on mobile */
    }
    
    .image-container {
      width: 60px;
      height: 45px;
    }
    
    /* Hide only the class cell on mobile */
    .class-cell {
      display: none;
    }
    
    /* Make article title take less width */
    .article-cell {
      width: 30%;
    }
    
    /* Make the table horizontally scrollable on very small screens */
    .main-container {
      padding: 0.5rem;
    }
    
    table {
      font-size: 0.9rem;
    }
    
    /* Optional: Add this if table is still too wide on small screens */
    .table-container {
      width: 100%;
      overflow-x: auto;
    }
  }