/****** Finance Screen CSS (derived from KPI Dashboard) ******/
/* Global font: Modern, readable, and universal */
html, body,
button, #counter, .wrap_buttons,
h1, .title_wrap, .container,
#menu, #menu ul, #menu li, #menu h3 {
    font-family: 'Inter', 'Roboto', Arial, sans-serif !important;
    font-weight: 400;
}

/* Restore Material Icons font for icon elements */
.material-icons {
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

/* Headings and basic layout */
h1 {
    color: black;
    font-weight: 600;
}
.title_wrap img {
    height: 2.5rem;
}

* { box-sizing: border-box; }

html { background-color: #F2E8D9; }

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

/* Frames */

.iframe_container { width: 100%; height: 100%; background-position: center; background-repeat: no-repeat; }

/* Iframe Title */
#iframe-title {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    z-index: 1000;
    text-align: center;
    max-width: 80%;
    backdrop-filter: blur(10px);
}

.iframe_container #counter {
    right: 10px;
    bottom: 55px;
    position: absolute !important;
    width: 50px;
    height: 18px;
    line-height: 6px;
    border-radius: 5px;
    font-weight: 600;
}

/* Hide only the outer iframes used by the legacy flow */
#iframe_container > iframe,  #iframe_container > div {
  border: none;
  width: 100%;
  height: 100%;
  display: none;
  background: transparent;
}

/* Show only the active outer iframe */
#iframe_container > iframe.active { display: block; }
#iframe_container > div.active { display: block; }


/* (Optional) keep container positioned for overlays like #counter */
.iframe_container { position: relative; }


/* Button styles */
button, .wrap_buttons button {
    padding: 0;
    width: 50px;
    height: 40px;
    border-radius: 8px;
    color: #fff;
    background-color: #1976d2;
    font-size: 0.95em;
    border: 0;
    cursor: pointer;
    margin: 0;
    vertical-align: middle;
    line-height: 1;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure icons inside buttons are centered */
button .material-icons {
    line-height: 1;
    height: 24px;
}

.wrap_buttons {
    z-index: 2;
    position: relative;
}

/* Hide the whole control bar when chrome is disabled (e.g. unattended screens) */
body.controls-hidden .wrap_buttons,
body.controls-hidden #autoplay-countdown { display: none !important; }

/* Hide the burger button when the menu is disabled */
body.menu-disabled #burger-btn { display: none !important; }

/* Fixed button placements - evenly spaced with 5px gaps */
#next        { right: 120px;  bottom: 10px; position: fixed; }
#pause, #play { right: 175px; bottom: 10px; position: fixed; }
#play        { display: none; }
#prev        { right: 230px; bottom: 10px; position: fixed; }
#counter     { right: 285px; bottom: 10px; position: fixed; }
#counter {
    font-size: 0.9em !important;   /* or e.g. 13px */
    text-align: center !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#info-btn {
    position: fixed;
    bottom: 10px;
    right: 65px;
    cursor: pointer;
    border: 0;
}

#burger-btn {
    position: fixed;
    bottom: 10px;
    right: 10px;
    cursor: pointer;
    border: 0;
}
#burger-btn span {
    display: block;
    position: absolute;
    height: 3px;
    width: 24px;
    background: #fff;
    border-radius: 5px;
    opacity: 1;
    left: 50%;
    transform: translateX(-50%);
    transition: 0.25s ease-in-out;
}
#burger-btn span:nth-child(1) { top: 12px; }
#burger-btn span:nth-child(2), #burger-btn span:nth-child(3) { top: 19px; }
#burger-btn span:nth-child(3) { top: 26px; }
#burger-btn.open span:nth-child(1) { top: 19px; transform: translateX(-50%) rotate(45deg); }
#burger-btn.open span:nth-child(2) { opacity: 0; }
#burger-btn.open span:nth-child(3) { top: 19px; transform: translateX(-50%) rotate(-45deg); }

