/* ══════════════════════════════════════════════════════
   RHAPSODY – site.css
   ══════════════════════════════════════════════════════ */

/* ── Typography base ─────────────────────────────────── */
html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

/* ── Page structure: sticky nav + scrollable content ─── */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    font-family: "Poppins", sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;   /* fallback for older browsers */
    height: 100dvh;  /* dynamic viewport: adjusts as mobile browser chrome animates */
    overflow: hidden;
}
header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #fff;
}
.content-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative; /* positioning context for absolute children */
}

/* ── Focus rings ─────────────────────────────────────── */
.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(224, 122, 95, 0.35);
    outline: none;
}

/* ── Navbar ──────────────────────────────────────────── */
.navbar-toggler {
    border: none !important;
    box-shadow: none !important;
    padding: 6px 10px;
    color: #3D405B;
}
.navbar-toggler:focus { box-shadow: none !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%233D405B' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
.navbar-class {
    height: 68px;
    border-bottom: 1px solid #ebebeb !important;
    background-color: #fff !important;
}
@media (max-width: 576px) {
    .navbar-class {
        height: 68px;       /* fixed — collapse panel must not push this taller */
        min-height: 68px;
        position: relative; /* positioning context for the absolutely-placed panel */
        overflow: visible;  /* allow panel to overflow below the bar */
    }
}
.navbar-logo {
    color: #E07A5F !important;
    font-weight: 800 !important;
    font-size: 1.35rem;
    padding-left: 8px !important;
    letter-spacing: -0.3px;
}
.nav-link {
    font-size: 15px !important;
    color: #3D405B;
}
.nav-item-link {
    color: #3D405B;
    font-weight: 400;
    transition: color 0.15s;
}
.nav-item-link:hover { color: #E07A5F !important; }
.link-navbar { color: #E07A5F !important; }
.navbar-items { padding-left: 24px !important; }
.outlined-button {
    margin-left: 12px !important;
    margin-right: 16px !important;
    color: #E07A5F !important;
    border: 1.5px solid #E07A5F !important;
    border-radius: 20em !important;
    padding: 6px 22px !important;
    font-size: 14px !important;
    transition: background-color 0.18s, color 0.18s;
}
.outlined-button:hover {
    background-color: #E07A5F !important;
    color: #fff !important;
}

/* ── User avatar & nav dropdown ──────────────────────── */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #E07A5F;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-display-name {
    font-size: 14px;
    color: #3D405B;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-menu-toggle { padding: 4px 8px !important; }
.user-menu-toggle::after { color: #3D405B; }
.user-dropdown {
    border: 1px solid rgba(224, 122, 95, 0.2);
    border-radius: 0.65rem;
    box-shadow: 0 6px 20px rgba(61, 64, 91, 0.12);
    min-width: 160px;
    padding: 5px 0;
}
.user-dropdown .dropdown-item {
    color: #3D405B;
    font-size: 14px;
    padding: 8px 18px;
}
.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item:focus {
    background-color: #fdf0ed;
    color: #E07A5F;
}
.user-dropdown .dropdown-divider {
    border-color: rgba(224, 122, 95, 0.2);
    margin: 4px 0;
}
.user-dropdown button.dropdown-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn { border-radius: 20em; }

.btn-primary {
    background-color: #E07A5F;
    border-color: #E07A5F;
    color: #fff;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary:active:focus {
    background-color: #8b422f;
    border-color: #8b422f;
    color: #fff;
}
.btn-primary:focus {
    background-color: #E07A5F;
    border-color: #E07A5F;
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(224, 122, 95, 0.35);
}

.btn-secondary {
    color: #E07A5F;
    background-color: #fff;
    border-color: #E07A5F;
}
.btn-secondary:hover,
.btn-secondary:active {
    color: #fff;
    background-color: #E07A5F;
    border-color: #E07A5F;
}
.btn-secondary:focus {
    color: #E07A5F;
    background-color: #fff;
    border-color: #E07A5F;
    box-shadow: 0 0 0 0.25rem rgba(224, 122, 95, 0.25);
}

.btn-outline-primary {
    color: #E07A5F;
    border-color: #E07A5F;
}
.btn-outline-primary:hover {
    background-color: #E07A5F;
    border-color: #E07A5F;
    color: #fff;
}

.btn-outline-warning { border-radius: 20em; }
.btn-outline-danger  { border-radius: 20em; }
.btn-danger:hover    { background-color: #7d141e; border-color: #7d141e; }

/* Custom solid brand button (.button class used across views) */
.button {
    color: #fff;
    padding: 0.55em 1.8em;
    background-color: #E07A5F;
    border: none;
    border-radius: 20em;
    font-size: 0.9rem;
    transition: background-color 0.18s;
}
.button:hover { background-color: #8b422f; color: #fff; }

/* ── Forms ──────────────────────────────────────────── */
label {
    font-weight: 500;
    color: #b15b45;
}
/* Checkboxes and radios use normal text color */
.form-check-label {
    font-weight: 400;
    color: #3D405B;
}

.form-control {
    color: #3D405B;
    background-color: #fff;
    border: 1.5px solid #e07a5f61;
    border-radius: 0.5rem;
}
.form-control:focus {
    color: #3D405B;
    border-color: #E07A5F;
    box-shadow: 0 0 0 0.15rem rgba(224, 122, 95, 0.2);
}
textarea.form-control  { height: auto; resize: vertical; }
select.form-control    { height: auto; }
.form-check-input:focus { box-shadow: 0 0 0 0.15rem rgba(224, 122, 95, 0.35); }
::placeholder { color: rgba(224, 122, 95, 0.5); }
::-webkit-calendar-picker-indicator {
    background: url(https://cdn3.iconfinder.com/data/icons/linecons-free-vector-icons-pack/32/calendar-16.png)
        center / 80% no-repeat;
}

/* ── Page layout utilities ──────────────────────────── */
/* Consistent title row: heading left, action button right */
.container-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1.25rem;
}
.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #E07A5F;
    margin: 0;
}
/* Convenience spacing */
.label-class  { margin-top: 0.6rem; }
.input-class  { margin-bottom: 0.6rem; }
.break-word   { word-wrap: break-word; overflow-wrap: break-word; word-break: break-all; }

/* ── Cards ──────────────────────────────────────────── */
.card { border-radius: 0.75rem; }

/* ── Tables ─────────────────────────────────────────── */
.table thead th {
    background-color: #E07A5F;
    color: #fff;
    font-weight: 600;
}

/* ── Tags ──────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 3px 10px;
    margin: 2px;
    border: 1.5px solid #e07a5f;
    border-radius: 20px;
    color: #e07a5f;
    font-size: 0.8rem;
    white-space: nowrap;
    text-decoration: none;
}
.tag:hover {
    background-color: #e07a5f;
    color: #fff;
}

/* ── Landing page ────────────────────────────────────── */
.heading      { font-weight: 300; }
.sub-heading  { margin-top: 0.5em; padding: 0 10em; font-size: 20px; }
.landing-page-heading { margin-top: 3em; margin-bottom: 2em; padding: 0 5em; }
.explore-now-button {
    margin-top: 1em;
    color: #fff;
    padding: 0.7em 5em;
    background-color: #E07A5F;
    border: none;
    border-radius: 20em;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.18s;
}
.explore-now-button:hover { background-color: #8b422f; color: #fff; }

.image-container {
    background-image: url("../NewFolder/ladning-page-footer.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 576px) {
    /* Strip the desktop left-indent from the panel itself.
       Use compound selectors (no space) because .navbar-items IS .navbar-collapse —
       a descendant combinator would never match the element against itself. */
    .navbar-expand-sm .navbar-collapse.collapsing.navbar-items,
    .navbar-expand-sm .navbar-collapse.show.navbar-items {
        padding-left: 0 !important;
    }

    /* Each nav-item must be full-width so its child link's background
       fills edge-to-edge inside the panel */
    .navbar-expand-sm .navbar-collapse.collapsing .nav-item,
    .navbar-expand-sm .navbar-collapse.show .nav-item {
        width: 100%;
    }

    /* Mobile menu panel: absolutely positioned so it overlays content below
       the fixed-height navbar bar without ever changing the bar's own height.
       Target both .collapsing (during animation) and .show (fully open)
       so styles are present from the first frame of the slide-down. */
    .navbar-expand-sm .navbar-collapse.collapsing,
    .navbar-expand-sm .navbar-collapse.show {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background-color: #fff;
        width: 100%;
        margin-top: 0;
        padding: 0.25rem 0 0.75rem;
        border-top: 1.5px solid #f0e8e5;
        border-radius: 0;
        z-index: 1029;
        box-shadow: 0 8px 24px rgba(61, 64, 91, 0.1);
    }

    /* Nav links: brand dark text, coral hover */
    .navbar-expand-sm .navbar-collapse.collapsing .nav-link,
    .navbar-expand-sm .navbar-collapse.show .nav-link {
        color: #3D405B !important;
        font-weight: 500;
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
        border-radius: 0;
        transition: background-color 0.15s, color 0.15s;
    }
    .navbar-expand-sm .navbar-collapse.collapsing .nav-item-link:hover,
    .navbar-expand-sm .navbar-collapse.show .nav-item-link:hover {
        color: #E07A5F !important;
        background-color: #fdf0ed;
    }

    /* Outlined buttons (站長信箱 + 登入): keep coral brand theme.
       Must out-specificity the .nav-link rule above to preserve coral colour. */
    .navbar-expand-sm .navbar-collapse.collapsing .nav-link.outlined-button,
    .navbar-expand-sm .navbar-collapse.show .nav-link.outlined-button {
        color: #E07A5F !important;
    }
    .outlined-button {
        color: #E07A5F !important;
        border: 1.5px solid #E07A5F !important;
        border-radius: 20em !important;
        padding: 7px 22px !important;
        margin-left: 1.5rem !important;
        margin-right: 0 !important;
        margin-top: 0.15rem;
        margin-bottom: 0.35rem;
        width: auto;
        display: inline-block;
    }
    .outlined-button:hover {
        background-color: #E07A5F !important;
        color: #fff !important;
        border-color: #E07A5F !important;
    }

    /* Auth section (register / login): subtle top separator, left-align */
    .navbar-nav:nth-of-type(2) {
        margin-top: 0.25em;
        padding-top: 0.25em;
        border-top: 1px solid #f0e8e5;
        align-items: flex-start !important;
    }

    /* 註冊 link */
    .link-navbar {
        color: #E07A5F !important;
        padding: 0.7rem 1.5rem;
        width: 100%;
        display: block;
    }
    .link-navbar:hover {
        color: #b85a42 !important;
        background-color: #fdf0ed;
    }

    /* Override Bootstrap's navbar-light nav-link color */
    .navbar-light .navbar-nav .nav-link {
        color: #3D405B;
        font-weight: 500;
        font-size: 1rem;
    }

    /* User avatar toggle row in mobile */
    .navbar-expand-sm .navbar-collapse.collapsing .user-menu-toggle,
    .navbar-expand-sm .navbar-collapse.show .user-menu-toggle {
        padding: 0.65rem 1.5rem !important;
        border-radius: 0;
        width: 100%;
    }

    /* Stretch the dropdown's parent li to full width */
    .navbar-expand-sm .navbar-collapse.collapsing .nav-item.dropdown,
    .navbar-expand-sm .navbar-collapse.show .nav-item.dropdown {
        width: 100%;
    }

    /* User dropdown: flat/inline inside mobile menu, no floating panel */
    .navbar-expand-sm .navbar-collapse.collapsing .user-dropdown,
    .navbar-expand-sm .navbar-collapse.show .user-dropdown {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        border-top: 1px solid #f0e8e5 !important;
        border-radius: 0 !important;
        padding: 0.25rem 0 !important;
        margin: 0 !important;
        background-color: #fdf8f7;
        width: 100%;
        min-width: 0;
    }
    .navbar-expand-sm .navbar-collapse.collapsing .user-dropdown .dropdown-item,
    .navbar-expand-sm .navbar-collapse.show .user-dropdown .dropdown-item {
        padding: 0.6rem 2.5rem;
        font-size: 0.95rem;
    }
    .navbar-expand-sm .navbar-collapse.collapsing .user-dropdown .dropdown-item:hover,
    .navbar-expand-sm .navbar-collapse.collapsing .user-dropdown .dropdown-item:focus,
    .navbar-expand-sm .navbar-collapse.show .user-dropdown .dropdown-item:hover,
    .navbar-expand-sm .navbar-collapse.show .user-dropdown .dropdown-item:focus {
        background-color: #fde8e3;
        color: #E07A5F;
    }
    .navbar-expand-sm .navbar-collapse.collapsing .user-dropdown .dropdown-divider,
    .navbar-expand-sm .navbar-collapse.show .user-dropdown .dropdown-divider {
        margin: 4px 0;
        border-color: #f0e8e5;
    }
}

@media (max-width: 1024px) {
    .heading { font-size: 2.5em; }
    .album-container { flex-direction: column; }
    .album-info { width: 100% !important; }
    .album-details,
    .playlist-container { margin-top: 3em !important; margin-right: 15px !important; width: 100% !important; }
}

@media (max-width: 768px) {
    .heading    { font-size: 2.1em; }
    .sub-heading { margin-top: 0.5em; padding: 0 5em; font-size: 18px; }
}

@media (max-width: 743px)  { .sub-heading { margin-top: 2em; padding: 0 1em; } }

@media (max-width: 500px) {
    .heading    { font-size: 2em; }
    .sub-heading { font-size: 16px; }
    tr          { font-size: 0.8em; }
    .artist-img { width: 14em; height: 14em; }
}

@media (max-width: 425px) { .image-container { height: 33%; } }

@media (max-width: 382px) {
    .heading { font-size: 1.5em; }
    .sub-heading { font-size: 12px; }
    .explore-now-button { padding: 0.5em 3em; }
    .image-container { height: 28%; }
}

@media (max-width: 375px) {
    .heading { font-size: 1.9em; }
    .sub-heading { font-size: 16px; }
    .explore-now-button { padding: 1em 4em; }
    .image-container { height: 28%; }
}

@media only screen and (min-width: 360px) and (max-width: 360px)
                    and (min-height: 800px) and (max-height: 800px) {
    .image-container    { height: 32%; }
    .heading            { font-size: 1.8em; }
    .sub-heading        { font-size: 15px; }
    .explore-now-button { padding: 0.8em 3em; }
}

@media (max-width: 1145px) { .image-container { height: 40%; } }
@media (max-width: 1140px) { .image-container { height: 45%; } }
