﻿/* ── 1) Define your “major” colors as variables ── */
:root {
  --primary-color:   #00A68F;
  --secondary-color: #5ABFB9;
  --tertiary-color:  #a8fff9;
  --header-bg:       #384049;
  --footer-bg:       #384049;
  --link-color:      #4B5563;
  --text-muted:      #666;
}

/* ── 2) Make padding/borders count inside width calculations ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

select {
    color: var(--primary-color) !important;  /* sets the text color */
    background-color: #fff; /* optional */
}

/* Center content and customize box */
.swal2-popup {
    font-family: 'Nunito', sans-serif;
    border-radius: 12px;
    padding: 2rem;
    background-color: #f9f9f9;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    z-index: 11001 !important;
}

/* Title styling */
.swal2-title {
    font-size: 1.5rem;
    color: #333;
}

/* Button styling */
.swal2-confirm {
    background-color: #00bfa5 !important;
    color: #fff !important;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: bold;
    border: none;
    box-shadow: none;
}

.swal2-cancel {
    background-color: #ddd !important;
    color: #333 !important;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: bold;
    border: none;
    box-shadow: none;
}

/* Adjust icon spacing or color */
.swal2-icon {
    margin-top: 0;
}

/* Input styling if using Swal with inputs */
.swal2-input {
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 0.5rem;
    font-size: 1rem;
}


.full-container {
    width: 100%;
    max-height: calc(100vh - 120px);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ── 3) Reserve space for header + footer and base font ── */
body {
  margin: 0;
  padding-top:    70px;   /* height of header */
  font-family: Nunito, sans-serif !important;
}

.small-title{
    font-family: Nunito, sans-serif !important;
    font-size: 12px;
    font-weight: 600;
    color: #920f0f;
}

/* ── 4) Fixed header ── */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);  /* heavier shadow */
}
.site-header .logo {
  max-height: 60px;
  cursor: pointer;
}
.header-left,
.header-middle,
.header-right {
  display: flex;
  align-items: center;
}
.header-middle {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* or center/whatever you prefer */
}

.sub-title {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.25rem;
}
/* Account info (user name, role, etc.) */
.site-header .account-info {
    text-align: right;
    font-size: 0.9rem;
    line-height: 1.2;
    color: #444;
}

.site-header .account-info strong {
    display: block;
    color: #2c3e50;
}

.branding .title {
    font-family: 'Trebuchet MS', sans-serif;
    color: #000;
    font-size: 1.5em;
    font-weight: 900;
    margin-left: 10px;
}

.page-title {
  margin: 0;
  color: #999;
  font-size: 1.75rem;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
}

.account-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background-color: #f0f0f0;
    color: #333;
    font-family: 'Trebuchet MS', sans-serif;
    font-size: 0.9rem;
    cursor: default;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease;
}

.account-pill strong {
    font-size: 1rem;
    font-weight: bold;
    color: #2c3e50;
}

.account-pill:hover {
    background-color: #e0e0e0;
}

.user-info {
    margin: 0 30px;
    text-align: left;
    color: #fff;
    cursor: default;
}

.product-name a{
    color: var(--primary-color) !important;
}

a {
  color: #000 !important;
}

.user-info a{
    color: var(--secondary-color) !important;
}

.user-info .logged-user {
    display: block;
    font-weight: bold;
}
.user-info .company-name {
    display: block;
    font-size: 0.9em;
}

/* ── Developer label ── */
.dev-label {
  color: yellow;
  font-size: 12px;
}

/* Search Bar Layout */
.search-bar {
    padding: 10px 50px;
    background: #ccc;
    z-index: 1;
    text-align: left;
    height: 60px;
    margin: 0;
}

/* Center spinner at 35% of viewport width */
#loadingIndicator {
  display: none;               /* JS will flip to “block” */
  position: fixed;
  top: 50%;
  left: 35%; 
  transform: translate(-50%, -50%);
  z-index: 10002 !important;
  pointer-events: none;
  background: transparent; 
}

#loadingIndicator i.fa-spinner {
  font-size: 6rem;
  color: var(--primary-color);
}

