/* ISOLATION CONTAINER: Resets styles inside your tool */
#dp1-dashboard-root {
  all: initial; /* Strips away company site styles */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* Re-applies your font */
  line-height: 1.5 !important; /* Prevents text squashing */
  -webkit-font-smoothing: antialiased; /* Makes text crisp */
  -moz-osx-font-smoothing: grayscale;
  background-color: #f4f7f6;
  color: #333;
  box-sizing: border-box;
  display: block;
  width: 100%;
}
/* Ensure all text inside inherits this font forcefully */
#dp1-dashboard-root * {
  font-family: inherit;
}
#dp1-dashboard-root * {
  box-sizing: border-box; /* Fixes layout width issues */
}
#dp1-dashboard-root header {
  text-align: center;
  border-bottom: 2px solid #ddd;
  padding-bottom: 20px;
}
#dp1-dashboard-root header h1 {
  color: #2c3e50;
}
/* --- FORCE RESET FOR HEADERS (Fixes Font/Boldness issues) --- */
#dp1-dashboard-root h1,
#dp1-dashboard-root h2,
#dp1-dashboard-root h3,
#dp1-dashboard-root h4,
#dp1-dashboard-root strong,
#dp1-dashboard-root b {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-weight: 700 !important; /* Force Bold locally */
  letter-spacing: normal !important; /* Fixes weird spacing */
}
#dp1-dashboard-root header pre {
  display: inline; /* Keep this */
  background: #e0e0e0;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0; /* Add this to remove default margins */
  vertical-align: baseline; /* Add this to align better with text */
}
/* --- NUCLEAR FORM RESET --- */
/* Forces inputs to ignore global Bootstrap/Tailwind styles */
#dp1-dashboard-root input,
#dp1-dashboard-root button,
#dp1-dashboard-root select,
#dp1-dashboard-root textarea {
  font-family: inherit !important;
  font-size: inherit;
  line-height: inherit;
  box-sizing: border-box !important;
  margin: 0; /* Kills random external margins */
}
#dp1-dashboard-root .upload-container {
  text-align: center;
  margin: 20px 0;
}
#dp1-dashboard-root #fileUploader {
  font-size: 1.1em;
}

/* --- New Search Bar Styles --- */
#dp1-dashboard-root .search-container {
  max-width: 1500px; /* Match the allResultsContainer width */
  margin: 0 auto 20px auto; /* Center it and add space below */
  display: flex; /* Use flex */
  flex-direction: column; /* <-- ADDED Stack children vertically */
  align-items: flex-end; /* <-- CHANGED Align items to the right */
  /* justify-content: flex-end; REMOVED */
}
/* Style for the new compare toggle container */
#dp1-dashboard-root .compare-toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px; /* Space below toggle */
  padding-right: 10px; /* <-- ADDED: Nudges toggle left */
}

#dp1-dashboard-root .search-input-wrapper {
  position: relative; /* For icon positioning */
  display: inline-block;
}

#dp1-dashboard-root #countrySearch {
  padding: 8px 35px 8px 15px; /* Adjusted padding for new icon */
  font-size: 0.9em;
  border: 1px solid #ddd;
  border-radius: 20px;
  width: 300px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  /* --- ADD THESE 4 LINES --- */
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23999" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
  background-repeat: no-repeat;
  background-position: center right 12px; /* Position icon */
  background-size: 16px 16px; /* Icon size */
}

/* Styles for side-by-side lists */
#dp1-dashboard-root #allResultsContainer {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  max-width: 1500px; /* Increased width for 3 columns */
  margin: 0 auto;
}
#dp1-dashboard-root .list-container {
  flex: 1; /* Each container takes up equal space */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
#dp1-dashboard-root .list-container h2 {
  text-align: center;
  color: #2c3e50;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
#dp1-dashboard-root .country-list-wrapper {
  padding: 10px;
  height: 400px; /* Fixed height for scrollable lists */
  overflow-y: auto;
}
/* End of new styles */