/* --- Menu Styles --- */
#menu {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    min-width: 600px;
    max-width: 90vw;
    width: auto;
    background-color: #e3edf7;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s ease;
    border-left: 3px solid #1976d2;
    display: flex;
    flex-direction: column;
    padding: 20px;
    font-size: 1.06em;
    overflow-y: auto;
}
#menu li {
    margin-bottom: 7px;
    cursor: pointer;
    font-size: 0.80em;
}
#menu li.active-item {
    font-weight: 700;
    background: #e7f0fa;
    color: #1976d2;
}
#menu li:hover {
    color: #1976d2;
}
/* Badges shown beside menu items and category headers */
#menu .badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  font-size: 0.70em;
  border-radius: 999px;
  vertical-align: baseline;
}
#menu .badge-new { background: #e8f5e9; color: #2e7d32; }      /* green-ish */
#menu .badge-upd { background: #fff3e0; color: #ef6c00; }      /* amber-ish */
#menu.menu-hidden { transform: translateX(100%); }
#menu ol { padding-left: 25px; display: block;}
#menu h3 {
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: 0em;
    margin-bottom: 0.7em;
    color: #05396b;
    font-family: 'Inter', 'Roboto', Arial, sans-serif !important;
}

/* Search Box Styles */
.search-container {
    margin-bottom: 15px;
}

#dashboard-search {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #c5d9f0;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    transition: border-color 0.2s ease;
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
}

#dashboard-search:focus {
    outline: none;
    border-color: #1976d2;
}

#dashboard-search::placeholder {
    color: #999;
}

/* Favorite Star Styles */
.favorite-star {
    display: inline-block;
    cursor: pointer;
    font-size: 1.0em;
    margin-right: 8px;
    color: #ccc;
    transition: color 0.2s ease, transform 0.1s ease;
    user-select: none;
    font-family: 'Segoe UI Symbol', 'Symbola', 'DejaVu Sans', Arial, sans-serif !important;
    line-height: 1;
}

.favorite-star:hover {
    color: #ffd700;
    transform: scale(1.2);
}

.favorite-star.active {
    color: #ffd700;
}

#menu li {
    display: list-item;
    list-style-position: inside;
}

#menu li .menu-label {
    cursor: pointer;
}

/* Category Grid Container */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Category Section Styles */
.category-section {
    display: flex;
    flex-direction: column;
    background: #f5f9fc;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #d4e3f2;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #d4e3f2;
    margin-bottom: 10px;
    font-weight: 600;
    color: #05396b;
    user-select: none;
}

.category-header .badge {
    font-size: 0.70em;
    margin-left: 4px;
}

.category-name {
    flex: 1;
    font-size: 0.90em;
}

.category-count {
    font-size: 0.75em;
    color: #5a7fa3;
    font-weight: 500;
}

.category-list {
    padding-left: 20px;
    list-style: decimal;
    margin: 0;
}

.logout, .more-reports-link {
    font-size: 0.8em;
  color: #1976d2;                 /* typical blue link color */
  text-decoration: underline;      /* underline text */
  cursor: pointer;                 /* show pointer on hover */
  text-underline-offset: 2px;      /* optional: separate rule for spacing */
  transition: color 0.2s;
  display: block;
}

.logout:hover {
  color: #0d47a1;                  /* darker or different color on hover */
  text-decoration-thickness: 2px;
  text-decoration-color: #1565c0;  /* underline color on hover (optional) */
}

/* Responsive tweaks */
@media screen and (max-width: 1300px) {
    .wrap_buttons { position: fixed !important; bottom: 10px; right: 10px; }
    .iframe_container button, #burger-btn { width: 50px; height: 40px; margin: 0; }
    #menu { min-width: 500px; }

    /* Maintain even spacing on smaller screens */
    #next        { right: 120px; }
    #pause, #play { right: 175px; }
    #prev        { right: 230px; }
    #counter     { right: 285px; }
    #info-btn    { right: 65px; }
    #burger-btn  { right: 10px; }
}

