/* ==========================================================================
   Top Bar
   ========================================================================== */
/* Top bar alternate style for crypto page */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--secondary-bg);
}

#google_translate_element {
    margin-left: 20px;
}
.top-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 20px;
}

#google_translate_element {
    justify-self: center;
    text-align: center;
}

.theme-switch-wrapper {
    justify-self: end;
}

@media (max-width: 768px) {
    .top-bar {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 15px;
    }
}

/* ==========================================================================
   Special Components
   ========================================================================== */
/* Emoji styles */
.emoji {
  font-size: 2em;
  vertical-align: middle;
}

.mycontainer {
  display: flex;
}

.mycontainer > div {
  width: 50%;
}

.mycontainer ul {
  text-align: left;
}

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */
#myBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--accent-color, #755dcc);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 18px;
  transition: all 0.3s ease;
  opacity: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#myBtn:hover {
  background-color: var(--accent-hover, #5a4a9c);
  transform: translateY(-2px);
}

/* ==========================================================================
   Navigation and Sidebar
   ========================================================================== */
.theme-switch-wrapper {
    justify-self: center;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    background-color: var(--secondary-bg);
    padding-top: 20px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Content Sections
   ========================================================================== */
.section-green {
    background-color: green;
}

.section-blue {
    background-color: blue;
    color: white;
}

.section-purple {
    background-color: purple;
}

.section-blue-white {
    background-color: blue;
    color: #fff;
}

.footer-text {
    color: white;
}

.heart-icon {
    color: red;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 992px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 4px 6px var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px var(--card-shadow);
}

.card h2 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.card p {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.card ol {
  margin-top: 10px;
  padding-left: 30px;
  list-style: none;
  counter-reset: cardNumbers;
}

.card ul {
  color: var(--text-color);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.card ol li {
  margin: 5px 0;
  position: relative;
  display: flex;
  align-items: center;
  counter-increment: cardNumbers;
  color: var(--text-color);
}

.card ol li::before {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: bold;
  content: counter(cardNumbers);
  border-radius: 50%;
  height: 16px;
  width: 16px;
  background-color: var(--accent-color);
  color: white;
  position: absolute;
  left: -23px;
}

.card li {
  margin-bottom: 0.5rem;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #0056b3;
}

/* ==========================================================================
   Base Styles and Variables
   ========================================================================== */
:root {
  --primary-bg: #f4f4f4;
  --secondary-bg: #fff;
  --text-color: #333;
  --accent-color: #0071FF;
  --card-bg: #fff;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --nav-bg: #fff;
  --nav-text: #333;
  --nav-hover: #f0f0f0;
  --border-color: #e0e0e0;
}

/* ==========================================================================
   Typography and General Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header p {
  color: var(--text-color);
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 1rem auto 2rem;
  max-width: 600px;
}

header .btn {
  margin: 0 auto;
  display: inline-block;
}

.main-heading, h1 {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-color);
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Center all buttons within the main content area */
.grid-container .card .btn,
.main-content .btn {
  display: block;
  margin: 1rem auto;
  text-align: center;
  max-width: 200px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--primary-bg);
  min-height: 100vh;
}

/* ==========================================================================
   Top Bar and Google Translate
   ========================================================================== */
.top-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  gap: 20px;
}

#google_translate_element {
  justify-self: center;
  text-align: center;
}

/* Google Translate fixes */
.goog-te-gadget {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 14px !important;
}

.goog-te-gadget-simple {
  border: 1px solid var(--border-color) !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  background-color: var(--secondary-bg) !important;
}

.goog-te-menu-value {
  color: var(--text-color) !important;
}

/* ==========================================================================
   Navigation and Sidebar
   ========================================================================== */
nav {
  background-color: var(--secondary-bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
  width: 100%;
  list-style: none;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

nav li {
  height: 50px;
}

nav li:first-child {
  margin-right: 20px;
}

nav a {
  height: 100%;
  padding: 0 20px;
  text-decoration: none;
  display: flex;
  align-items: center;
  color: var(--text-color);
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--accent-color);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 280px;
  background-color: var(--secondary-bg);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-close {
  padding: 15px;
  display: flex;
  justify-content: flex-end;
}

.sidebar .section-title {
  padding: 15px 20px;
  font-weight: bold;
  background-color: var(--nav-hover);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar a {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.3s;
}

.sidebar a:hover {
  background-color: var(--nav-hover);
}

.sidebar-submenu {
  list-style: none;
  padding: 0;
}

.sidebar-submenu a {
  padding-left: 40px;
}

/* Categories Dropdown */
.categories-dropdown {
  position: relative;
  margin-left: auto;
  margin-right: 20px;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  width: 250px;
  background-color: var(--secondary-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  z-index: 1000;
  display: none;
  margin-top: 5px;
}

.dropdown-content a {
  padding: 12px 16px;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.3s;
}

.dropdown-content a:hover {
  background-color: var(--nav-hover);
}

.dropdown-content.show {
  display: block;
}

/* ==========================================================================
   Theme Switch
   ========================================================================== */
.theme-switch-wrapper {
  justify-self: end;
}

#theme-switch {
  width: 40px;
  height: 40px;
  padding: 8px;
  background: var(--secondary-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#theme-switch svg {
  width: 24px;
  height: 24px;
  position: absolute;
  transition: all 0.3s ease;
  fill: var(--text-color);
}

#theme-switch:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  .top-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 15px;
    padding: 10px;
  }

  .theme-switch-wrapper {
    justify-self: center;
  }

  .hideOnMobile {
    display: none;
  }

  nav ul {
    padding: 0 10px;
  }

  .categories-dropdown {
    margin-right: 10px;
  }

  .nav-toggle {
    display: block;
  }

  /* Mobile Dropdown */
  .dropdown-content {
    position: absolute;
    width: 100%;
    max-width: 300px;
    right: -10px;
  }

  /* Ensure sidebar is visible on mobile */
  .sidebar {
    width: 280px;
  }

  /* Google Translate mobile adjustments */
  #google_translate_element {
    width: auto;
    max-width: 100%;
    overflow: hidden;
  }

  .goog-te-gadget {
    max-width: 100%;
    overflow: hidden;
  }
}

@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }

  .categories-dropdown:hover .dropdown-content {
    display: block;
  }
}

/* ==========================================================================
   Animations and Transitions
   ========================================================================== */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll to Top Button */
#myBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--accent-color);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#myBtn:hover {
  background-color: #0056b3;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  #myBtn {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */
footer {
  background-color: var(--secondary-bg);
  color: var(--text-color);
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
  text-align: center;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

footer p {
  text-align: center;
  margin: 1rem 0;
  color: var(--text-color);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links li a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links li a:hover {
  color: var(--accent-color);
}

.footer-content {
  width: 100%;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

@media (max-width: 992px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

.footer-section {
  padding: 1rem;
}

.footer-section h3 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* Button Styles */
.btn, 
button,
input[type="submit"],
input[type="button"] {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  min-width: 150px;
  margin: 0 auto;
}

.btn:hover, 
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}