/* Base Variables for All Widgets */
:root {
    /* Default Theme */
    --op-primary-color: #0078d4;
    --op-primary-hover-color: #106ebe;
    --op-secondary-color: #5c5c5c;
    --op-background-color: #ffffff;
    --op-border-color: #e8e8e8;
    --op-text-color: #333333;
    --op-success-color: #107c10;
    --op-error-color: #a4262c;
    --op-font-family: 'Noto Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --op-border-radius: 4px;
    --op-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
.op-widget.theme-dark {
    --op-primary-color: #0078d4;
    --op-primary-hover-color: #106ebe;
    --op-secondary-color: #c2c2c2;
    --op-background-color: #2b2b2b;
    --op-border-color: #484848;
    --op-text-color: #ffffff;
    --op-success-color: #92c353;
    --op-error-color: #f1707b;
}

/* Blue Theme */
.op-widget.theme-blue {
    --op-primary-color: #0078d4;
    --op-primary-hover-color: #106ebe;
    --op-secondary-color: #5c5c5c;
    --op-background-color: #f0f5fd;
    --op-border-color: #d0e1f9;
    --op-text-color: #333333;
}

/* Green Theme */
.op-widget.theme-green {
    --op-primary-color: #107c10;
    --op-primary-hover-color: #0b5a0b;
    --op-secondary-color: #5c5c5c;
    --op-background-color: #f0f9f0;
    --op-border-color: #d0f0d0;
}

/* Base Widget Container */
.op-widget-container {
    font-family: var(--op-font-family);
    color: var(--op-text-color);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.op-widget-error {
    color: var(--op-error-color);
    padding: 15px;
    border: 1px solid var(--op-error-color);
    border-radius: var(--op-border-radius);
    background-color: rgba(164, 38, 44, 0.05);
    margin: 10px 0;
}

.op-scroll-container {
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

.card-scroll-region {
    flex: 1;
    overflow-y: auto;
}

.op-date-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    padding: 8px;
    border-radius: 8px;
    margin: 10px;
    margin-bottom: 12px;
    min-width: 250px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);

}

.op-date-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rz-button.op-button-primary {
    background-color: #0067b2 !important;
    color: white !important;
    border: none !important;
}

.rz-button.op-button-primary:hover {
    background-color: #005a9e !important;
}

html, body, .rz-layout {
    height: 100%;
    margin: 0;
    padding: 0;
}

.rz-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow-y: auto;
    height: 100%;
    min-height: 0;
}

.rz-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rz-layout-content {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

.rz-sidebar {
    flex-shrink: 0;
    border-right: 1px solid #ddd;
}

.rz-main {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-wrap: nowrap;
}

.label-pill {
    background-color: #eee;
    color: #333;
    font-variant: small-caps;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: lowercase;
}

.sidebar {
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    overflow: hidden;
    transition: width 0.3s ease;
}

.sidebar .filter-content {
    overflow-y: auto;
    flex: 1;
}

.sidebar.expanded {
    width: 250px;
}

.sidebar.collapsed {
    width: 48px;
}

.scroll-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    height: 100%;
    gap: 8px;
    width: 100%;
}

.scroll-snap-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    flex: 1;
    width: 100%;
    padding-bottom: 8px;
}

.scroll-track {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
}

.scroll-container {
    overflow-x: auto;
    overflow-y: auto; /* enable vertical scroll here */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    flex: 1;
    max-width: 100%;
}

.scroll-inner {
    display: flex;
    gap: 16px;
    scroll-snap-type: x mandatory;
    width: max-content; /* Ensures scroll area expands for child columns */
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;

  scrollbar-width: thin;              /* Firefox */
  scrollbar-color: rgba(0,0,0,0) transparent;
  transition: scrollbar-color 0.3s ease;
}

/* Hover state – show the scrollbar */
.scroll-area:hover {
  scrollbar-color: rgba(0, 0, 0, 0.4) transparent;
}

/* WebKit support (Chrome, Edge, Safari) */
.scroll-area::-webkit-scrollbar {
  width: 8px;
  transition: background-color 0.3s ease;
}

.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.scroll-area:hover::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.4);
}

.scroll-vertical-cards {
  overflow-y: auto;
  max-height: 100%;
  padding-right: 8px;
}

.earnings-widget-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.earnings-widget-sidebar {
  width: var(--sidebar-width, 250px);
  transition: width 0.3s ease;
  border-right: 1px solid #ddd;
  overflow-y: auto;
}

.earnings-widget-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.earnings-widget-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.date-columns-scroll-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    gap: 10px;
    padding: 10px;
}

.earnings-scroll-region {
    height: 100vh;
    overflow-y: auto;
}
.earnings-columns {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 12px;
    height: 100%;
}
.earnings-column {
    display: flex;
    flex-direction: column;
    min-width: 250px;
    gap: 10px;
}
.date-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: white;
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}

.calendar-widget-container {
  --column-width: 250px;
  --column-gap: 8px;
  --visible-columns: 5;

  max-width: calc(
    var(--visible-columns) * var(--column-width) +
    (var(--visible-columns) - 1) * var(--column-gap)
  );

  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  margin: 0 auto; /* center */
  position: relative;
  height: 100%;
}

.scroll-snap-wrapper {
   overflow-x: auto;
   overflow-y: auto;
   height: 100%;
}

.scroll-snap-track {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  scroll-snap-type: x mandatory;
  gap: 4px;
}

.date-column {
    flex: 0 0 var(--column-width);
    box-sizing: border-box;
    min-width: 250px;
    max-width: 250px;
    display: flex;
    flex-direction: column;
    padding: 8px;
    scroll-snap-align: start;
    overflow: visible;
}

.sticky-date-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 8px;
    text-align: center;
    z-index: 10;
}

.op-date-card-group {
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    flex-shrink: 0;
    height: 100%;
    scroll-snap-align: start;
    flex: 0 0 250px;
}


.earnings-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin: 8px 0;
    width: 100%;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease;
}

.earnings-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .op-widget-container {
        padding: 10px;
    }
}