@media screen and (max-width: 900px) {
    #menu {
        min-width: 400px;
    }
    .categories-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 600px) {
    #menu {
        width: 100vw;
        min-width: unset;
    }
    .wrap_buttons { right: 10px; }
    .categories-grid {
        grid-template-columns: 1fr;
    }

    /* Tighter spacing on mobile to fit all buttons */
    button, .wrap_buttons button {
        width: 45px;
        height: 40px;
        margin: 0;
    }

    #burger-btn  { right: 5px; }
    #info-btn    { right: 55px; }
    #next        { right: 105px; }
    #pause, #play { right: 155px; }
    #prev        { right: 205px; }
    #counter     { right: 255px; width: 45px; }
}

#loading-overlay {
  position: fixed;
  z-index: 2147483647;
  top: 0; left: 0;
  height: 100vh; width: 100vw;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
  font-family: Inter, Arial, sans-serif;
}
#loading-message {
  font-size: 1.4rem;
  color: #444;
  padding: 2rem;
}

/* Autoplay Countdown: Always above burger button, fixed at bottom-right */
#autoplay-countdown {
    position: fixed;
    bottom: 55px;         /* positioned above the button row */
    right: 10px;          /* aligned with burger button */
    z-index: 110;
    font-size: 0.6em;
    background: transparent;
    color: #1976d2;
    display: none;
    pointer-events: none;
    text-align: center;
    min-width: 10px;
}

@media (max-width: 700px) {
  #autoplay-countdown {
    right: 10px;
    bottom: 55px;
    font-size: 0.9em;
    padding: 1px 7px;
  }
}

/* --- Info Pane Styles --- */
#info-pane {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 350px;
    background-color: #e3edf7;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
    transition: transform 0.3s ease;
    border-left: 3px solid #1976d2;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

#info-pane.info-pane-hidden {
    transform: translateX(100%);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #1976d2;
    background-color: #d4e5f7;
}

.info-header h3 {
    margin: 0;
    font-weight: 600;
    color: #05396b;
    font-size: 1.1em;
}

.info-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border-top: 2px solid #1976d2;
    background-color: #d4e5f7;
}

#info-feedback {
    background-color: #1976d2;
    color: #fff;
    border: none;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 15px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
}

#info-feedback:hover {
    background-color: #1565c0;
}

#info-close {
    background-color: #1976d2;
    color: #fff;
    border: none;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#info-close:hover {
    background-color: #1565c0;
}

.info-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.9em;
}

.info-row {
    margin-bottom: 15px;
}

.info-label {
    font-weight: 600;
    color: #05396b;
    margin-bottom: 4px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #333;
    padding: 8px 12px;
    background-color: #f5f9fc;
    border-radius: 4px;
    word-wrap: break-word;
}

.requests-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for requests list */
.requests-list::-webkit-scrollbar {
    width: 8px;
}

.requests-list::-webkit-scrollbar-track {
    background: #e3edf7;
    border-radius: 4px;
}

.requests-list::-webkit-scrollbar-thumb {
    background: #1976d2;
    border-radius: 4px;
}

.requests-list::-webkit-scrollbar-thumb:hover {
    background: #1565c0;
}

/* Firefox scrollbar */
.requests-list {
    scrollbar-width: thin;
    scrollbar-color: #1976d2 #e3edf7;
}

.request-item {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9em;
}

.request-item:last-child {
    border-bottom: none;
}

.request-field {
    margin-bottom: 6px;
    line-height: 1.4;
}

.request-field:last-child {
    margin-bottom: 0;
}

.request-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

.status-completed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-in-progress {
    background-color: #fff3e0;
    color: #ef6c00;
}

.status-backlog {
    background-color: #f5f5f5;
    color: #666;
}

.status-pending {
    background-color: #e3f2fd;
    color: #1976d2;
}

@media screen and (max-width: 600px) {
    #info-pane {
        width: 100vw;
    }
}

/* Toggle Completed Requests Checkbox */
.toggle-completed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    user-select: none;
}

.toggle-completed input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1976d2;
}

.toggle-completed:hover {
    background-color: #f0f7ff;
}
