/**
 * Extracted Component Styles - Replacing Template
 * Clean component styles without template dependencies
 */

/* ========================================
   Critical Path CSS - Prevent FOUC
   ======================================== */

/* Ensure body and app are visible immediately */
body {
  visibility: visible !important;
  opacity: 1 !important;
}

#app {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Prevent white flash by setting initial background */
html {
  background: #f5f5f5;
  min-height: 100%;
}

/* Ensure body fills viewport */
body {
  background: #f5f5f5;
  min-height: 100vh;
}

/* ========================================
   Forms - Replaces .smart-form
   ======================================== */

.app-form {
  margin: 0;
  outline: 0;
  color: #333;
  position: relative;
}

.app-form *,
.app-form :after,
.app-form :before {
  box-sizing: border-box;
}

.app-form header {
  display: block;
  padding: 8px 0;
  margin: 10px 14px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
  font-size: 16px;
  font-weight: 300;
  color: #232323;
}

.app-form fieldset {
  display: block;
  padding: 25px 14px 5px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  position: relative;
}

.app-form fieldset + fieldset {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.app-form section {
  margin-bottom: 20px;
  position: relative;
}

.app-form footer {
  display: block;
  padding: 7px 14px 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(248, 248, 248, 0.9);
  text-align: right;
}

/* Form inputs */
.app-form .input input,
.app-form .select select,
.app-form .textarea textarea {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 19px;
  color: #404040;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0;
  transition: border-color 0.3s;
}

.app-form .input input:focus,
.app-form .select select:focus,
.app-form .textarea textarea:focus {
  border-color: #4c9ed9;
  outline: none;
}

/* Form labels */
.app-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 400;
  font-size: 13px;
  line-height: 19px;
  color: #333;
}

.app-form label.checkbox,
.app-form label.radio {
  font-weight: 400;
  cursor: pointer;
}

/* Form validation states */
.app-form .state-error input,
.app-form .state-error select,
.app-form .state-error textarea {
  border-color: #a90329;
  background: #fff0f0;
}

.app-form .state-success input,
.app-form .state-success select,
.app-form .state-success textarea {
  border-color: #7dc27d;
  background: #f0fff0;
}

/* ========================================
   Widgets - Replaces .widget
   ======================================== */

.app-widget {
  position: relative;
  margin: 0 0 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.app-widget header {
  position: relative;
  padding: 15px 20px;
  background: transparent;
  border-bottom: 1px solid #e9ecef;
  color: #333;
}

.app-widget header h2 {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.app-widget > div {
  position: relative;
  padding: 20px;
  background: #fff;
}

/* Home page specific widget styling - no header background */
#content .welcome-content .app-widget header {
  background: transparent !important;
  border-bottom: 2px solid #e9ecef !important;
  padding-bottom: 10px !important;
}

#content .welcome-content .app-widget {
  border: none !important;
  box-shadow: none !important;
}

/* Ensure widget-grid fills height */
#widget-grid {
  min-height: calc(100vh - 101px) !important;
  background: #f5f5f5 !important;
}

/* Widget controls */
.app-widget-controls {
  position: absolute;
  right: 8px;
  top: 0;
  height: 40px;
  display: flex;
  align-items: center;
}

.app-widget-controls button {
  background: transparent;
  border: none;
  padding: 0 8px;
  height: 30px;
  cursor: pointer;
  color: #333;
  transition: color 0.2s;
}

.app-widget-controls button:hover {
  color: #4c9ed9;
}

/* Widget collapsed state */
.app-widget-collapsed > div {
  display: none;
}

/* Widget color variations */
.app-widget-blue header {
  background: #5b9bd1;
  color: #fff;
  border-color: #4a89c5;
}

.app-widget-green header {
  background: #70c470;
  color: #fff;
  border-color: #5eb95e;
}

.app-widget-orange header {
  background: #faa732;
  color: #fff;
  border-color: #f89406;
}

.app-widget-red header {
  background: #da4f49;
  color: #fff;
  border-color: #bd362f;
}

/* ========================================
   Wizards - Replaces .smart-wizard
   ======================================== */

.app-wizard {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  border: 1px solid #ccc;
}

.app-wizard-tabs {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #f5f5f5;
  border-bottom: 1px solid #ccc;
}

.app-wizard-tab {
  flex: 1;
  margin: 0;
  padding: 0;
  position: relative;
}

.app-wizard-tab a {
  display: block;
  padding: 10px 15px;
  text-align: center;
  text-decoration: none;
  color: #333;
  background: #f5f5f5;
  border-right: 1px solid #ccc;
  transition: all 0.3s;
}

.app-wizard-tab:last-child a {
  border-right: none;
}

.app-wizard-tab.active a {
  background: #fff;
  color: #4c9ed9;
  font-weight: 500;
}

.app-wizard-pane {
  display: none;
  padding: 20px;
  min-height: 200px;
}

.app-wizard-pane.active {
  display: block;
}

.app-wizard-controls {
  padding: 10px 20px;
  background: #f5f5f5;
  border-top: 1px solid #ccc;
  text-align: right;
}