#loadingIndicator::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.6);
  z-index: -1;
  display: none;
}

/* only tables with class="selectable" get these styles */
table.selectable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0; 
}

/* 3) Pin the header exactly at the top of the wrapper */
table.selectable thead th {
  position: sticky;
  top: 0;                    /* flush to the very top */
  z-index: 2;                /* above body rows */
  background: #384049;       /* match your header color */
  color: #fff;
}

table.selectable tfoot {
  min-height: 60px;
}

table.selectable tbody tr:nth-child(even) {
  background-color: #eee;
}

table.selectable tbody tr.selected {
  background-color: var(--secondary-color);
}

table.selectable tbody tr:hover {
  background-color: var(--secondary-color);
  cursor: pointer;
}

/* you can leave generic th/td rules alone, or scope them too: */
table.selectable th,
table.selectable td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

table.selectable th {
    background: #384049;
    color: #fff;
    font-size: 16px;
    font-weight: 300;
    white-space:nowrap;
}

/* if you had a footer-bar for that table you could scope it similarly */
.selectable-footer-bar {
  /* … */
}

/* make the wrapper scrollable */
.table-wrapper {
  max-height: 85vh;        /* or whatever fits your layout */
  overflow-y: auto;
  margin-top:0px;
}

/* keep the header stuck at the top of that scrollable area */
table.selectable thead th {
  position: sticky;
  top: 0;
  z-index: 2;              /* above the rows */
  background: #384049;      /* same as your header bg */
  color: #fff;              /* same as your header text */
}

/* if you have a <tfoot> you want fixed at the bottom too, you can do: */
table.selectable tfoot th {
  position: sticky;
  bottom: 0;
  background: #384049;
  color: #fff;
  z-index: 2;
}

/* ── Menu toggle button ── */
.menu-toggle {
  position: fixed;
  top: 96px; 
  left: 0;
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0.5rem;
  font-size: 1.25rem;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
}
.menu-toggle.open i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.menu-toggle i {
    transition: transform 0.3s ease;
}

/* BUTTONS */
.btn-edit {
    border-radius: 3px !important;
    background: var(--primary-color) !important;
    color: #fff !important;
    padding: 6px !important;
}
.btn-edit:hover {
    background: var(--secondary-color) !important; 
    color: #fff !important;
    border: 1px solid #fff;
}

.general-btn {
    padding: 7px 15px !important;
    border: none !important;
    background: var(--primary-color) !important;
    color: #fff !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    height: 35px !important;
}

.general-btn:hover{
    background: var(--secondary-color) !important;
    color: #fff !important;
}

.clear-btn {
  position: absolute;
  top: 50%;
  right: 0.5em;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1em;
  cursor: pointer;
  visibility: hidden;
  color: #666;
}

.clear-btn.visible {
  visibility: visible;
}

/* ── Search & buttons ── */
.search-wrapper {
  display: inline-flex;
  align-items: center;
  width: 90%;
  margin: 0.5rem 1rem;
}
.search-wrapper .input-group {
  position: relative;
  flex: 1;
}
.search-wrapper input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem 0 0 0.25rem;
}
.search-wrapper .clear-btn {
  position: absolute;
  top: 50%; right: 0.75rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  visibility: hidden;
  color: var(--secondary-color);
}
.search-wrapper .clear-btn.visible {
  visibility: visible;
}
.search-wrapper .btn-search,
.search-wrapper .add-btn {
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: var(--secondary-color);
  border: 1px solid #ccc;
  cursor: pointer;
}
.search-wrapper .btn-search {
  border-left: none;
  border-radius: 0;
}
.search-wrapper .add-btn {
  border-left: none;
  border-radius: 0 0.25rem 0.25rem 0;
}
.search-wrapper .btn-search:hover,
.search-wrapper .add-btn:hover {
  background: var(--secondary-color);
  color: #fff;
}
.search-wrapper input:focus {
  border: 1px solid var(--secondary-color);
  outline: none;
}

/* ── Data panel & viewer ── */
.data-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px); /* account for header + footer */
}

