/* -----------------------
   Color Palette
--------------------------
   Off-white: #f5f9f9
   Blue:      #008f91
------------------------ */

/* Define Root Variables */

:root{
    --firstClr: #E6D9C8;
    --secondClr: #00243a;
    --thirdClr: #f8f8f8;
    --fourthClr: #4a86a8;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-weight: 400;
}

/* -----------------------
   Header Section
------------------------ */
.navbar {
    height: 80px;
    background-color: var(--thirdClr);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

.navbar__container {
    display: flex;
    justify-content: space-between;
    height: 80px;
    z-index: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 50px;
}

#navbar__logo {
    color: var(--secondClr);
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    font-size: 2rem;
}

.navbar__menu {
    display: flex;
    align-items: center;
    list-style: none;
    text-align: center;
}

.navbar__links {
    position: relative;
    color: var(--secondClr);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0 1rem;
    height: 100%;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.navbar__links::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px; /* Thickness of the underline */
    width: 100%;
    background-color: var(--fourthClr);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.navbar__links:hover {
    color: var(--fourthClr);
}

.navbar__links:hover::after {
    transform: scaleX(1);
}

.navbar__btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    width: 100%;
}

.button {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    padding: 10px 20px;
    height: 100%;
    width: 100%;
    border: none;
    outline: none;
    border-radius: 4px;
    background: var(--secondClr);
    color: var(--thirdClr);
    border: 1px solid var(--secondClr);
}

.button:hover {
    background: var(--thirdClr);
    color: var(--secondClr);
    transition: all 0.3s ease;
    border: 1px solid var(--secondClr);
}

@media screen and (max-width: 960px) {
    .navbar__container {
        background-color: var(--thirdClr);
        display: flex;
        justify-content: space-between;
        height: 80px;
        z-index: 1;
        width: 100%;
        max-width: 1300px;
        padding: 0;
    }

    .navbar__menu {
        display: grid;
        grid-template-columns: auto;
        margin: 0;
        width: 100%;
        position: absolute;
        top: -1000px;
        opacity: 0;
        transition: all 0.5s ease;
        height: 50vh;
        z-index: -1;
    }

    .navbar__menu.active {
        background: var(--secondClr);
        top: 100%;
        opacity: 1;
        transition: all 0.5s ease;
        z-index: 999;
        height: 50vh;
        font-size: 1.6rem;
    }

    .navbar__container.active {
        background-color: var(--secondClr);
        transition: all 0.5s ease;
    }

    #navbar__logo {
        padding-left: 25px;
    }

    #navbar__logo.active {
        color: var(--thirdClr);
        transition: all 0.5s ease;
    }

    .navbar__toggle .bar {
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        background: var(--secondClr);
    }

    .navbar__item {
        width: 100%;
    }

    .navbar__links {
        text-align: center;
        padding: 2rem;
        width: 100%;
        display: table;
        color: var(--thirdClr);
        font-size: 1.5rem;
    }

    #mobile-menu {
        position: absolute;
        top: 20%;
        right: 5%;
        transform: translate(5%, 20%);
    }

    .navbar__btn {
        padding-bottom: 2rem;
    }

    .button {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 80%;
        height: 80px;
        margin: 0;
    }

    .navbar__toggle .bar {
        display: block;
        cursor: pointer;
    }

    #mobile-menu.is-active .bar:nth-child(2) {
        opacity: 0;
        background-color: white;
    }

    #mobile-menu.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: white;
    }

    #mobile-menu.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: white;
    }
}

/* =======================
   Dropdown Menu Styles
========================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--thirdClr);
    min-width: 220px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
}

.dropdown-menu li {
    border-bottom: 1px solid #ddd;
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-link {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--secondClr);
    transition: background-color 0.3s ease;
}

.dropdown-link:hover {
    background-color: var(--fourthClr);
    color: var(--thirdClr);
}

/* Show dropdown on hover (desktop) */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* Mobile behavior */
@media screen and (max-width: 960px) {
    .dropdown-menu {
        display: none;
    }
}

/* =======================
   Hero Section
========================== */
.hero-section {
    min-height: 95vh;
    background-color: var(--thirdClr);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h1 {
    font-size: 5rem;
    color: var(--secondClr);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
}

.hero-content a {
    text-decoration: underline;
    color: var(--secondClr);
    transition: color 0.3s ease;
}

.hero-content a:hover {
    color: var(--fourthClr);
}

.hero-content img {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 1rem 0;
    border-radius: 5px;
}

/* =======================
   Responsive Hero
========================== */
@media screen and (max-width: 768px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }
}

