:root {
    /* Durham-inspired palette */
    --durham-purple: #6E3B87;
    /* Primary */
    --durham-light: #B18FCF;
    /* Accent */
    --durham-lighter: #E9D8F2;
    /* Background accent */
    --text-dark: #1c1c1c;
    --text-light: #ffffff;
    --bg-light: #faf8fc;
    --bg-dark: #3b3b3b;
    --card-bg: #ffffff;
    --border-radius: 10px;
    --font-main: 'Inter', sans-serif;
    --transition: 0.25s ease;
}

/* New Estimate Style */
.status-estimate {
    color: #666;
    font-style: italic;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* Defining the fadeIn animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutDown {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

.emoji-wiggle {
  display: inline-block;
  animation: spin-wiggle 0.6s ease-in-out forwards; /* total 0.6s */
}

@keyframes spin-wiggle {
  0%   { transform: rotate(0deg) scale(1); }
  30%  { transform: rotate(45deg) scale(1.25); }   /* spin forward */
  70%  { transform: rotate(-45deg) scale(1).25; }   /* spin backwards */
  100% { transform: rotate(0deg) scale(1); }     /* spin reset */
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER + NAV */
header,
footer {
    background-color: var(--durham-purple);
    color: var(--text-light);
    text-align: center;
    padding: 1.5rem 1rem;
}

header h1 {
    color: var(--durham-lighter);
    margin: 0;
}

nav a {
    color: var(--text-light);
    margin: 0 1rem;
    text-decoration: none;
    font-weight: 600;
}

nav a.active,
nav a:hover {
    color: var(--durham-light);
}

/* MAIN */
main {
    flex: 1;
    padding: 2rem;
    text-align: center;
}

.hero {
    margin-bottom: 2rem;
}

.venue-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* VENUE CARDS */
.venue-card {
    display: none;
    background: var(--card-bg);
    border: 1px solid #e5e5e5;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition), box-shadow var(--transition);
    opacity: 0;
}

.fade-in-up {
    display: block;
    animation: fadeInUp 0.5s ease forwards;
}

.fade-out-down {
    animation: fadeOutDown 0.3s ease forwards; /* ← forwards keeps the final state */
}

/* Make venue cards display as a list on small screens */
@media (max-width: 600px) {
    .venue-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch; /* Make each card fill available width */
    }

    .venue-card {
        text-align: left; /* Better readability for list layout */
        padding: 1rem 1.2rem;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        width: 100%; /* Ensure full width */
        opacity: 0; /* start invisible */
    }

    .venue-card h3 {
        margin-top: 0;
        font-size: 1.1rem;
    }

    .venue-card p {
        margin: 0.25rem 0;
        font-size: 0.95rem;
    }

    .venue-card .report-btn {
        width: 100%; /* Make the report button full width on mobile */
        margin-top: 0.5rem;
    }
}

.venue-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.status {
    font-weight: 600;
    margin: 0.5rem 0;
}

.status-packed {
    color: red;
}

.status-busy {
    color: orange;
}

.status-moderate {
    color: green;
}

.status-quiet {
    color: lightgreen;
}

.status-unknown {
    color: lightgrey;
}

.status-black {
    color: black;
}

.report-btn,
.submit-btn {
    background-color: var(--durham-purple);
    color: var(--text-light);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-weight: bold;
    transition: background-color var(--transition);
    display: block;      /* allows margin auto to work */
    margin: 1rem auto 0; /* top margin optional, auto horizontal */
}

.report-btn:hover,
.submit-btn:hover {
    background-color: var(--durham-light);
}

/* FORM */
form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.form-group {
    margin-bottom: 1rem;
}

select,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    background: #fff;
    color: var(--text-dark);
    transition: border-color var(--transition);
}

select:focus,
input:focus {
    border-color: var(--durham-purple);
    outline: none;
}

input[type="checkbox"] {
    margin-right: 0.5rem;
}

.radio-group label {
    display: block;
    margin: 0.25rem 0;
}

/* FOOTER */
footer {
    font-size: 0.9rem;
    color: var(--durham-lighter);
}

/* RESPONSIVENESS */
@media (max-width: 600px) {
    main {
        padding: 1.2rem;
    }

    .venue-card {
        padding: 1.2rem;
    }

    form {
        padding: 1.5rem;
    }

}

/* LOGO & HEADER REWORK */
header {
    position: relative; /* allows absolute positioning inside */
}

.logo {
    position: absolute;
    left: 1rem;         /* keeps it on the left side */
    top: 50%;           /* vertically center */
    transform: translateY(-50%); /* perfectly centers the logo vertically */
    height: 64px;       /* adjust as needed */
    width: auto;
    background-color: transparent;

}

.weather {
    position: absolute;
    right: 2rem;         /* keeps it on the left side */
    top: 50%;           /* vertically center */
    transform: translateY(-50%); /* perfectly centers the logo vertically */
    height: 64px;       /* adjust as needed */
    width: auto;
    background-color: transparent;

}

/* SEARCH BAR REWORK */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Ensure the search bar container is constrained */
.search-section {
    width: 100%;              /* Make sure it takes full available width */
    max-width: 100%;          /* Allow the container to scale with the screen */
    margin: 0 auto;           /* Center the search bar horizontally */
    padding: 1rem;            /* Add some padding for spacing */
    overflow: hidden;         /* Prevent any overflow issues */
}

/* Ensure the input element inside doesn't overflow */
#venue-search {
    width: 100%;              /* Ensure it fills the container */
    padding: 0.75rem;         /* Add padding inside the search bar */
    font-size: 1rem;          /* Make sure text is legible */
    border-radius: var(--border-radius);
    border: 1px solid #ccc;
    background: #fff;
    color: var(--text-dark);
    transition: border-color var(--transition);
    display: block;           /* Ensure the input fills the parent container */
}