.padded-container {
    width: 98%;
    height: calc(100vh - 100px); /* account for header + footer */
    margin-top: 0;
    margin-left: 35px;
    padding: 0;
}

/* LOGIN */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    background-color: #ddd;
    border-radius: 8px;
    padding: 20px 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.login-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
}
.login-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1rem;
    text-align: center;
    color: red;
}
.login-msg {
    width: 100%;
    color: red;
    font-size: 16px;
    font-weight: 600;
    text-align: center !important;
}
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.checkbox-group input[type="checkbox"] {
    margin-right: 5px;
}
.btn-signin {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    color: #fff;
    background-color: #555;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-signin:hover {
    background-color: #333;
}


/* Form and field groups styling */
/* FORM SECTION */
.form-section {
    background: #EDEFF2;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid var(--primary-color);
    position: relative;
    max-width: 600px;
    margin: 50px auto;
}
.form-section h3 {
    margin-top: 0;
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 8px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}


.form-group input,
.form-group select,
.form-group textarea {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1.1rem;
    background-color: #fff;
    height: 38px !important;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    font-size: 0.9rem;
}

input[type='checkbox'] {
    width: 18px;
    height: 18px;
}

/* Special styles for dropdowns (like the screenshot) */
select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
}

button {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: var(--secondary-color);
}

/*In-Line Fields*/
.inline-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.inline-flex .form-group {
    flex: 1 1 200px;
    min-width: 180px;
}

/* Steps Title & Grid */
.steps-title {
  margin: 0;
  font-size: 1.25em;
  font-weight: 600;
  margin-bottom: 10px;
}

/* INLINE FIELDS */
.inline-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.inline-fields .field-group {
    flex: 0 0 0;
}
.inline-fields label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
}
.inline-fields select {
    height: 38px;
}



.inline-fields input {
    height: 38px;
}


input,
select,
textarea {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}
textarea {
    resize: vertical;
    min-height: 80px;
}
select {
    background: #fff;
}


/* Dealership & User Info Rows */
.dealership-row,
.user-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.dealership-col,
.user-info-group {
    flex: 1 1 250px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
label {
    font-weight: bold;
    //margin-bottom: 4px;
}



/* Table (list) */
.data-list {
  width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-right: none;
  padding: 1rem;
}
.data-list table {
  width: 100%;
  border-collapse: collapse;
}
.data-list th,
.data-list td {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
}
.data-list tbody tr:nth-child(even):not(.active) {
  background-color: #f9f9f9;
}
.data-list tbody tr.active {
  background-color: var(--tertiary-color) !important;
  color: #000 !important;
}
.data-list tbody tr.active a,
.data-list tbody tr.active .row-info {
  color: #eee;
}

.data-list tbody tr.active a.product-name,
.data-list tbody tr.active a.product-name:visited {
  color: #000 !important;
}

/* Force Add/Remove buttons to white in an active row, even if disabled */
.data-list tbody tr.active .add_button,
.data-list tbody tr.active .add_button[disabled],
.data-list tbody tr.active .edit_button,
.data-list tbody tr.active .edit_button[disabled],
.data-list tbody tr.active .del_button,
.data-list tbody tr.active .small-title,
.data-list tbody tr.active .del_button[disabled] {
  color: #000 !important;
  border-color: #000 !important;
  opacity: 1 !important;     /* override any dimming */
  cursor: pointer !important;/* keep pointer cursor even if disabled */

}

.data-list a {
  color: var(--primary-color);
  text-decoration: none;
}
.data-list a:hover {
  text-decoration: underline;
}

/* Viewer (iframe + placeholder) */
.data-viewer {
  display: none;
  position: relative;
  background: #fff;
  padding: 0 !important;
  margin: 0;
}

/* ensure the iframe itself has no padding or margin */
.sdsFrame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
}

.data-viewer .placeholder {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 1;
}
.data-viewer iframe {
  display: none;
  position: relative;
  z-index: 0;
  border: none;
}