#dp1-dashboard-root .placeholder {
  text-align: center;
  color: #777;
  font-style: italic;
  padding-top: 20px;
}
#dp1-dashboard-root .country-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}
#dp1-dashboard-root .country-item:last-child {
  border-bottom: none;
}
#dp1-dashboard-root .country-item:hover {
  background-color: #f9f9f9;
}

/* Red for 'down' and 'critical' countries */
#dp1-dashboard-root .country-item strong {
  font-size: 1.2em;
  color: #d9534f;
}
/* Green for 'up' countries */
#dp1-dashboard-root .country-item.above strong {
  color: #5cb85c;
}

#dp1-dashboard-root .country-item span {
  font-size: 1em;
  color: #333;
  font-weight: 600; /* Makes it semi-bold */
}
#dp1-dashboard-root .country-item .critical-warn {
  /* This class is no longer used, but we can leave it */
  color: #d9534f;
  font-weight: bold;
  margin-right: 5px;
}
/* --- Style for selected country in compare mode --- */
#dp1-dashboard-root .country-item.selected-for-compare {
  background-color: #e0f2fe; /* Light blue background */
  font-weight: bold; /* Make text bold */
}

/* Optional: Add a checkmark (adjust positioning as needed) */
#dp1-dashboard-root .country-item.selected-for-compare::before {
  content: "✓"; /* Checkmark symbol */
  color: #0ea5e9; /* Blue color for checkmark */
  font-size: 1.2em;
  margin-right: 10px; /* Space between checkmark and name */
  font-weight: bold;
}
/* Make hiding rule more specific */
#dp1-dashboard-root #reportModal.modal-hidden,
#dp1-dashboard-root #comparisonModal.modal-hidden {
  display: none;
}
#dp1-dashboard-root #reportModal {
  position: fixed;
  z-index: 2147483647 !important; /* Maximum 32-bit integer */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* display: flex; was removed from here */
  align-items: flex-start;
  padding-top: 5vh; /* Adds some space from the top */
  justify-content: center;
}
#dp1-dashboard-root .dp1-modal-content {
  background-color: #fefefe;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  padding: 20px;
  width: 90%;
  max-width: 800px;
  position: relative;
  animation: slide-in 0.3s ease-out;
  cursor: default; /* <-- ADD THIS LINE */
}
/* --- START: Added Hover Cursor Change --- */
#dp1-dashboard-root #reportModal:hover,
#dp1-dashboard-root #comparisonModal:hover {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="white" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.854 4.146a.5.5 0 0 1 0 .708L8.707 8l3.147 3.146a.5.5 0 0 1-.708.708L8 8.707l-3.146 3.147a.5.5 0 0 1-.708-.708L7.293 8 4.146 4.854a.5.5 0 1 1 .708-.708L8 7.293l3.146-3.147a.5.5 0 0 1 .708 0z"/></svg>'),
    auto;
  /* Uses an embedded white 'X' SVG as the cursor */
}
/* --- END: Added Hover Cursor Change --- */
#dp1-dashboard-root #closeModalButton {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  border: none;
  background: none;
  cursor: pointer;
}
#dp1-dashboard-root #closeModalButton:hover {
  color: #333;
}
/* WTH Report Styles */
#dp1-dashboard-root .wth-report h3 {
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  white-space: nowrap;
}

/* --- ADD THIS ENTIRE BLOCK --- */
#dp1-dashboard-root .wth-report strong {
  color: #000;
}
#dp1-dashboard-root .wth-report strong.down {
  color: #d9534f;
  font-weight: bold;
}
#dp1-dashboard-root .wth-report strong.up {
  color: #5cb85c;
  font-weight: bold;
}
/* --- END OF BLOCK TO ADD --- */
@keyframes slide-in {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* NEW: Styles for ALL trend chart canvases */
#dp1-dashboard-root canvas[id^="trendChart-"] {
  /* Target canvas elements with ID starting with "trendChart-" */
  display: block; /* Helps prevent extra space below */
  box-sizing: border-box; /* Consistent sizing */
  width: 100%;
  max-height: 200px; /* Keep the max height */
  margin-bottom: 20px; /* Keep the spacing */
}
/* NEW: Styles for two-column KPI layout */
#dp1-dashboard-root .kpi-columns {
  display: flex;
  justify-content: space-between; /* Space out columns */
  gap: 20px; /* Add gap between columns */
  margin-bottom: 20px; /* Space below the columns */
}

