/* ===============================
   Base Styles & Layout
================================= */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background: white;
  margin: 75px;
  line-height: 1.6;
}

.page-wrapper {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

h2 {
  text-align: center;
}

header,
footer {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 10px;
}

header {
  background-color: white;
  position: static !important;
}

footer {
  background-color: #003366;
  color: white;
  font-weight: 500;
}

/* ===============================
   Header Section
================================= */
.header-section {
  width: 100%;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-section img {
  width: 100%;
  max-height: 180px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ===============================
   Search Input
================================= */
#search-input {
  margin-top: 0.5rem;
  padding: 0.5em;
  border-radius: 5px;
  border: 1px solid #ccc;
  width: 80%;
  max-width: 400px;
}

/* ===============================
   Coin Containers
================================= */
.coin-section {
  padding-top: 40px;
}

.coin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  justify-items: center;
  padding-top: 50px;
}

/* ===============================
   Card Flip Component
================================= */
.card {
  width: 100%;
  max-width: 200px;
  height: 250px;
  perspective: 1000px;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
}

.card-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  position: relative;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  backface-visibility: hidden;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card-back {
  transform: rotateY(180deg);
}

/* ===============================
   Badge Styling
================================= */
.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: blue;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  z-index: 2;
}

/* ===============================
   Coin Image
================================= */
.coin-image {
  max-width: 80%;
  height: auto;
  margin-bottom: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ===============================
   Dropdown Navigation
================================= */
.custom-dropdown {
  position: relative;
  text-align: center;
  margin-top: 1rem;
  width: 100%;
}

#menu-toggle {
  background-color: #f0f0f5;
  border: 1px solid #ccc;
  padding: 0.5em 1em;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
}

.dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  position: absolute;
  width: 100%;
  left: 0;
  z-index: 999;

  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.dropdown-list.show {
  max-height: 500px;
  opacity: 1;
}

.dropdown-list li {
  padding: 0.5em;
  border-bottom: 1px solid #eee;
}

.dropdown-list li:last-child {
  border-bottom: none;
}

.dropdown-list a {
  text-decoration: none;
  color: #333;
  display: block;
}

.dropdown-list li:hover {
  background-color: #f9f9f9;
}

/* ===============================
   Utility Classes
================================= */
.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hidden {
  display: none;
}

.centered {
  text-align: center;
}

/* ===============================
   Responsive Design
================================= */
@media (max-width: 600px) {
  .page-wrapper {
    padding: 0 10px;
  }

  .header-section {
    flex-direction: column;
    align-items: center;
  }

  #search-input {
    width: 90%;
    margin-top: 0.5rem;
  }

  .custom-dropdown {
    width: 90%;
  }

  .dropdown-list li {
    padding: 1em;
  }

  .coin-grid {
    padding: 20px 0;
    gap: 15px;
  }
}