/* ── Mobile (≤768px): hide viewer entirely ── */
@media (max-width: 768px) {
    /* Hide non-essential sections */
    .site-footer,
    .header-right,
    .data-viewer {
        display: none !important;
    }

    .page-title {
      font-size: 1rem;
    }

    .data-container {
      height: 100vh;
    }

    #loadingIndicator {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10002 !important;
    }

    .row-info .product {
      max-width: 50%;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px !important;
    }

    .form-section {
        max-width: 95%;
    }


}

/* ── Desktop (≥769px): side-by-side layout ── */
@media (min-width: 768px) {
    .data-container {
        flex-direction: row;
    }
    .data-list {
        width: 100%;
        max-width: 35%;
        overflow-y: auto;
        border-right: 1px solid #ccc;
    }
    .data-viewer {
        display: block;
        width: 70%;
        padding: 1rem;
    }
    .data-viewer iframe {
        display: block !important;
        width: 100%;
        height: 100%;
    }

}

/* ── Row info & buttons ── */
.row-info {
  display: flex;
  align-items: center;
  /* optional gap between all items */
  gap: 0.5rem;
}

.row-info > div {
  /* make the main content flexible, buttons will opt out below */
  flex: 1;
}

.row-info .product {
  font-size: 1.35em;
  padding-bottom: 5px;
  max-width: 65%;
  margin-bottom: 5px;
}

.row-info .product a{
    color: var(--primary-color) !important;
}

.row-info .div-left  { text-align: left;  }
.row-info .div-center{ text-align: center;}
.row-info .div-right { text-align: right; }

/* remove absolute, opt these out of flex:1 */
.row-info .add_button,
.row-info .edit_button,
.row-info .del_button {
  position: static;
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--secondary-color);
  border-radius: 3px;
  color: var(--secondary-color);
  cursor: pointer;
  white-space: nowrap;
}

/* push the first button to the far right, then space them */
.row-info .del_button {
  margin-left: auto;
}
.row-info .edit_button,
.row-info .add_button {
  margin-left: 0.5rem;
}

.row-info .add_button:hover,
.row-info .edit_button:hover,
.row-info .del_button:hover {
  text-decoration: underline;
}
/* ── Resize handle (if still used) ── */
.resize-handle {
  display: none;
  position: absolute;
  top: 0; bottom: 0;
  left: 30%;
  width: 8px;
  margin-left: -4px;
  cursor: ew-resize;
  background: rgba(0,0,0,0.1);
  z-index: 10;
  touch-action: none;
}

/* ── Pagination & record info ── */
.pagination {
  text-align: center;
  padding: 10px;
  background-color: #e0e0e0;
}
.record-info {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.page-buttons {
  display: inline-flex;
  gap: 0.5rem;
}
.page-btn {
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  background-color: var(--secondary-color);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}
.page-btn:hover {
  opacity: 0.9;
}
.page-btn.active {
  background-color: var(--primary-color);
  font-weight: bold;
}

/* ── Full-screen modal styles ── */

/* simple full‐screen flexbox modal */
#edit-modal.modal {
  display: none;              /* hidden by default */
  position: fixed;
  top: 0; left: 0;
  width: 100vw;  height: 100vh;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
#edit-modal .modal-body {
  background: #fff;
  padding: 1.5rem;
  border-radius: 4px;
  width: 90%;
  max-width: 400px;
}
#edit-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
#edit-modal .modal-header button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-header h2 {
    color: #fff;

}


#datasheet-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff;
  z-index: 10000;
  display: none;
  overflow: hidden;
}

#datasheet-modal-close{
    font-size: 1.2rem;
    background-color:var(--primary-color);
    padding: 3px;
    color: #fff;
    border-radius: 5px;

}
#datasheet-modal .modal-header {
  padding: 1rem;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
}
#datasheet-modal .modal-body {
  position: absolute;
  top: 3.5rem; bottom: 0; left: 0; right: 0;
}
#datasheet-modal .modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Fixed footer ── */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--footer-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  border-top: 2px solid var(--secondary-color);
  color: #fff;
}
.site-header a,
.site-footer a {
  color: var(--secondary-color) !important;
  text-decoration: none;
}
.site-header a:hover,
.site-footer a:hover {
  text-decoration: underline;
}
