/* /assets/css/desktop.css */ 
/* ============================================
   Global + Reset
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Optional debug outline: */
    /* outline: 1px solid red; */
}

html, body {
    font-family: Arial, sans-serif;
    height: 100%;
    width: 100%;
    /* Remove outer scrollbars */
    overflow: hidden; 
}

/* ============================================
   CSS Variables
============================================ */
:root {
    --panel-background-image: url('/assets/img/AxiaBA-Umbrella.png');
    --panel-background-opacity: 0.24;
    --ribbon-opacity: 0.8;
    --header-height: 64px;
    --footer-height: 40px;
    --logo-width: 160px;
    --settings-icon-width: 50px;
    --dropdown-shift: calc((var(--logo-width) - var(--settings-icon-width)) / -6);
}

/* ============================================
   Page Container
============================================ */

.page-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    box-sizing: border-box;
}

.page-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - var(--footer-height)); 
    background-image: var(--panel-background-image);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: var(--panel-background-opacity);
    transition: background-image 0.5s ease, opacity 0.3s ease;
    z-index: -1;
}

/* ============================================
   Overview Panel
============================================ */

.overview-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    height: calc(100vh - var(--header-height) - var(--footer-height));
}

.overview-panel > * {
    position: relative;
    z-index: 1;
}

/* ============================================
   Header Styles
============================================ */

.page-header {
    background-color: #fff;
    padding: 10px 20px;
    display: grid;
    grid-template-areas: 'logo dropdown header-right';
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-logo {
    grid-area: logo;
    margin: 0;
    padding: 0;
}
.views-dropdown-container {
    grid-area: dropdown;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    left: var(--dropdown-shift);
}
.header-right-icons {
    grid-area: header-right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem; /* space between icons */
}

/* Product Logo styling */
.product-logo a {
    position: relative;
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
}
.product-logo a img {
    display: inline-block;
    transition: filter 0.3s ease;
    height: 44px;
    max-width: var(--logo-width);
    width: auto;
}
.product-logo a:hover img,
.product-logo a:focus img {
    filter: brightness(1.2);
}

/* Views Dropdown */
.views-dropdown-container {
    flex: 1;
}
.views-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px;
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
}
.views-dropdown select {
    padding: 0 !important;
    margin: 0 !important;
    border: none;
    background: transparent;
    outline: none;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
}
.views-dropdown select::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Ribbons, Control Panel, Footer, etc. */
.upper-ribbon,
.lower-ribbon {
    display: none;
    background-color: #007bff;
    height: 5px;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ribbon {
    background-color: rgba(245,245,245,.9);
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}
.ribbon-header-content {
    display: flex;
    align-items: center;
    width: 100%;
}
.toggle-icon {
    cursor: pointer;
    font-size: 18px;
    user-select: none;
    flex-shrink: 0;
}
.ribbon-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding-left: 10px;
    display: inline-block;
}
.delete-all-link {
    margin-left: auto;
    color: #007bff;
    text-decoration: none;
}
.delete-all-link:hover {
    text-decoration: underline;
}
.ribbon-container {
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}
.ribbon-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.ribbon-table th,
.ribbon-table td {
    border: 1px solid #ddd;
    padding: 8px;
}
.ribbon-table th {
    background-color: #f2f2f2;
    text-align: left;
}
.ribbon-table tr:nth-child(even) {
    background-color: #f9f9f9;
}
.ribbon-table tr:hover {
    background-color: #ddd;
}
.editable-cell {
    width: 100%;
    box-sizing: border-box;
    padding: 4px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    overflow: hidden;
    background-color: #fff;
}
.editable-cell:focus {
    background-color: #eef;
    border-color: #007bff;
    outline: none;
}

.text-input-container,
.feedback-content {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0 10px 10px 10px;
    background-color: #f9f9f9;
    border: 2px solid #ccc;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.2),
                2px 2px 8px rgba(0,0,0,0.1);
    transition: height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    height: auto;
    opacity: 1;
    overflow: hidden;
}
.text-input-container.collapsed,
.feedback-content.collapsed {
    height: 0;
    padding: 0;
    opacity: 0;
}
.text-input-container.expanding,
.feedback-content.expanding {
    height: auto;
    padding: 10px;
    opacity: 1;
}
.text-input-container.hidden,
.feedback-content.hidden {
    display: none;
}
textarea#multi-line-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

