/* ============================================================
   ATLANTIS B&B — STYLES (refactored layout v6)
   - Nav is SEPARATE from header and main.
   - Nav top touches header bottom.
   - Nav right border touches main's left border (no overlap).
   - Nav "floats" down the page on scroll (handled in JS).
   - Nav never reaches the footer (clamped in JS + min-height here).
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* body style and image */
body {
    background-image: url(../images/water.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-color: #003049;
    margin: 0;
    padding: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: #FFF5EE;
    min-height: 100vh;
}

/* wrapper styling */
#wrapper {
    max-width: 960px;
    width: 100%;
    opacity: 0.97;
    margin: auto;
    color: #FFF5EE;
    box-shadow: 0 12px 40px rgba(0, 20, 40, 0.55);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   HEADER — spans full wrapper width, sits flush with content row
   ============================================================ */
header {
    width: 100%;
    margin: 0;
}

h1 {
    background-image: url(../images/logo2.png);
    background-repeat: no-repeat;
    background-size: auto 100%;
    background-position: left center;
    background-color: #001f33;
    height: 280px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 5em;
    padding-left: 480px;
    padding-right: 32px;
    text-shadow: 4px 4px 10px #F4A460, 0 0 24px rgba(255, 127, 80, 0.45);
    text-align: right;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    color: #FFD700;
    letter-spacing: 0.04em;
    font-weight: bold;
}

/* ============================================================
   CONTENT ROW — holds the nav column and main side-by-side.
   No grid gap: nav and main borders touch.
   ============================================================ */
.content-row {
    position: relative;
    display: grid;
    grid-template-columns: 192px 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    /* Tall enough that floating-nav scroll behavior is always reachable. */
    min-height: 900px;
    align-items: stretch;
}

/* NAV COLUMN — reserves the 192px space the nav lives in.
   The actual <nav> is positioned: fixed and slid by JS,
   but on first paint it sits inside this column. */
.nav-column {
    position: relative;
    background-color: transparent;
    width: 192px;
    height: 100%;
}

/* ============================================================
   NAV — separate floating element.
   - Top edge touches the header (top: header-bottom in JS).
   - Right edge touches main's left edge.
   - Sticks/slides down with viewport scroll (JS lerp).
   ============================================================ */
nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 192px;
    font-size: 1.15rem;
    background: linear-gradient(180deg, #00657a 0%, #014b5c 100%);
    border-right: 3px solid #FF7F50;
    border-top: 2px solid #FF7F50;
    box-shadow: 6px 0 18px -8px rgba(255, 127, 80, 0.55);
    z-index: 20;
    /* JS will translateY on this; transition handled in JS via lerp */
    will-change: transform, top;
}

/* Floating state — switched on by JS once the user scrolls past header */
nav.is-floating {
    position: fixed;
    border-bottom: 2px solid #FF7F50;
    border-left: 2px solid #FF7F50;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

nav li {
    padding: 0;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 127, 80, 0.45);
    background-color: transparent;
    width: 100%;
    position: relative;
    overflow: hidden;
}

nav li::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 127, 80, 0.22) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

nav li:hover::before {
    transform: translateX(100%);
}

nav a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 12px 14px 14px;
    text-decoration: none;
    color: #FFD700;
    letter-spacing: 0.04em;
    transition: color 0.25s ease, text-shadow 0.25s ease, padding-left 0.25s ease;
    position: relative;
    z-index: 1;
}

/* Small trident icon before every nav link */
nav a::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    background: url(../images/trident.png) no-repeat center / contain;
    filter: drop-shadow(0 0 4px rgba(255, 127, 80, 0.7));
    flex-shrink: 0;
    transition: transform 0.3s ease, filter 0.3s ease;
}

nav a:hover::before {
    transform: rotate(-12deg) scale(1.15);
    filter: drop-shadow(0 0 8px rgba(102, 244, 255, 0.9));
}