/* Styling for the Crowd Filter Section */
#crowd-filter {
    width: 100%;              /* Ensure it takes up the full width */
    max-width: 100%;          /* Allow it to scale with the screen size */
    margin: 1rem auto;        /* Center the section with margin */
    padding: 1rem;            /* Padding around the section */
    display: block;
}

/* Label for the entire filter */
#crowd-filter label {
    font-size: 1.1rem;        /* Slightly larger font for label */
    font-weight: bold;        /* Make label bold */
    display: block;           /* Make the label block to take full width */
    margin-bottom: 0.8rem;    /* Space below label */
    color: var(--text-dark);  /* Dark text color */
}

#crowd-section {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease;
}
#crowd-section.visible {
    opacity: 1;
    max-height: 500px; /* set to something bigger than the content height */
}

/* Styling for the select dropdown */
#crowdLevel {
    width: 100%;              /* Ensure it fills the container */
    padding: 0.75rem;         /* Same padding as the search bar */
    font-size: 1rem;          /* Ensure text is legible */
    border-radius: var(--border-radius); /* Matching border-radius */
    border: 1px solid #ccc;  /* Same border style as search bar */
    background: #fff;         /* White background */
    color: var(--text-dark);  /* Dark text color */
    transition: border-color var(--transition); /* Smooth transition */
    display: block;           /* Ensure it fills the parent container */
    appearance: none;         /* Remove default styling of dropdown */
    -webkit-appearance: none; /* Ensure consistent appearance across browsers */
    -moz-appearance: none;    /* Firefox compatibility */
    box-sizing: border-box;   /* Ensure padding doesn't affect width */
}

/* Ensure the dropdown has a similar style when focused as the search bar */
#crowdLevel:focus {
    border-color: var(--durham-purple);
    outline: none;
}

/* Responsive styling for small screens */
@media (max-width: 600px) {
    .search-section {
        padding: 0.5rem;       /* Adjust padding for smaller screens */
    }

    #venue-search,
    #crowdLevel {
        font-size: 0.9rem;      /* Adjust font size for mobile */
    }

    /* Reduce padding on #crowd-filter for small screens to prevent size shrink */
    #crowd-filter {
        padding: 0.5rem;        /* Reduce padding to match smaller screen size */
    }
}

.toggle-wrapper {
  display: flex;
  justify-content: center;  /* centers everything horizontally */
  align-items: center;       /* vertically centers the text and toggle */
  gap: 1rem;                 /* adds space between the labels and toggle */
  text-align: center;
  margin-bottom: 1rem;
}

.toggle-wrapper p {
  margin: 0;                 /* remove extra margin on the labels */
  font-weight: bold;
}

.toggle-checkbox {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  z-index: 1;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.toggle-container {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: .375em;
  width: 3em;
  height: 1.5em;
  background-color: var(--durham-purple);
  box-shadow: 
    inset 0 0 .0625em .125em rgb(255 255 255 / .2),
    inset 0 .0625em .125em rgb(0 0 0 / .4),
  ;
  transition: background-color .4s linear;
}

.toggle-button {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: .0625em;
  border-radius: .3125em;
  width: 1.375em;
  height: 1.375em;
  background-color: #e4ddcf;
  box-shadow:
    inset 0 -.0625em .0625em .125em rgb(0 0 0 / .1),
    inset 0 -.125em .0625em rgb(0 0 0 / .2),
    inset 0 .1875em .0625em rgb(255 255 255 / .3),
    0 .125em .125em rgb(0 0 0 / .5),
  ;
  transition: left .4s/*cubic-bezier(.65, 1.35, .5, 1)*/;
}

.toggle-button-circles-container {
  display: grid;
  grid-template-columns: repeat(3, min-content);
  gap: .125em;
  position: absolute;
  margin: 0 auto;
}

.toggle-button-circle {
  border-radius: 50%;
  width: .125em;
  height: .125em;
  background-image: radial-gradient(circle at 50% 0, #f6f0e9, #bebcb0);
}

.toggle-checkbox:checked ~ .toggle-container {
  background-color: grey;
}

.toggle-checkbox:checked ~ .toggle-button {
  left: 1.5625em;

}