#dp1-dashboard-root .kpi-column {
  flex: 1; /* Each column takes half the space */
}

#dp1-dashboard-root .kpi-column h4 {
  margin-top: 0;
  color: #555;
  font-size: 1em;
  padding-bottom: 5px;
}

#dp1-dashboard-root .kpi-column ul {
  list-style: none; /* Remove default bullets */
  padding: 0;
  margin: 0;
}

#dp1-dashboard-root .kpi-column li {
  margin-bottom: 8px; /* Space between KPI items */
  font-size: 0.95em;
}

#dp1-dashboard-root code {
  background-color: #f0f0f0; /* Light gray background */
  padding: 2px 6px; /* Adds a little space inside the box */
  border-radius: 4px; /* Rounds the corners */
  border: 1px solid #ddd; /* A light border, like in your first image */
}
#dp1-dashboard-root .report-header {
  /* display: flex;  <-- REMOVE THIS */
  /* justify-content: space-between; <-- REMOVE THIS */
  /* align-items: center; <-- REMOVE THIS */
  margin-bottom: 10px; /* Adjust spacing if you like */
  border-bottom: 1px solid #eee; /* Optional separator */
  padding-bottom: 10px; /* Optional padding */
}

#dp1-dashboard-root .report-header h2 {
  margin: 10px 0 0 0;
  color: #2c3e50;
  font-size: 1.4em; /* Adjust title size if needed */
}

/* This styles the "Current AAPU: ..." line */
#dp1-dashboard-root .report-header .summary {
  font-size: 1.25em; /* Makes it bigger */
  line-height: 1.6;
  margin-top: 15px; /* Adds space below the title */
  margin-bottom: 10px; /* Adds space above the line */
}

/* This styles the "Current AAPU:" bold text */
#dp1-dashboard-root .report-header .summary strong {
  color: #000;
}

/* This styles the red "down" number */
#dp1-dashboard-root .report-header .summary .down {
  color: #d9534f;
  font-weight: bold;
}

/* This styles the green "up" number */
#dp1-dashboard-root .report-header .summary .up {
  color: #5cb85c;
  font-weight: bold;
}

#dp1-dashboard-root .toggle-area {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* <-- ADD THIS (pushes toggle to the right) */
  gap: 8px; /* Space between small labels and switch */
  margin-bottom: 15px; /* <-- ADD THIS (adds space below the toggle) */
}

#dp1-dashboard-root .toggle-label-small {
  font-size: 0.8em; /* Smaller font for labels */
  color: #555;
  font-weight: 500;
  cursor: default; /* Make it look non-clickable */
}

/* Style the active label (using ID now) */
#dp1-dashboard-root .toggle-label-small.active {
  color: #0b57d0; /* Blue color */
  font-weight: bold;
}

/* The SMALL switch - container */
#dp1-dashboard-root .switch-small {
  position: relative;
  display: inline-block;
  width: 34px; /* Smaller width */
  height: 18px; /* Smaller height */
}

/* Hide default HTML checkbox */
#dp1-dashboard-root .switch-small input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The SMALL slider track */
#dp1-dashboard-root .switch-small .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* OFF color */
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

/* The SMALL sliding circle */
#dp1-dashboard-root .switch-small .slider:before {
  position: absolute;
  content: "";
  height: 14px; /* Smaller circle */
  width: 14px; /* Smaller circle */
  left: 2px;
  bottom: 2px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

/* When checkbox is checked (ON state) */
#dp1-dashboard-root input:checked + .slider {
  background-color: #a8c7fa; /* Lighter blue track */
}

/* Move the SMALL circle when checked */
#dp1-dashboard-root input:checked + .slider:before {
  -webkit-transform: translateX(16px); /* Shorter distance */
  -ms-transform: translateX(16px);
  transform: translateX(16px);
  background-color: #0b57d0; /* Darker blue circle */
}