nav a:visited { color: #FFD700; }
nav a:hover {
    color: #66f4ff;
    text-shadow: 0 0 10px rgba(102, 244, 255, 0.7);
    padding-left: 20px;
}
nav a:active { color: #FF7F50; }

/* ============================================================
   MAIN — sits right next to nav with NO overlap.
   ============================================================ */
main {
    background: linear-gradient(180deg, rgba(0, 80, 100, 0.92) 0%, rgba(0, 50, 70, 0.96) 100%);
    min-height: 720px;
    padding: 28px 28px 40px;
    min-width: 0; /* prevent grid bleed */
    border-left: 3px solid #00d4ff;
    box-shadow: inset 6px 0 12px -8px rgba(0, 212, 255, 0.35);
}

/* style paragraphs */
p {
    margin: 15px 10px;
    padding: 12px 16px;
    background: rgba(0, 31, 51, 0.65);
    border: 2px solid #00d4ff;
    border-radius: 4px;
    outline: 1px dashed rgba(255, 215, 0, 0.4);
    outline-offset: 6px;
    color: #FFD700;
    line-height: 1.55;
}

/* headings */
h2, h3 {
    padding: 8px 4px;
    color: #66f4ff;
    text-align: left;
    text-shadow: 0 0 12px rgba(102, 244, 255, 0.35);
    margin: 12px 0 8px;
    letter-spacing: 0.02em;
}
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }
h4 { color: #FFD700; margin-top: 12px; }

main ul {
    margin: 12px 24px;
    color: #FFF5EE;
    line-height: 1.7;
}

main ul li { margin: 6px 0; }

main dl { margin: 10px 0; }
main dt { color: #FFD700; font-weight: bold; margin-top: 10px; }
main dd { margin-left: 18px; color: #FFF5EE; }

/* images */
img {
    padding: 0;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

a img {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
a img:hover {
    transform: scale(1.02);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.5);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: linear-gradient(180deg, #001f33 0%, #000d14 100%);
    color: #66f4ff;
    padding: 20px;
    text-align: center;
    font-size: 0.9em;
    font-style: italic;
    border-top: 2px solid #00d4ff;
    width: 100%;
}
footer a { color: #FFD700; text-decoration: none; }
footer a:hover { color: #66f4ff; }

/* image classes */
.center {
    display: block;
    margin: 14px auto;
    width: 60%;
    border: 2px solid #00d4ff;
}
.responsive {
    width: 70%;
    max-height: 45%;
    display: block;
    margin: 14px auto;
    border: 2px solid #00d4ff;
}
.cave, .sea {
    display: block;
    margin: 14px auto;
    width: 80%;
    border: 2px solid #00d4ff;
}

/* container for the flex row */
.container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

/* tables */
.table-wrapper { overflow-x: auto; }
table {
    margin: 18px auto;
    border: 2px solid #00d4ff;
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    background: rgba(0, 31, 51, 0.5);
}
table:hover { opacity: 1.0; }
th {
    font-weight: bold;
    text-align: left;
    color: #FFD700;
    padding: 12px;
    background: rgba(0, 50, 70, 0.85);
    border-bottom: 2px solid #00d4ff;
}
td {
    padding: 10px 12px;
    font-family: Georgia, serif;
    font-size: 1em;
    border: 1px solid rgba(0, 212, 255, 0.25);
    color: #FFF5EE;
}
tr:hover td { background-color: rgba(0, 212, 255, 0.18); }
tr:nth-of-type(even) td { background-color: rgba(0, 31, 51, 0.5); }

/* FORMS */
form {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    width: 100%;
    gap: 1em;
}
form label {
    color: #FFD700;
    font-weight: bold;
    margin-bottom: -6px;
}
input[type=text],
input[type=email],
input[type=tel],
textarea {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #00d4ff;
    border-radius: 4px;
    font-size: 16px;
    background-color: rgba(0, 20, 35, 0.75);
    color: #FFF5EE;
    padding: 12px 16px;
    transition: 0.3s ease-in-out;
    font-family: Georgia, serif;
}
input[type=text]:focus,
input[type=email]:focus,
input[type=tel]:focus,
textarea:focus {
    outline: none;
    border-color: #66f4ff;
    box-shadow: 0 0 14px rgba(102, 244, 255, 0.55);
    background-color: rgba(0, 31, 51, 0.85);
    color: #FFF5EE;
}
textarea { min-height: 90px; }

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}
.button-container button {
    width: 140px;
    height: 44px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.06em;
    background: linear-gradient(180deg, #00657a 0%, #014b5c 100%);
    color: #FFD700;
    border: 2px solid #00d4ff;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.button-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.45);
    color: #66f4ff;
}

@keyframes pulse-border {
    0%   { border-color: rgba(255, 215, 0, 0.3); }
    50%  { border-color: rgba(255, 215, 0, 0.95); }
    100% { border-color: rgba(255, 215, 0, 0.3); }
}
#focus-input {
    border: 2px solid #66f4ff;
}
#flash-input {
    animation: pulse-border 2.5s infinite;
    border: 2px solid #FFD700;
}

/* Inline status under the form */
.form-status {
    min-height: 1.4em;
    text-align: center;
    font-weight: bold;
    margin-top: 6px;
    letter-spacing: 0.04em;
}
.form-status.pending { color: #66f4ff; }
.form-status.error   { color: #FF7F50; }

/* Thank-you confirmation panel shown after a successful submission */
.thank-you {
    margin: 24px auto;
    padding: 32px 28px;
    max-width: 640px;
    text-align: center;
    background: linear-gradient(180deg, rgba(0, 80, 100, 0.85) 0%, rgba(0, 31, 51, 0.92) 100%);
    border: 3px solid #FF7F50;
    border-radius: 8px;
    box-shadow: 0 0 36px rgba(255, 127, 80, 0.45), inset 0 0 24px rgba(102, 244, 255, 0.15);
    animation: thanks-pop 0.5s ease-out;
}
.thank-you h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.4em;
    color: #FFD700;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.55), 2px 2px 4px #001f33;
    margin: 0 0 14px;
    letter-spacing: 0.04em;
    text-align: center;
}
.thank-you p {
    font-size: 1.4em;
    color: #66f4ff;
    background: transparent;
    border: none;
    outline: none;
    padding: 4px;
    margin: 0 0 22px;
    letter-spacing: 0.08em;
    font-style: italic;
    text-shadow: 0 0 14px rgba(102, 244, 255, 0.6);
}
.thank-you button {
    padding: 12px 22px;
    font-weight: bold;
    background: linear-gradient(180deg, #00657a 0%, #014b5c 100%);
    color: #FFD700;
    border: 2px solid #FF7F50;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.thank-you button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 127, 80, 0.55);
    color: #66f4ff;
}
@keyframes thanks-pop {
    0%   { transform: scale(0.92); opacity: 0; }
    60%  { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* sections backgrounds (legacy hooks) */
#cave {
    height: 500px;
    width: 70%;
    background-image: url(../images/cave.jpeg);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
#sea {
    height: 500px;
    width: 70%;
    background-image: url(../images/thesea.jpeg);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media screen and (max-width: 768px) {
    .content-row {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .nav-column {
        width: 100%;
        height: auto;
    }
    nav {
        position: relative !important;
        transform: none !important;
        width: 100%;
        top: 0 !important;
        left: 0 !important;
        border-right: none;
        border-bottom: 3px solid #00d4ff;
    }
    nav.is-floating { position: relative !important; }
    nav ul { flex-direction: row; flex-wrap: wrap; justify-content: space-around; }
    nav li { border-bottom: 1px solid rgba(0, 212, 255, 0.35); flex: 1 1 40%; }
    main { border-left: none; border-top: 3px solid #00d4ff; }
    h1 {
        height: auto;
        min-height: 120px;
        font-size: 2em;
        padding: 18px 14px;
        background-image: none;
        text-align: center;
        justify-content: center;
    }
    .center, .responsive, .cave, .sea { width: 95%; }
}

/* tablet */
@media screen and (min-width: 769px) and (max-width: 1023px) {
    .content-row { grid-template-columns: 160px 1fr; }
    .nav-column { width: 160px; }
    nav { width: 160px; font-size: 1rem; }
    h1 {
        height: 200px;
        font-size: 2.4em;
        padding-left: 340px;
    }
}
