/* ========================================
   Common Styles - Nael and His Adventures
   ======================================== */

/* CSS Variables for theming */
:root {
  --color-home: #0066cc;
  --color-silver: #007acc;
  --color-gold: #d4af37;
  --color-platinum: #718096;
  --color-palladium: #8b9aab;
  
  --hover-home: #0052a3;
  --hover-silver: #005a9c;
  --hover-gold: #b8860b;
  --hover-platinum: #4a5568;
  --hover-palladium: #5a6c7d;
  
  --bg-home: #f7f7f7;
  --bg-silver: #f7f9fb;
  --bg-gold: #fefaf5;
  --bg-platinum: #f5f7fa;
  --bg-palladium: #f6f8fa;
  --bg-rhodium: #faf5ff;
}

/* Base Styles */
body {
  font-family: Arial, sans-serif;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-home);
}

h1 {
  color: #333;
  text-align: center;
  font-size: 1.4rem;
}

h2 {
  color: #555;
  margin-top: 1.5rem;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  line-height: 1.8;
}

/* Content Container */
.content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Fact Box */
.fact-box {
  background: #e8f5e9;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  border-radius: 4px;
  border-left: 4px solid #4caf50;
  display: none; /* Hidden by default for pagination */
}

.fact-box.visible {
  display: block; /* Show only when has visible class */
}

/* Navigation Styles */
nav {
  padding: 0;
  margin-bottom: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

/* Hamburger Button - hidden on desktop */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  margin: 5px 0;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav li {
  margin: 0;
}

nav a {
  display: block;
  color: white;
  padding: 1rem 1.5rem;
  text-decoration: none;
  transition: background 0.3s;
  font-weight: 500;
}

nav a:hover {
  text-decoration: none;
}

/* Dropdown Styles */
nav .dropdown {
  position: relative;
  display: inline-block;
}

nav .dropdown-content {
  display: none;
  position: absolute;
  min-width: 200px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  top: 100%;
  left: 0;
}

nav .dropdown:hover .dropdown-content {
  display: block;
}

nav .dropdown-content a {
  padding: 0.75rem 1.5rem;
  display: block;
}

nav .dropbtn {
  cursor: pointer;
}

/* Coin Gallery */
.coin-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.coin-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: #f9f9f9;
}

.coin-img {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
  font-weight: bold;
}

.coin-caption {
  padding: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.coin-caption strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #333;
}

/* Caricature Image */
.caricature {
  display: block;
  max-width: 400px;
  width: 100%;
  margin: 1.5rem auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Bill Container */
.bill-container {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 2rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.bill-container h3 {
  color: #ffd700;
  text-align: center;
  margin-top: 0;
}

.bill-image {
  width: 100%;
  max-width: 800px;
  margin: 1rem auto;
  display: block;
  border: 2px solid #333;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.bill-label {
  text-align: center;
  color: #ffd700;
  font-weight: bold;
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.1rem;
}

.bill-info {
  color: #ccc;
  text-align: center;
  margin-top: 1rem;
  line-height: 1.6;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid #0066cc;
  background: white;
  color: #0066cc;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.9rem;
}

.pagination button:hover:not(:disabled) {
  background: #0066cc;
  color: white;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination span {
  font-weight: bold;
  color: #333;
}

/* Placeholder */
.placeholder {
  text-align: center;
  padding: 3rem;
  background: #f0f0f0;
  border-radius: 8px;
  margin: 2rem 0;
  color: #666;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 2rem 0;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #ecf0f1;
  text-align: center;
  border-top: 3px solid #3498db;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

footer p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

footer .copyright {
  font-weight: bold;
  color: #3498db;
}

footer .year {
  color: #bdc3c7;
}

/* ========================================
   Mobile Responsive - Hamburger Menu
   ======================================== */
@media (max-width: 768px) {
  body {
    padding: 0.5rem;
  }

  .hamburger {
    display: block;
  }

  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  nav ul.open {
    display: flex;
  }

  nav a {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  nav .dropdown {
    display: block;
  }

  nav .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    padding-left: 1rem;
  }

  nav .dropdown.open .dropdown-content {
    display: block;
  }

  nav .dropdown:hover .dropdown-content {
    display: none;
  }

  nav .dropdown.open:hover .dropdown-content {
    display: block;
  }

  nav .dropdown-content a {
    padding: 0.65rem 1.25rem;
  }

  h1 {
    font-size: 1.1rem;
  }

  .content {
    padding: 1rem;
  }
}

/* Layout for coin pages - side by side on desktop */
.layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.table-container {
  flex: 1;
  min-width: 0;
}

.layout > div:last-child {
  width: 350px;
  flex-shrink: 0;
  margin-top: 3.5rem;
}

@media (max-width: 1024px) {
  .layout {
    flex-direction: column;
  }
  
  .layout > div:last-child {
    margin-top: 0;
  }
  
  .layout > div:last-child {
    width: 100%;
  }
}

/* Meme Popup and Animated Effects */
.meme-popup {
  animation: memePopupFade 2.5s;
}
@keyframes memePopupFade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}
.meme-animated {
  transition: transform 0.2s, box-shadow 0.2s;
}
.meme-animated:hover {
  transform: rotate(-5deg) scale(1.08);
  box-shadow: 0 4px 24px #ffe06699;
  filter: brightness(1.1) drop-shadow(0 0 8px #ffe066);
}
.meme-animated:active {
  animation: memeWiggle 0.5s;
}
@keyframes memeWiggle {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(8deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-8deg); }
  100% { transform: rotate(0deg); }
}
