/* RESET */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables */
:root {
    --primary-accent-color: #0044ff;
    --primary-accent-color-hover: #0033dd;
    --primary-text-color: #000;
    --secondary-text-color: #666;
    --dark-border-color: #ccc;
    --light-border-color: #e0e0e0;
    --light-background-color: #f7f7f7;
    --focus-outline-color: #3b82f6;
    --slate-foreground-color: #3167c5;
    --slate-background-color: #e4ecf3;
}

html,
body {
    height: 100%;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    background-color: var(--light-background-color);
    color: #333;
}

body > main > section:first-of-type {
    padding-top: 60px;
}

.show-only-on-mobile {
    display: none;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.main-column {
    flex: 1;
}

.main-column > h1,
.main-column > p {
    padding: 20px;
}

/* Headers */
h1.header-with-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-weight: 400;
}

h1.header-with-toolbar.tight {
    padding: 0 20px;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: white;
    color: var(--primary-text-color);
    border: 1px solid var(--dark-border-color);
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 40px;
    min-width: 40px;
    gap: 5px;
}

.btn-with-icon:hover {
    background: var(--light-background-color);
    border-color: var(--primary-accent-color);
    color: var(--primary-accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-with-icon:focus {
    outline: 3px solid var(--focus-outline-color);
    outline-offset: 2px;
}

.btn-with-icon:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-with-icon-text {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Side column fixed width */
.side-column {
    width: 300px;
    padding: 1rem;
    border-left: 1px solid #e0e0e0;
    background-color: #f3f3f3;
    transition: transform 0.3s ease-in-out;
}

.side-column .google-login-btn {
    margin-bottom: 30px;
}

.side-column nav {
    display: none;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 0 0 30px 0;
}

.side-column h3 {
    margin: 30px 0 10px 0;
    font-weight: 500;
}

.side-column h3:first-of-type {
    margin: 0 0 10px 0;
}

.side-column ul {
    list-style: none;
    padding: 0;
}

.side-column ul li {
    border-bottom: 1px solid #e0e0e0;
}

.side-column ul li:last-child {
    border-bottom: none;
}

.side-column ul a {
    text-decoration: none;
    color: #333333;
    padding: 10px;
    display: block;
}

.side-column nav ul a {
    padding: 15px 10px;
    text-align: center;
}

.side-column ul li:first-child a {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.side-column ul li:last-child a {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.side-column ul a:hover {
    color: var(--primary-accent-color);
    background-color: var(--slate-background-color);
}

.side-column form.logout-form {
    margin: 30px 0 0 0;
}

.side-column .btn-with-icon {
    width: 100%;
}

/* NAVBAR STYLES */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
}

.live-search-panel {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: auto;
    width: 80%;
    max-width: 1200px;
    max-height: calc(100vh - 100px);
    margin: 0 auto;
    background-color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    padding: 20px;
    border-bottom-right-radius: 10px;
    border-bottom-left-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1010;
}

.live-search-panel > div {
    flex: 1 1 250px;
    min-width: 250px;
    box-sizing: border-box;
}

.live-search-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.live-search-panel ul li {
    border-bottom: 1px solid #e0e0e0;
}

.live-search-panel ul li:nth-child(n+5) {
    display: none;
}

.live-search-panel ul li:last-child {
    border-bottom: none;
}

.live-search-panel ul li a {
    padding: 10px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    border-radius: 5px;
}

.live-search-panel ul li a:hover {
    background-color: #f0f0f0;
}

.live-search-panel ul li a span.search-subject {
    color: #333;
    font-weight: 500;
}

.live-search-panel ul li a:hover span.search-subject {
    color: var(--primary-accent-color);
}

.live-search-panel ul li a span.search-location {
    color: #555;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-accent-color);
    border: 1px solid var(--primary-accent-color);
    border-radius: 20px;
    padding: 10px 16px;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
    font-weight: 400;
    width: 100%;
}

.btn:hover {
    background-color: #0033dd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.navbar__logo img {
    display: block;
    width: 180px;
    height: 40px;
    object-fit: contain;
}

#thrillscore_logo {
    display: block;
}

#thrillscore_logo_loop_alone {
    display: none;
}

.navbar__links {
    list-style: none;
    display: flex;
    /* gap: 10px; */
    /* margin-left: 32px; */
    font-weight: 500;
}

.navbar__links a {
    text-decoration: none;
    color: #333;
    /* transition: color 0.3s; */
    border: 1px solid #fff;
    border-radius: 20px;
    display: block;
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.navbar__links a:hover {
    border-color: var(--primary-accent-color);
    background: var(--light-background-color);
    color: var(--primary-accent-color);
    border-radius: 20px;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar__search {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.navbar__search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
}

.navbar__avatar {
    margin-left: auto;
    display: flex;
    align-items: center;
    font-weight: 400;
    gap: 10px;
}

.navbar__avatar_profile_name {
    padding: 2px;
    text-align: right;
}

.navbar__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: block;
}

.navbar__avatar_num_credits_container {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    padding: 2px;
    margin-left: auto;
    width: fit-content;
}

.navbar__avatar_num_credits_container img {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.navbar__avatar button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.menu_toggle {
    display: none;
}

/* GOOGLE LOGIN BUTTON (reuse from earlier, but make sure it's still defined here) */
.google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 16px;
    color: #3c4043;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
    font-weight: 500;
    width: 100%;
}

.google-login-btn span {
    flex: 1;
    text-align: center;
}

.google-login-btn img {
    width: 20px;
    height: 20px;
}

.google-login-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

div.main-column-content-container {
    margin: 0 20px 20px 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
}

div.main-column-simple-container {
    margin: 0 20px 20px 20px;
}

div.parkRow {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

div.parkRowMainContainer {
    flex: 1 1 0;
}

div.parkRowMenuContainer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

div.parkRow:first-of-type {
    padding: 0 0 20px 0;
}

div.parkRow:last-of-type {
    padding: 20px 0 0 0;
    border-bottom: none;
}

div.parkName a {
    text-decoration: none;
    color: #000;
    font-weight: 500;
    font-size: 1.2rem;
}

div.parkName a:hover {
    color: var(--primary-accent-color);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

img.parkStar {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

img.parkStar:hover {
    cursor: pointer;
}

img.rotating {
    animation: spin 1s linear infinite;
    transform-origin: center;
}

ul.parkDetails {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #333;
    list-style: none;
    margin-top: 10px;
}

a.parkWebsite {
    text-decoration: none;
    color: #333;
}

a.parkWebsite:hover {
    text-decoration: underline;
    color: var(--primary-accent-color);
}

/* Contextual Menu */
.menu-wrapper {
    position: relative;
    display: inline-block;
}

.menu-trigger {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 12px;
}

.context-menu {
    position: absolute;
    top: 50%; /* Start vertical center */
    transform: translateY(-50%); /* Perfect vertical centering */
    right: 100%;     /* Anchor to the left edge of the button */
    margin-right: 10px; /* Offset by 10px to the left */
    padding: 0;
    list-style: none;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    display: none;
    min-width: 120px;
    z-index: 10;
}

.context-menu li a {
    display: block;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    cursor: pointer;
}

.context-menu li a:hover {
    background-color: #f0f0f0;
    color: var(--primary-accent-color);
}

/* Forms */
form.editor {
    margin: 0 auto;
    max-width: 800px;
    padding: 20px;
}

div.formRow {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    align-items: center;
}

div.formRow > div {
    width: 100%;
}

div.formRow label {
    display: block;
    margin-bottom: 5px;
}

div.formRow label.error {
    color: #ff0000;
    font-weight: 500;
}

div.formRow input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
}

div.formRow select {
    display: block;
    padding: 8px 36px 8px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("/static/img/chevron.svg");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

div.formRow3 select {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

div.formRow2 select {
    display: block;
    padding: 8px 36px 8px 12px; /* extra space on the right */
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    appearance: none;          /* removes default chevron */
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white url("data:image/svg+xml;utf8,<svg fill='gray' height='12' viewBox='0 0 24 24' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 12px center;
    background-size: 16px;
    cursor: pointer;
}

div.formRow span.inputUnit {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    display: block;
}

div.formRow input[type="submit"] {
    width: auto;
    cursor: pointer;
    background-color: var(--primary-accent-color);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 20px;
}

/* Grids of Cards */
.card-grid {
    --card-min-width: 240px;
    --card-max-width: 1fr;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), var(--card-max-width)));
    gap: 20px;
}

.card-grid.small {
    --card-min-width: 180px;
    --card-max-width: 0.5fr;
}

/* Card Styling */
.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.card-image {
    aspect-ratio: 16/9;
    width: 100%;
    object-fit: cover;
    display: block;
}

/*
.card-image.small {
    --card-image-height: 135px;
}
 */

.card-info {
    padding: 12px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
}

.card-link {
    text-decoration: none;
}

/* Stats */
.attraction-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    font-family: sans-serif;
    font-size: 0.95rem;
    background: #fff;
    padding: 20px;
    margin: 0 20px 20px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.attraction-stats dt {
    font-weight: bold;
    color: #333;
}

.attraction-stats dd {
    margin: 0;
    color: #555;
    text-align: right;
}

/* Photo Dropzone */

.dropzone {
    border: 5px dashed var(--slate-foreground-color);
    color: var(--slate-foreground-color);
    font-weight: 500;
    padding: 20px;
    margin: 20px;
    text-align: center;
    cursor: pointer;
    background-color: var(--slate-background-color);
    border-radius: 10px;
}

img.dropzone-image {
    display: block;
    margin: 10px auto;
    object-fit: contain;
    width: 200px;
    height: 140px;
}

img.dropzone-loader {
    display: none;
    margin: 10px auto;
    object-fit: contain;
    width: 200px;
    height: 140px;
}

.dropzone.dragover {
    border-color: #666;
    background-color: #e6e6e6;
}

/* Photo Page */

img.full-screen {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

div.photo-info-row {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Confirmation Dialog */
dialog::backdrop {
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
}

dialog {
    position: fixed; /* center in viewport regardless of scroll */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    border: 0;
    border-radius: 20px;
    padding: 20px;
    max-width: 520px;
    width: min(92vw, 520px);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    color: #333;
    background: #fff;
}

dialog button[value="confirm"] {
    background:#dc2626;
    color:#fff;
    border:0;
    padding:.55rem .8rem;
    border-radius:10px;
}

dialog button[value="cancel"]  {
    background:#374151;
    color:#e5e7eb;
    border:0;
    padding:.55rem .8rem;
    border-radius:10px;
}

dialog button:focus-visible {
    outline: 2px solid #9ca3af;
    outline-offset: 2px;
}

dialog form {
    margin: 0;
}

dialog h2 {
    margin: 0 0 .5rem;
    font: 600 1.1rem system-ui
}

dialog p {
    margin: 0 0 1rem;
}

dialog menu {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin: 0;
}

/* Ticket Check SVG */
.ticket-check {
    width: 100px;
    height: 100px;
}

.ticket-check:hover:not(.ticket-check-checking):not(.ticket-check-loading):not(.ticket-check-checked) {
    cursor: pointer;
}

.ticket-check-ticket {
    transform-origin: 50% 50%;
    transform: rotate(-20deg);
}

.ticket-check-ticket-background {
    fill: #999;
}

.ticket-check-ticket-border {
    stroke: #ccc;
}

.ticket-check:hover:not(.ticket-check-checking):not(.ticket-check-loading):not(.ticket-check-checked) .ticket-check-ticket-background {
    fill: var(--primary-accent-color);
}

.ticket-check-logo {
    fill: #ccc;
    opacity: 1;
    transition: opacity 1s ease;
}

.ticket-check-check {
    opacity: 0;
}

.ticket-check-spinner {
    fill: #999;
    display: none;
}

.ticket-check-loading .ticket-check-spinner {
    display: inline;
    animation: kfTicketCheckSpinnerStart 1s linear forwards, kfTicketCheckSpinnerForever 1s linear infinite;
    transform-origin: center;
}

.ticket-check-checking .ticket-check-ticket {
    animation: kfTicketCheckTicketChecking 0.7s linear forwards;
    transform-origin: center;
}

.ticket-check-checking .ticket-check-ticket-background,
.ticket-check-checked .ticket-check-ticket-background {
    fill: #00920d;
}

.ticket-check-checking .ticket-check-ticket-border,
.ticket-check-checked .ticket-check-ticket-border {
    stroke: #4eb457;
}

.ticket-check-checking .ticket-check-logo {
    opacity: 0;
}

.ticket-check-checking .ticket-check-check {
    animation: kfTicketCheckCheckChecking 0.7s ease-out forwards;
    transform-origin: center;
}

.ticket-check-checking .ticket-check-spinner {
    display: inline;
    animation: kfTicketCheckSpinnerChecking 1s linear forwards;
    transform-origin: center;
}

.ticket-check-checked .ticket-check-ticket {
    transform: rotate(370deg) scale(1);
}

.ticket-check-checked .ticket-check-logo,
.ticket-check-checked .ticket-check-spinner {
    display: none;
}

.ticket-check-checked .ticket-check-check {
    opacity: 1;
}

/* Footer */
footer.main-footer {
    border-top: 1px solid var(--light-border-color);
    padding: 20px;
    text-align: center;
}

footer.main-footer ul {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

footer.main-footer ul li a {
    text-decoration: none;
    color: #333;
}

footer.main-footer ul li a:hover {
    text-decoration: underline;
}

@keyframes kfTicketCheckSpinnerChecking {
    0% {
        opacity: 0;
        transform: scale(0.2);
    }
    50% {
        opacity: 0;
        transform: scale(0.2);
    }
    75% {
        opacity: 1;
        transform: scale(0.2);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

@keyframes kfTicketCheckCheckChecking {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    75% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kfTicketCheckTicketChecking {
    0% {
        transform: rotate(-20deg) scale(1);
    }
    50% {
        transform: rotate(175deg) scale(1.5);
    }
    100% {
        transform: rotate(370deg) scale(1);
    }
}

@keyframes kfTicketCheckSpinnerStart {
    0% {
        transform: rotate(0deg) scale(0.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes kfTicketCheckSpinnerForever {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive behavior for small screens */
@media (max-width: 992px) {
    .layout {
        position: relative;
    }

    .side-column {
        position: fixed;
        top: 60px;
        right: 0;
        height: calc(100% - 60px);
        transform: translateX(100%);
        box-shadow: -2px 0 5px rgba(0,0,0,0.2);
        z-index: 999;
        border-left: 1px solid #e0e0e0;
        overflow-y: auto;
    }

    .side-column.open {
        transform: translateX(0);
    }

    .navbar__avatar_details {
        display: none;
    }

    .menu_toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .navbar__logo img {
        width: 40px;
    }

    #thrillscore_logo {
        display: none;
    }

    #thrillscore_logo_loop_alone {
        display: block;
    }
}

@media (max-width: 576px) {
    .navbar__links {
        display: none;
    }

    .side-column nav {
        display: block;
    }

    a.parkWebsite {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    li.parkWebsite {
        flex-basis: 100%;
    }

    li.lastParkDetailSeparator {
        display: none;
    }

    div.main-column-content-container {
        margin: 0;
        padding: 20px;
        border-radius: 0;
    }

    div.main-column-simple-container {
        margin: 0;
    }

    img.full-screen {
        border-radius: 0;
        box-shadow: none;
    }

    div.formRow {
        flex-wrap: wrap;
    }

    .btn-with-icon:not(.dont-shrink) {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        min-height: auto;
    }

    .btn-icon:not(.dont-shrink) {
        margin-right: 0;
    }

    .btn-with-icon-text:not(.dont-shrink) {
        display: none;
    }

    .hide-on-mobile {
        display: none;
    }

    br.show-only-on-mobile {
        display: inline;
    }

    .live-search-panel {
        width: 100%;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }

    .live-search-panel div {
        width: 100%;
    }
}