/* For tablets */
@media (max-width: 900px) {
  header, main, footer {
    max-width: 98vw;
    padding: 1.2rem;
  }
  .main-container, .content-narrow {
    width: 95%;
    max-width: 98vw;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 10px;
    gap: 10px;
  }
}

/* For phones */
@media (max-width: 600px) {
  header, main, footer {
    padding: 0.7rem;
    margin: 1rem auto;
    border-radius: 10px;
  }
  .main-container, .content-narrow {
    width: 99%;
    max-width: 99vw;
    padding: 0;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 4px;
  }
  .tabs-btn-container, .tab-btn-container {
    top: 0.5em;
    right: 0.5em;
  }
  .menu-nav {
    top: 10px;
    left: 10px;
  }
  .nice-btn {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
  h1, h2 {
    font-size: 1.3em !important;
  }
}

/* Make images scale nicely */
.gallery-grid img, .img-modal .modal-content {
  max-width: 100%;
  height: auto;
}

/* Ensure modal fits on mobile */
@media (max-width: 600px) {
  .img-modal .modal-content {
    max-width: 98vw;
    max-height: 80vh;
  }
  .img-modal .close-modal {
    top: 10px;
    right: 16px;
    font-size: 30px;
  }
}

/* Global styles */
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #fff;
    background-color: #181028;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-sizing: border-box;
}

header, main, footer {
    background: rgba(20, 0, 30, 0.7);
    border-radius: 16px;
    margin: 2rem auto;
    max-width: 700px;
    padding: 2rem;
    box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}

header {
    max-width: 900px;
    margin: 2rem auto 1rem auto;
    text-align: center;
    width: 90%;
}

header h1 {
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
    letter-spacing: 2px;
    color: #e0aaff;
    text-align: center;
    text-shadow: 0 2px 8px #000;
}

.discord-btn {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5em;
    margin-left: auto;
    margin-right: auto;
    display: block;
    background: rgba(20, 0, 30, 0.7);
    color: #c77dff;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
}

.discord-btn:hover, .discord-btn:focus {
    background: #4b006e;
    color: #fff;
    box-shadow: 0 4px 16px #4b006e55;
}

.discord-btn i.fa-discord {
    font-size: 1.5em;
    margin-right: 0.3em;
    vertical-align: middle;
}

.discord-icon {
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.3em;
    fill: currentColor;
}

main h2 {
    color: #c77dff;
    margin-top: 1.5rem;
}

main section {
    text-align: center;
}

footer {
    text-align: center;
    font-size: 1rem;
    color: #bdbdbd;
    background: none;
    box-shadow: none;
    margin-bottom: 1rem;
    padding: 1rem 0 0 0;
}

.menu-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-bar {
    width: 100%;
    height: 4px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    background: #111;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 120px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    overflow: hidden;
}

.menu-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
}

.menu-dropdown a:hover {
    background: #222;
}

.menu-dropdown a.active {
  color: #fff;
  background: #0078d7;
  border-radius: 4px;
  padding: 4px 8px;
}

.menu-nav.open .menu-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-nav.open .menu-bar:nth-child(1) {
    transform: translateY(12px) rotate(45deg);
}
.menu-nav.open .menu-bar:nth-child(2) {
    opacity: 0;
}
.menu-nav.open .menu-bar:nth-child(3) {
    transform: translateY(-12px) rotate(-45deg);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.main-container {
    width: 75%;
    margin: 0 auto;
}

.main-container main {
    margin-bottom: 2rem;
}

.content-narrow {
    max-width: 700px;
    margin: 0 auto;
    width: 80%;
}

.regex-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.regex-card {
    background: #7c7c7c;
    border: 1px solid #000000;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.regex-card h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.regex-desc {
    margin: 0.5em 0 0.2em 0;
    color: #ffffff;
}

.regex-pattern {
    background: #222;
    color: #fff176;
    padding: 0.5em 1em;
    border-radius: 6px;
    font-family: "Fira Mono", "Consolas", monospace;
    font-size: 1em;
    margin: 0.2em 0 0 0;
    overflow-x: auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
}
.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.img-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}
.img-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}
.img-modal .close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    z-index: 1001;
}

.icon-btn {
  text-decoration: none !important;
  border: none;
  background: none;
  padding: 5px 10px;
  border-radius: 5px;
}

.icon-btn i {
  color: inherit;
  transition: color 0.2s;
  vertical-align: middle;
}

.icon-btn:hover i {
  color: #7289da;
}

.tab-btn-container {
    position: fixed;
    top: 1em;
    right: 1em;
    z-index: 1000;
}

.download-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  width: 100%;
}

.nice-btn {
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nice-btn:hover {
  background: #005fa3;
}

.logo-img {
  width: 120px;
  margin-bottom: 1em;
}

#backToTop {
  display: none;
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 9999;
  font-size: 24px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}
#backToTop:hover {
  opacity: 1;
}