/* =======================
   Footer
========================== */
.footer {
    background-color: var(--thirdClr);
    color: #666;
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #ccc;
    font-size: 0.9rem;
    height: 5vh;
}

/* =======================
   Image Grid Section
========================== */
.image-grid-section {
    padding: 2rem;
    background-color: var(--thirdClr);
    text-align: center;
}

.grid-header {
    font-size: 5rem;
    color: var(--secondClr);
    margin-bottom: 2rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.03);
}

.grid-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.grid-item h3 {
    padding: 1rem;
    font-size: 1.2rem;
    color: var(--secondClr);
}

/* Responsive: Stack on Mobile */
@media screen and (max-width: 1024px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
}

/* =======================
   Contact Form Section
========================== */

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

form label {
    font-weight: bold;
    color: var(--secondClr);
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="date"],
form textarea {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
}

form textarea {
    min-height: 100px;
    resize: vertical;
}

form input[type="submit"] {
    background-color: var(--secondClr);
    color: white;
    border: none;
    padding: 10px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

form input[type="submit"]:hover {
    background-color: var(--fourthClr);
}

.honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* =======================
   A4 Page (plotting)
========================== */

/* Mobile form layout */
@media screen and (max-width: 768px) {
    form {
        padding: 1rem;
    }
}

/* Make results and plot area mobile-friendly */
#results {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--secondClr);
    text-align: left;
    width: 100%;
    max-width: 600px;
}

/* Plot container responsive */
#plot {
    width: 100% !important;
    max-width: 800px;
    height: 400px;
    margin-top: 1.5rem;
}

/* On smaller screens shrink height a bit */
@media screen and (max-width: 768px) {
    #plot {
        height: 300px;
    }
}

/* =======================
   Spirograph Section
========================== */

.spirograph-content {
  max-width: 900px;
  margin: 1rem;
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.spirograph-content h2 {
  font-size: 2.5rem;
  color: var(--secondClr);
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.spiro-controls {
  margin-bottom: 1.5rem;
}

.spiro-controls input {
  width: 70px;
  margin: 0 5px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.spiro-controls .button {
  padding: 5px 15px;
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
  margin-top: 10px;
}

.spiro-controls .button:hover {
  cursor: pointer;
}

.stop-btn {
  background-color: #c62828;
  border: 1px solid #c62828;
}

.stop-btn:hover {
  background-color: #fff;
  color: #c62828;
  border: 1px solid #c62828;
}

#spiroCanvas {
  border: 1px solid #ccc;
  background: var(--thirdClr);
  margin-top: 1rem;
  width: 100%;
  width: 100%;
  height: 100%;
}

/* ----------------------
   Pokémon Table Styles
------------------------ */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filters input, select {
    padding: 8px 12px;
    border: 1px solid var(--secondClr);
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.filters input:focus {
    border-color: var(--fourthClr);
    box-shadow: 0 0 5px rgba(0, 143, 145, 0.5);
}

#pokemonTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    color: var(--secondClr);
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

#pokemonTable th, 
#pokemonTable td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,1);
}

#pokemonTable th {
    background-color: var(--secondClr);
    color: var(--thirdClr);
    font-weight: 600;
}

#pokemonTable tr:nth-child(even) {
    background-color: rgba(0, 143, 145, 0.1);
}

#pokemonTable tr:hover {
    background-color: rgba(0, 143, 145, 0.2);
}

@media screen and (max-width: 768px) {
    #pokemonTable th, #pokemonTable td {
        padding: 8px;
        font-size: 0.9rem;
    }

    .filters input {
        width: 100%;
    }
}


/* ----------------------
   Drag & Drop Cards
------------------------ */

#deck {
    margin: 5px auto;
    min-height: 160px;
}

.card {
    max-width: 100px;
    max-height: 140px;
    display: inline-block;
    cursor: grab;
}

.card img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid #333;
    background-color: white;
}

#drop-area {
    width: 600px;
    height: 350px;
    margin: 30px auto;
    border: 3px dashed black;
    border-radius: 10px;
    background-color: var(--fourthClr);
    line-height: 200px;
    color: var(--secondClr);
    font-size: 18px;
    overflow: scroll;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#drop-area::-webkit-scrollbar {
  display: none;
}

#drop-area p {
    position: absolute;
}

@media screen and (max-width: 768px) {
    #drop-area {
        width: 90%;
    }
}

/* ----------------------
   Assignment 9
------------------------ */

#myCanvas {
    border: 1px solid var(--secondClr);
    box-shadow: 0px 0px 10px var(--secondClr);
}