/* Rounded sliders (same as before) */
#dp1-dashboard-root .switch-small .slider.round {
  border-radius: 18px; /* Make track rounded */
}

#dp1-dashboard-root .switch-small .slider.round:before {
  border-radius: 50%; /* Make circle round */
}

#dp1-dashboard-root #reportDetails {
  margin-top: 15px;
  opacity: 1;
  transition: opacity 0.25s ease-in-out; /* Increased duration */
}

#dp1-dashboard-root #reportDetails.fading-out {
  opacity: 0;
}

/* --- End New Toggle Styles --- */
/* New rule for the wrapper */
#dp1-dashboard-root .report-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px; /* Space below this line */
}

/* Remove margin from the H3 inside it AND copy old styles */
#dp1-dashboard-root .report-subheader h3 {
  /* Copied from .wth-report h3 for visual consistency */
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;

  /* Keep this from the new rule */
  margin: 0;
}
/* ADD THIS NEW RULE for the modal container */
#dp1-dashboard-root #comparisonModal {
  position: fixed;
  z-index: 2147483647 !important; /* Maximum 32-bit integer */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  display: flex; /* Use flexbox for centering */
  align-items: flex-start; /* Align modal to the TOP */
  padding-top: 5vh; /* Add space from the top */
  justify-content: center; /* Center horizontally */
}
/* --- New Comparison Modal Styles --- */
#dp1-dashboard-root #comparisonModal .dp1-modal-content {
  max-width: 90vw; /* Make it very wide */
  min-height: 400px;
  cursor: default; /* <-- ADD THIS LINE */
}

#dp1-dashboard-root #comparisonModal #closeCompareModalBtn {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  border: none;
  background: none;
  cursor: pointer;
}
#dp1-dashboard-root #comparisonModal #closeCompareModalBtn:hover {
  color: #333;
}

#dp1-dashboard-root .comparison-container {
  display: flex;
  gap: 20px;
}

#dp1-dashboard-root .compare-column {
  flex: 1; /* Each column takes half the space */
  min-width: 0; /* Prevents flex overflow */
}

/* --- Re-apply report styles inside the compare modal --- */
/* This ensures the reports look the same inside the new modal */

#dp1-dashboard-root .comparison-container .report-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
#dp1-dashboard-root .comparison-container .report-header h2 {
  margin: 10px 0 0 0;
  color: #2c3e50;
  font-size: 1.4em;
}
#dp1-dashboard-root .comparison-container .report-header .summary {
  font-size: 1.25em;
  line-height: 1.6;
  margin-top: 15px;
  margin-bottom: 10px;
}
#dp1-dashboard-root .comparison-container .report-header .summary strong {
  color: #000;
}
#dp1-dashboard-root .comparison-container .report-header .summary .down {
  color: #d9534f;
  font-weight: bold;
}
#dp1-dashboard-root .comparison-container .report-header .summary .up {
  color: #5cb85c;
  font-weight: bold;
}
#dp1-dashboard-root .comparison-container .report-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
#dp1-dashboard-root .comparison-container .report-subheader h3 {
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  margin: 0;
}
#dp1-dashboard-root .comparison-container .kpi-columns {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
#dp1-dashboard-root .comparison-container .kpi-column {
  flex: 1;
}
#dp1-dashboard-root .comparison-container .kpi-column h4 {
  margin-top: 0;
  color: #555;
  font-size: 1em;
  padding-bottom: 5px;
}
#dp1-dashboard-root .comparison-container .kpi-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#dp1-dashboard-root .comparison-container .kpi-column li {
  margin-bottom: 8px;
  font-size: 0.95em;
}
#dp1-dashboard-root .comparison-container .kpi-column strong {
  font-weight: bold;
  color: #000;
}
#dp1-dashboard-root .comparison-container .kpi-column strong.down {
  color: #d9534f;
}
#dp1-dashboard-root .comparison-container .kpi-column strong.up {
  color: #5cb85c;
}
#dp1-dashboard-root .comparison-container .wth-report h3 {
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  white-space: nowrap;
}
/* --- Multi-Game Tab Styles --- */
#dp1-dashboard-root .tabs-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

