/* === Macao Theme Colors === */
:root {
    /* Core brand tones (inspired by Macao’s architecture, jade tiles & casino gold) */
    --primary: #004b8d;          /* Deep jade green – symbolizing heritage & balance */
    --primary-dark: #002f5f;     /* Darker forest green for contrast */
    --accent: #e63946;           /* Soft golden hue – hints of prosperity & elegance */
    --accent-light: #ff7b8a;     /* Lighter warm gold for highlights */
    
    /* Background & text palette – elegant yet modern */
    --bg: #0c0d11;               /* Deep neutral charcoal background */
    --fg: #f5f7fa;               /* Off-white foreground text */
    --muted: #9ca2ad;            /* Muted gray for subtext */
    --card: #1a1c22;             /* Slightly warm dark card background */
    --text: #2b2e34;             /* Dark neutral gray text */
    --light-text: #70737a;       /* Soft muted text */
    --link-muted: #b32638;       /* Warm gold for links or subtle accents */
}


/* === Base === */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background: var(--bg);
    color: var(--fg);
    transition: background 0.3s ease, color 0.3s ease;
}

/* === Link Style Reset & Theme Integration === */
a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
    outline: none;
}

a:active {
    opacity: 0.6;
    transform: scale(0.98);
}

a:hover,
a:focus {
    color: var(--accent);
    opacity: 0.85;
    outline: none;
}


.filter-controls {
    display: flex;
    justify-content: center;
    gap: 0.5em;
    margin: 0.8em 0;
}

.filter-controls input {
    background-color: var(--link-muted);
    padding: 0.4em;
    font-size: 0.95em;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 350px;
    transition: all 0.2s ease;
}

.filter-controls input::placeholder {
    color: rgba(230, 240, 230, 0.55);
}

.filter-controls input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--link-muted);
    box-shadow: 0 0 6px var(--accent-glow);
    color: #f8fff9;
}


/* === Fixed Header and Hero === */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Green Hero section */
.hero {
    text-align: center;
    padding: 0.8rem 1rem 0.8rem;
    background-color: var(--primary);
    color: #f6f7fb;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.hero h1 {
    margin: 0;
    font-size: 1.5rem;
}

.hero p {
    margin: 0;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.85);
}

.hero-title-link {
    color: inherit;
    text-decoration: none;
}

.hero-title-link:hover,
.hero-title-link:focus {
    color: inherit;
    text-decoration: none;
}

/* === Main Navigation (fully inside green area) === */
main.container {
    margin-top: var(--header-height, 200px);
    padding-top: 10px;
}

.main-nav {
    width: 92%;
    max-width: 1100px;
    margin: 0.1rem auto 0.8rem;
    background: rgba(10, 10, 10, 0.56);
    border-radius: 16px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
}

/* Keep it stable in fixed layout */
header.shrink .main-nav {
    background: rgba(15, 15, 15, 0.95);
    padding: 8px 16px;
}


/* === Buttons === */
.menu-toggle,
.theme-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--fg);
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2100;
}

.menu-toggle:hover,
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* === Nav Links (Desktop) === */
.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.nav-links li a {
    color: #f6f7fb;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.25s, transform 0.25s;
}

.nav-links li a:hover {
    opacity: 0.85;
    transform: scale(1.05);
    color: var(--accent);
}


/* === Hamburger btn hide on wider screen === */
@media (min-width: 801px) {
    .menu-toggle {
        display: none;
    }

    .nav-links {
        display: flex !important;
        justify-content: center;
        flex: 1;
        gap: 24px;
    }

    .main-nav {
        justify-content: center;
    }
}


/* === Mobile Layout === */
@media (max-width: 800px) {
    .main-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 98%;
        bottom: -10px;
        padding: 10px 16px;
    }

    .menu-toggle,
    .theme-toggle {
        position: static;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        background: rgba(15, 15, 15, 0.88);
        border-radius: 0 0 16px 16px;
        padding: 10px 12px;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    }

    .nav-links a {
        color: #f6f7fb;
        text-decoration: none;
        font-weight: 600;
        padding: 10px 14px;
        border-radius: 8px;
        transition: var(--light-text) 0.2s ease;
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .main-nav.expanded .nav-links {
        display: flex;
    }
}


.trip-title-date {
  display: flex;
  justify-content: space-between; /* separates items to left and right */
  align-items: center; /* vertically centers them */
}

.trip-title {
    background: rgba(22, 99, 62, 0.15);
    display: inline-block;
    padding: 0.3em 0.8em;
}
.trip-date {
    font-weight: bold;
    color: #555;
    margin-bottom: 0.5em;
}


/* Matches .highlight-list indentation visually */
.trip-title+.highlight-list {
    margin-top: 0.3em;
}

/* Hover/Focus aesthetic */
.trip-title:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}


/* === Highlight List (between strong and attraction cards) === */
.highlight-list {
    margin: 0.4em 0 0.8em;
    padding: 0.6em 1em;
    font-size: 0.95em;
    font-weight: 500;
    line-height: 1.5;
    color: rgba(240, 255, 240, 0.85);

    background: rgba(22, 99, 62, 0.15);
    /* border-left: 1px solid var(--accent); */
    /* border-right: 1px solid var(--accent); */
    border-radius: 8px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Subtle hover effect for desktop */
.highlight-list:hover {
    background: rgba(93, 162, 113, 0.2);
    color: #f6f7fb;
}

.map-link {
    text-align: right;
    text-decoration: none;
    color: var(--link-muted);
}






.container {
    max-width: 900px;
    margin: 2em auto;
    padding: 0 1em;
}


.trip {
    background: var(--background);
    border-radius: 12px;
    margin: 0 0 2em;
    padding: 0.9em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.trip:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.attraction-card {
    padding: 0.5em;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--background);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    margin-top: 0.6em;
    margin-bottom: 0.6em;
    display: flex;
    align-items: flex-start;
    gap: 1em;
}

.attraction-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.01);
}