.app-wizard-prev,
.app-wizard-next {
  padding: 6px 12px;
  margin-left: 5px;
  background: #4c9ed9;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.app-wizard-prev:hover,
.app-wizard-next:hover {
  background: #3a7eb8;
}

.app-wizard-prev:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42857143;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  user-select: none;
  transition: all 0.3s;
}

.btn-primary {
  color: #fff;
  background-color: #4c9ed9;
  border-color: #357ebd;
}

.btn-primary:hover {
  background-color: #3a7eb8;
  border-color: #2e6da4;
}

.btn-success {
  color: #fff;
  background-color: #5cb85c;
  border-color: #4cae4c;
}

.btn-success:hover {
  background-color: #449d44;
  border-color: #398439;
}

.btn-danger {
  color: #fff;
  background-color: #d9534f;
  border-color: #d43f3a;
}

.btn-danger:hover {
  background-color: #c9302c;
  border-color: #ac2925;
}

.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}

.btn-default:hover {
  background-color: #e6e6e6;
  border-color: #adadad;
}

/* Button sizes */
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.btn-lg {
  padding: 10px 16px;
  font-size: 18px;
  line-height: 1.33;
}

/* Button states */
.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* ========================================
   Select Dropdown Fixes
   ======================================== */

/* Remove extra dropdown handle/arrow */
.app-form .select i,
.select i {
  display: none !important;
}

/* Specific fix for baseline dropdown */
#dropdown-baseline-list + i,
#dropdown-baseline-list ~ i,
.select #dropdown-baseline-list + i {
  display: none !important;
}

/* Ensure native select arrow shows properly */
select {
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  appearance: menulist !important;
}

/* Fix baseline dropdown width and styling */
#dropdown-baseline-list {
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
  appearance: menulist !important;
  max-width: 400px !important;
  width: auto !important;
  min-width: 250px !important;
}

/* Fix benchmark-compare dropdown width */
#benchmark-compare select,
#benchmark-compare .form-control,
.benchmark-compare-dropdown,
[data-testid*="benchmark"] select {
  max-width: 400px !important;
  width: auto !important;
  min-width: 250px !important;
}

/* Fix develop-explore dropdown width */
#develop-explore select,
#develop-explore .form-control,
.develop-explore-dropdown,
[data-testid*="develop-explore"] select,
#page-develop-explore select {
  max-width: 400px !important;
  width: auto !important;
  min-width: 250px !important;
}

/* ========================================
   Date Picker / Calendar Icon Fixes
   ======================================== */

/* Style calendar icons for date picker dropdowns */
.datepicker-dropdown .fa-calendar,
.ui-datepicker-month + .fa-calendar,
.ui-datepicker-year + .fa-calendar {
  cursor: pointer;
  color: #4c7686;
  margin-left: 5px;
  font-size: 14px;
}

/* Hide default dropdown arrows for date selects when calendar icons are present */
.datepicker-dropdown select,
.ui-datepicker-month,
.ui-datepicker-year {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-right: 25px;
}

/* Position calendar icons as dropdown indicators */
.datepicker-header .fa-calendar,
.ui-datepicker-header .fa-calendar {
  position: relative;
  pointer-events: none;
  margin-left: -20px;
}

/* ========================================
   Calendar Popup Styling Adjustments
   ======================================== */

/* Right-fill the calendar heading */
.ui-datepicker-header,
.datepicker-header {
  background: #4c7686 !important;
  color: white !important;
  padding: 10px !important;
  margin: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Center the month/year dropdowns vertically with nav arrows */
.ui-datepicker-header select,
.datepicker-header select {
  margin: 0 5px !important;
  vertical-align: middle !important;
  height: 28px !important;
  line-height: 28px !important;
}

/* Align navigation arrows vertically */
.ui-datepicker-prev,
.ui-datepicker-next,
.datepicker-prev,
.datepicker-next {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 28px !important;
  width: 28px !important;
  vertical-align: middle !important;
  cursor: pointer;
}

/* Calendar table full width */
.ui-datepicker-calendar,
.datepicker table {
  width: 100% !important;
  margin: 0 !important;
}

/* Calendar cells consistent sizing */
.ui-datepicker-calendar td,
.datepicker td {
  text-align: center !important;
  padding: 5px !important;
  width: 14.28% !important; /* 7 days = 100/7 */
}

/* Ensure date input has proper icon positioning */
.app-form .input .fa-calendar.icon-append,
.app-form .input .icon-append.fa-calendar {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 3;
  color: #666;
  line-height: 1;
  font-size: 16px;
}

/* Ensure parent container has relative positioning for absolute child */
.app-form .input {
  position: relative;
}

/* Fix calendar icon vertical centering in input fields */
.app-form .input input[type="text"] + .fa-calendar,
.app-form .input .fa-calendar {
  position: absolute;
  right: 10px;
  top: 0;
  bottom: 0;
  margin: auto;
  height: 16px;
  display: flex;
  align-items: center;
}

/* Calendar icon hover effect */
.app-form .input .fa-calendar:hover {
  color: #4c7686;
}