#dp1-dashboard-root .tab-button {
  padding: 8px 20px;
  background-color: #e0e0e0; /* Gray for inactive */
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  color: #555;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#dp1-dashboard-root .tab-button:hover {
  background-color: #d5d5d5;
  transform: translateY(-1px);
}

#dp1-dashboard-root .tab-button.active {
  background-color: #0b57d0; /* Blue for active */
  color: white;
  box-shadow: 0 4px 8px rgba(11, 87, 208, 0.3);
}
/* FIXED: Forces rounded corners and thin border */
#dp1-dashboard-root .action-btn {
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  background-color: #fff !important; /* Force white background */
  border: 1px solid #ccc !important; /* Force thin grey border */
  border-radius: 6px !important; /* Force rounded corners */
  color: #333 !important; /* Force dark text */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* --- Upload Modal Styles (ROAS Style) --- */
/* The Modal Background */
#dp1-dashboard-root #uploadModal {
  position: fixed;
  z-index: 2147483647 !important; /* Maximum 32-bit integer: Always on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  /* Flexbox centering */
  display: flex; /* This is key for centering */
  align-items: center; /* Vertical center */
  justify-content: center; /* Horizontal center */
}

/* Adds the 'X' cursor when hovering the dark background */
#dp1-dashboard-root #uploadModal:hover,
#dp1-dashboard-root #reportModal:hover,
#dp1-dashboard-root #comparisonModal:hover {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="white" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M11.854 4.146a.5.5 0 0 1 0 .708L8.707 8l3.147 3.146a.5.5 0 0 1-.708.708L8 8.707l-3.146 3.147a.5.5 0 0 1-.708-.708L7.293 8 4.146 4.854a.5.5 0 1 1 .708-.708L8 7.293l3.146-3.147a.5.5 0 0 1 .708 0z"/></svg>'),
    auto;
}

/* --- REPLACE THIS BLOCK IN style.css --- */

/* Fix Width of Upload Box */
#dp1-dashboard-root .upload-modal-content {
  background-color: #fefefe;
  padding: 25px 30px;
  border-radius: 8px;

  /* THIS IS THE KEY FIX: */
  width: 100%;
  max-width: 400px !important; /* Force it to be small/compact */

  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease-out;
  position: relative;
  margin: 0;
}

#dp1-dashboard-root .upload-header {
  display: flex;
  justify-content: center; /* <--- CHANGED: Centers the title */
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 20px;
  position: relative; /* <--- ADDED: Anchors the close button */
}

#dp1-dashboard-root .upload-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.5em;
}

#dp1-dashboard-root .close-upload {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  position: absolute; /* <--- ADDED: Removes it from flex flow */
  right: 0; /* <--- ADDED: Sticks it to the right */
}

#dp1-dashboard-root .close-upload:hover {
  color: #333;
}

/* --- Complex File Row Styles --- */
#dp1-dashboard-root #fileRowContainer {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}

#dp1-dashboard-root .file-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  justify-content: center; /* <--- ADDED: Centers the file inputs */
}

#dp1-dashboard-root .row-number {
  font-weight: 600;
  color: #555;
  width: 20px;
  flex-shrink: 0;
}

/* Text Input for Name */
#dp1-dashboard-root .file-row input[type="text"] {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95em;
}

/* Hide the ugly default file input */
#dp1-dashboard-root .file-row input[type="file"] {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

/* Styled "Browse" Button Label */
#dp1-dashboard-root .file-row .file-label {
  padding: 8px 12px; /* Reduced padding to prevent text cutoff */
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  color: #333;
}

#dp1-dashboard-root .file-row .file-label:hover {
  background-color: #f0f0f0;
}

/* Filename Display - Default State (Placeholder) */
#dp1-dashboard-root .file-row .file-name-display {
  font-size: 0.8em; /* Smaller font to fit text */
  color: #999;
  flex-grow: 1;
  white-space: nowrap;
  overflow: visible; /* Allow text to be seen */
  min-width: 0;
  padding-left: 8px;
  margin-top: 0;
  font-style: italic;
  line-height: 1.2; /* Tighter line height */
}