.attraction-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.attraction-card-content {
    flex: 1;
    padding: 0.2em;
}

.attraction-name {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 0.2em;
}

.attraction-name a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.attraction-name a:hover {
    color: var(--accent);
}

.description {
    font-size: 0.95em;
    margin-bottom: 0.1em;
    color: var(--light-text);
}

.description a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.detail-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.90em;
    padding: 0.3em 0;
    color: #555;
}


/* === Dark Mode Card Elevation === */
body:not(.light-mode) .highlight-list {
    background: rgba(18, 103, 74, 0.18);
    color: var(--accent-light);
    border-left-color: var(--accent-light);
}

body:not(.light-mode) .attraction-card {
    background: linear-gradient(180deg, #18191c 0%, #121314 100%);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 6px rgba(255, 255, 255, 0.05);
    /* faint outer glow for lift */
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* edge definition */
    transition: box-shadow 0.3s ease, transform 0.25s ease;
}

body:not(.light-mode) .attraction-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.6),
        0 0 10px rgba(255, 255, 255, 0.08);
}

body:not(.light-mode) .attraction-name a {
    color: var(--primary);
}

body:not(.light-mode) .description {
    color: #ec7c708b;
}

/* === Dark Mode Section Contrast Enhancements === */
body:not(.light-mode) .trip {
    background: linear-gradient(180deg, #111213 0%, #0d0d0e 100%);
    border-radius: 12px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 255, 255, 0.03);
    padding: 1em;
    margin-bottom: 1.8em;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body:not(.light-mode) .trip:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.6),
        0 0 10px rgba(255, 255, 255, 0.05);
}

body:not(.light-mode) .trip-date {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.3px;
    /* border-left: 4px solid var(--accent); */
    padding-left: 0.6em;
}

body:not(.light-mode) .trip-title {
    color: var(--accent);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    font-weight: 600;
    letter-spacing: 0.3px;
    border-left: 4px solid var(--accent);
    padding-left: 0.6em;
}

body:not(.light-mode) .trip-title:hover {
    color: var(--accent-light);
}


@media (hover: none) and (pointer: coarse) {
    .attraction-card:active {
        transform: scale(0.96);
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
        background-color: rgba(22, 99, 62, 0.07);
        transition-timing-function: cubic-bezier(0.3, 0.7, 0.4, 1);
    }
}


.detail-line.address {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.4em;
}

/* The first span is the label ("Address"), second span is the content */
.detail-line.address span:first-child {
    flex: 0 0 auto;
    font-weight: 600;
    margin-right: 0.3em;
}

.detail-line.address span:last-child {
    flex: 1 1 100%;
    text-align: right;
    word-break: break-word;
    line-height: 1.4;
}

/* --- On narrow screens --- */
@media (max-width: 768px) {
    .detail-line.address {
        flex-direction: row;
        align-items: flex-start;
    }

    .detail-line.address span:first-child {
        flex-basis: auto;
    }

    .detail-line.address span:last-child {
        text-align: right;
        display: block;
    }
}


/* For hours */
.detail-line.hours span:nth-child(1)::before {
    content: "🕒 ";
}

/* .detail-line.hours span:nth-child(2)::before {
  content: "📅 ";
} */

/* For address */
.detail-line.address span:nth-child(1)::before {
    content: "🏢 ";
}

.detail-line.address span:nth-child(2)::before {
    content: "📍 ";
}

/* For phone */
.detail-line.phone span:nth-child(1)::before {
    content: "☎️ ";
}

/* For Ticket */
.detail-line.ticket span:nth-child(1)::before {
    content: "🎫 "
}

/* For Route */
.detail-line.route span:nth-child(1)::before {
    content: "🚗 "
}


/* === Footer === */
.footer {
    text-align: center;
    padding: 1em;
    color: var(--muted);
    font-size: 0.9em;
}


/* Light mode refinement */
body.light-mode .trip-title {
    color: var(--primary);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

body.light-mode .trip-title:hover {
    color: var(--accent-light);
}


/* === Light Mode === */
body.light-mode {
    --bg: #f4f6fa;
    --fg: #0c0d11;
    --card: #ffffff;
    --primary: #0066b2;
    --accent: #ff5c70;
    --accent-light: #ff90a0;
    --muted: #7a8089;
    --light-text: #555b63;
    --link-muted: #cc4b5c;
    background: var(--bg);
    color: var(--fg);
}

body.light-mode .hero {
    background-color: var(--primary);
    color: #f6f7fb;
}

/* Light mode refinement */
body.light-mode .highlight-list {
    background: #12674a26;
    color: #cd6868;
    border-left-color: var(--accent);
}


/* === Back to Top Floating Button === */
.back-to-top {
    position: fixed;
    bottom: 20px;
    /* lower-right corner */
    right: 20px;
    z-index: 3000;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    /* square with rounded edges */
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.4s ease,
        transform 0.2s ease,
        background 0.3s ease;
}

/* when visible */
.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

/* hover or touch feedback */
.back-to-top:hover,
.back-to-top:active {
    background: var(--accent-light);
    transform: translateY(-3px);
}

/* dark mode adjustment */
body:not(.light-mode) .back-to-top {
    background: var(--accent);
    color: #0b0b0c;
}

body:not(.light-mode) .back-to-top:hover {
    background: var(--accent-light);
    color: #fff;
}