/* Control Panel */
.control-panel {
    position: relative;
    height: 100%;
    background-color: #ddd;
    overflow: hidden;
    transition: width 0.3s ease-in-out, max-width 0.3s ease-in-out;
    border-top-right-radius: 15px;
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2),
                2px 2px 8px rgba(0,0,0,0.1),
                2px 2px 12px rgba(0,0,0,0.25);
    z-index: 10;
    flex-shrink: 0;
}
.control-panel.expanded {
    width: 18%;
    min-width: 144px;
    overflow-y: auto;
}
.control-panel.collapsed {
    width: 28px;
    min-width: 28px;
    overflow-y: hidden;
}
.panel-container {
    display: flex;
    flex-grow: 1;
    width: 100%;
    position: relative;
    height: calc(100vh - 110px);
}
.panel-title {
    text-align: center;
    padding: 10px;
    font-size: 18px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
    color: #333;
}
.control-panel.expanded .panel-title {
    visibility: visible;
    opacity: 1;
}
.collapsed-title {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 18px;
    color: #333;
    white-space: nowrap;
    text-align: center;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
    cursor: default;
    user-select: none;
    margin-left: 5px;
}
.control-panel:not(.expanded):hover .collapsed-title {
    opacity: 0;
    color: #007bff;
}
.control-panel.expanded .collapsed-title {
    visibility: hidden;
    opacity: 0;
}
.pin-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 24%;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    z-index: 20;
}
.pin-toggle::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #333;
    border-radius: 24%;
    transition: background-color 0.3s ease;
}
.pin-toggle.pinned {
    background-color: #007bff;
    border-color: #007bff;
}
.pin-toggle.pinned::before {
    background-color: white;
}
.tab-options {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}
.tab-options .list-group-item {
    cursor: pointer;
    padding: 15px;
    border: 1px solid #ddd;
    margin: 0 10px 10px 10px;
    text-align: center;
    background-color: #fff;
    transition: background-color 0.2s ease;
    visibility: hidden;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    border-radius: 4px;
}
.control-panel.expanded .list-group-item {
    visibility: visible;
    opacity: 1;
}
.tab-options .list-group-item:hover {
    background-color: #e9ecef;
}
.tab-options .list-group-item.active {
    background-color: #007bff;
    color: #fff;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}
.tab-options .list-group-item:focus,
.tab-options .list-group-item:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Footer */
.page-footer {
    background-color: #007bff;
    color: #fff;
    text-align: center;
    padding: 3px;
    border-top: 1px solid #0056b3;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

/* Spinner, Buttons, etc. */
.spinner {
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none;
    margin-left: 10px;
    vertical-align: middle;
}
.spinner.visible {
    display: inline-block;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#send-all-btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0px 4px 6px rgba(0,0,0,0.1);
}
#send-all-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0px 6px 8px rgba(0,0,0,0.2);
}
#save-data-btn {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0px 4px 6px rgba(0,0,0,0.1);
    margin-left: 10px;
}
#save-data-btn:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0px 6px 8px rgba(0,0,0,0.2);
}
#save-data-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* ============================================
   Responsive for Mobile
============================================ */
/* ============================================
   Responsive for Mobile
============================================ */
@media (max-width: 618px) {
    /* Hide the entire control panel on mobile */
    .control-panel {
        display: none !important;
    }
    .panel-container {
        display: block;
        width: 100%;
    }

    /* Add small margins in the overview panel */
    .overview-panel {
        width: auto;
        max-width: 480px;
        margin: 0 auto;
        padding: 20px 8px;
    }

    /* Two-row header: Row #1 = logo + icons, Row #2 = dropdown */
    .page-header {
        padding: 6px 12px; 
        grid-template-areas:
            "logo header-right"
            "dropdown dropdown";
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        justify-items: start;
    }

    /* ✅ Fix: Ensure the views dropdown is centered */
    .views-dropdown-container {
        left: 0 !important;    /* Remove any inherited left shift */
        justify-self: center;  /* Center horizontally in the second row */
        width: 100%;           /* Make it full width */
        display: flex;
        justify-content: center;  /* Ensure perfect centering */
        margin: 4px 0 0;
    }

    .views-dropdown {
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 4px; /* Reduce padding for minimal height */
    }
    .views-dropdown select {
        width: 100%;  /* Ensure the dropdown itself spans full width */
        font-size: 16px;
    }

    .product-logo {
        grid-area: logo;
        justify-self: start;
        margin: 0;
    }
    .product-logo a img {
        height: 36px;
        max-width: 120px;
    }

    .header-right-icons {
        grid-area: header-right;
        justify-self: end;
        gap: 0.4rem;
        margin-bottom: 0;
    }
    .settings, .help {
        width: 36px;
        height: 36px;
    }
    .icon {
        font-size: 1.2em;
    }
}


/* Accessibility, etc. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