/* Filename Display - "Boxed" State (When file is selected) */
#dp1-dashboard-root .file-row .file-name-display.file-filled {
  background-color: #f0f7ff;
  border: 1px solid #cce5ff;
  border-radius: 6px;
  padding: 8px 12px;
  color: #0056b3;
  font-weight: 600;
  font-style: normal;
  font-size: 0.95em;
  margin-left: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Success State (Green) - FORCED */
#dp1-dashboard-root .primary-btn.btn-success {
  background-color: #27ae60 !important;
  border-color: #27ae60 !important;
  color: white !important;
}

#dp1-dashboard-root .primary-btn.btn-success:hover {
  background-color: #219150 !important;
}

/* Remove Button */
#dp1-dashboard-root .remove-row-btn {
  background: #fff;
  border: 1px solid #ddd;
  color: #999;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  padding: 0;
  font-size: 16px;
}

#dp1-dashboard-root .remove-row-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* Fix Button Spacing - COMPACT VERSION */
#dp1-dashboard-root .upload-actions {
  display: flex;
  justify-content: center; /* Centers the buttons */
  align-items: center;
  margin-top: 25px;
  border-top: 1px solid #eee;
  padding-top: 20px;
  gap: 20px; /* Adds space between the two buttons */
}

/* Make buttons compact (Auto width) */
#dp1-dashboard-root .primary-btn,
#dp1-dashboard-root .secondary-btn {
  flex: 0 0 auto; /* DISKABLE STRETCHING */
  width: auto; /* Use natural width based on text */
  min-width: 130px; /* Keeps them from looking too tiny */
  text-align: center;
  padding: 10px 20px;
  font-size: 0.9em;
}

#dp1-dashboard-root .primary-btn {
  background-color: #2c3e50;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
}

#dp1-dashboard-root .primary-btn:hover {
  background-color: #34495e;
}
/* Success State (Green) */
#dp1-dashboard-root .primary-btn.btn-success {
  background-color: #27ae60;
  border-color: #27ae60;
  transition: background-color 0.3s ease;
}

#dp1-dashboard-root .primary-btn.btn-success:hover {
  background-color: #219150;
}

#dp1-dashboard-root .secondary-btn {
  background-color: #ecf0f1;
  color: #2c3e50;
  padding: 10px 20px;
  border: 1px solid #bdc3c7;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

#dp1-dashboard-root #clearTrendFilters:hover {
  background-color: #fff1f2 !important;
  border-color: #fecaca !important;
  color: #e11d48 !important;
}

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* FORCE COMPARE MODAL WIDER */
#dp1-dashboard-root #comparisonModal .dp1-modal-content {
  width: 95vw !important; /* Forces 95% of screen width */
  max-width: 1600px !important; /* Prevents it from getting absurdly wide on huge monitors */
  max-height: 90vh; /* Keeps it within vertical view */
  overflow-y: auto; /* Scroll if needed */
  display: flex;
  flex-direction: column;
}

/* Ensure columns share space equally */
#dp1-dashboard-root .comparison-container .compare-column {
  flex: 1;
  min-width: 400px; /* Minimum width before scrolling */
  padding: 0 15px;
  border-right: 1px solid #eee; /* Optional: adds line between countries */
}
#dp1-dashboard-root .comparison-container .compare-column:last-child {
  border-right: none;
}
/* --- Global Trend Selection Chips --- */
#dp1-dashboard-root .trend-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

#dp1-dashboard-root .trend-chip:hover {
  border-color: #3b82f6;
  background-color: #f8fafc;
}

#dp1-dashboard-root .trend-chip.active {
  background-color: #3b82f6 !important;
  border-color: #2563eb !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

#dp1-dashboard-root .trend-chip.active::before {
  content: "✓";
  font-size: 0.9em;
}
/* --- Modern Trend Suite Styling --- */
#dp1-dashboard-root #globalTrendContainer {
  background: #ffffff !important;
  border: none !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
}

