/* =============================================================
   shared.css
   Global layout shell + shared component styles.

   VIEWPORT MODEL
   ==============
   The goal is zero document-level scroll on every page.
   Only the table inside TodaysPlays (.odds-table-scroll) scrolls.

   Stack:
     <html>  height:100%, overflow:hidden
       <body>  height:100%, flex column, overflow:hidden
         <header>            flex-shrink:0
         <div.page-shell>    flex:1, overflow:hidden
           <div.page-main>   flex:1, overflow:hidden
             <div.container> flex:1, overflow:hidden
               <main>        flex:1, overflow:hidden
         <footer>            flex-shrink:0
   ============================================================= */

/* -- Base ------------------------------------------------------ */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #212529;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0;
}

/* -- Layout shell ---------------------------------------------- */
body > header {
    flex-shrink: 0;
}

body > .page-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;         /* scroll when viewport is too short */
    min-height: 0;
}

body > .page-shell > .page-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
}

body > .page-shell > .page-main > .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body > .page-shell > .page-main > .container > main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body > footer {
    flex-shrink: 0;
    line-height: 60px;
}

/* -- Navbar centred title ------------------------------------- */
.navbar-title-block {
    flex: 1;                    /* grow to fill space between logo and profile icon */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
    min-width: 0;               /* allow text to shrink on small screens */
}

.navbar-title-main {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0d6efd;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Shrink title on very narrow screens to avoid overlap */
@media (max-width: 600px) {
    .navbar-title-main { font-size: 1.5rem; }
}

/* -- Profile dropdown ----------------------------------------- */
.nav-profile {
    flex-shrink: 0;             /* never shrink the profile icon */
    position: relative;
}

.nav-profile-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.nav-profile-btn:hover,
.nav-profile-btn:focus {
    opacity: 0.8;
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.nav-profile-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Dropdown panel — hidden by default */
.nav-profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    padding: 0.4rem 0;
    animation: profileDropIn 0.15s ease;
}

.nav-profile-dropdown--open {
    display: block;
}

@keyframes profileDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dropdown items */
.nav-profile-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1.1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    color: #212529;
    cursor: pointer;
    transition: background 0.12s ease;
}

.nav-profile-item:hover:not(:disabled) {
    background: #f0f4ff;
    color: #0d6efd;
}

.nav-profile-item:disabled {
    color: #adb5bd;
    cursor: default;
}

/* Danger / logout item */
.nav-profile-item--danger {
    color: #dc3545;
}

.nav-profile-item--danger:hover {
    background: #fff0f0;
    color: #b02a37;
}

/* Thin separator line above logout */
.nav-profile-divider {
    height: 1px;
    background: #dee2e6;
    margin: 0.3rem 0;
}

/* Expandable Account & Security parent item */
.nav-profile-item--expandable {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-profile-item--expandable::after {
    content: '?';
    font-size: 0.7rem;
    transition: transform 0.15s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.nav-profile-item--expandable[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

/* Submenu container */
.nav-profile-submenu {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    padding: 0.2rem 0;
}

/* Indented sub-items */
.nav-profile-item--sub {
    padding-left: 2rem;
    font-size: 0.9rem;
    color: #495057;
}

.nav-profile-item--sub:hover:not(:disabled) {
    background: #e8f0fe;
    color: #0d6efd;
}

/* -- Navbar logo ---------------------------------------------- */
.navbar-logo {
    height: 80px;
    width: auto;
    display: block;
}

/* -- Header theme ---------------------------------------------- */
.gg-header {
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gg-header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0d6efd;
    letter-spacing: 0.5px;
}

/* -- Footer theme ---------------------------------------------- */
.gg-footer {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* -- Focus rings ----------------------------------------------- */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #0d6efd;
}

/* -- Loading overlay ------------------------------------------- */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.loading-content {
    background: #ffffff;
    color: #212529;
    padding: 1.5rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* -- Login / Register modals ----------------------------------- */
#loginModal .modal-content,
#registerModal .modal-content {
    border-radius: 10px;
    background: #ffffff;
    color: #212529;
}

#loginModal .modal-header,
#registerModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1.25rem 1.5rem;
}

#loginModal .modal-footer,
#registerModal .modal-footer {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
}