#dp1-dashboard-root .dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.9em;
  color: #4a5568;
  transition: background 0.1s;
}

#dp1-dashboard-root .dropdown-item:hover {
  background-color: #edf2f7;
}
/* --- Group Selection Styles --- */
#dp1-dashboard-root .group-item {
  background-color: #f8fafc;
  font-weight: 700 !important;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
}
#dp1-dashboard-root .group-item:hover {
  background-color: #f1f5f9;
}
#dp1-dashboard-root .group-item .count-badge {
  font-size: 0.8em;
  background: #cbd5e1;
  padding: 2px 8px;
  border-radius: 10px;
  color: #475569;
}
#dp1-dashboard-root .group-item.group-low {
  border-left: 6px solid #ffcfcf !important;
}
#dp1-dashboard-root .group-item.group-moderate {
  border-left: 6px solid #fdf2b3 !important;
}
#dp1-dashboard-root .group-item.group-good {
  border-left: 6px solid #c6eac3 !important;
}
#dp1-dashboard-root .dropdown-item.selected {
  background-color: #ebf8ff;
  color: #2b6cb0;
  font-weight: 600;
}

/* Active Country Pills */
#dp1-dashboard-root .active-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8em;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

#dp1-dashboard-root .active-pill:hover {
  background: #e2e8f0;
}

#dp1-dashboard-root .active-pill .remove-btn {
  cursor: pointer;
  color: #94a3b8;
  font-size: 1.2em;
}

#dp1-dashboard-root .active-pill .remove-btn:hover {
  color: #ef4444;
}
/* Modern Unified Selector Theme (Light) */
#dp1-dashboard-root .preset-btn {
  background: transparent;
  border: none;
  color: #4a5568;
  text-align: left;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.15s ease;
}

#dp1-dashboard-root .preset-btn:hover {
  background-color: #f7fafc;
  color: #2d3748;
}

#dp1-dashboard-root .preset-btn.active,
#dp1-dashboard-root .kpi-opt.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  font-weight: 600;
}
/* Modern Grid KPI Selector Theme (Light) */
#dp1-dashboard-root .kpi-opt {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #4a5568;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 0.82em;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

#dp1-dashboard-root .kpi-opt:hover {
  background-color: #f1f5f9;
  border-color: #3b82f6;
  color: #3b82f6;
}

#dp1-dashboard-root .kpi-opt.active {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  font-weight: 600;
}

#dp1-dashboard-root .kpi-group-box {
  padding: 4px 0;
}
/* Chart Canvas Refinement */
#dp1-dashboard-root .chart-wrapper {
  background: radial-gradient(circle at top left, #ffffff, #fcfcfc) !important;
  border: 1px solid #f1f5f9 !important;
}

/* Ensure inputs in the calendar look modern */
#dp1-dashboard-root input[type="date"] {
  outline: none;
  border: 1px solid #e2e8f0;
  padding: 8px;
  border-radius: 6px;
  font-family: inherit;
}
#dp1-dashboard-root input[type="date"]:focus {
  border-color: #3182ce !important;
  box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.1);
}
#dp1-dashboard-root #applyCustomDate:hover {
  background-color: #2b6cb0;
}
#dp1-dashboard-root #globalTrendKPISelect {
  transition: all 0.2s ease;
  appearance: none; /* Modern cleaner arrow look */
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path fill="%23666" d="M0 0l5 6 5-6z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px !important;
}

/* --- Added Hover Effects for Dropdown Buttons --- */
#dp1-dashboard-root #kpiDisplayBtn:hover,
#dp1-dashboard-root #dateRangeDisplay:hover {
  border-color: #3b82f6 !important; /* Turns border blue */
  background-color: #f8faff !important; /* Adds very light blue tint */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Soft shadow */
}

#dp1-dashboard-root optgroup {
  font-size: 0.85em;
  font-weight: 700 !important;
  color: #64748b;
  background: #f8fafc;
  padding: 10px;
}

#dp1-dashboard-root option {
  padding: 8px !important;
  font-weight: 500;
  color: #1e293b;
}
