/* === C-Data Theme === */
body, html { background: #f5f5f5 !important; }

/* Ascunde branding */
.tb-logo, tb-logo, .tb-logo-title,
img[src*="thingsboard"], img[src*="logo"]:not([src*="cdata"]) { display: none !important; }

/* Card alb */
mat-card, .mat-card {
  background: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
  border: 1px solid #eeeeee !important;
}

/* Form fields */
input.mat-mdc-input-element, input {
  color: #1a1a1a !important;
  background: transparent !important;
}
.mat-mdc-form-field-focus-overlay { background: transparent !important; }
.mdc-line-ripple::after { border-bottom-color: #00E676 !important; }
.mat-mdc-form-field.mat-focused label { color: #00C853 !important; }

/* Butoane raised - fundal alb, border verde */
button.mdc-button--raised,
button.mat-mdc-raised-button {
  background-color: #ffffff !important;
  color: #00C853 !important;
  border: 1.5px solid #00C853 !important;
  box-shadow: none !important;
}
button.mdc-button--raised .mdc-button__label,
button.mat-mdc-raised-button .mdc-button__label {
  color: #00C853 !important;
}
button.mdc-button--raised .mat-icon,
button.mat-mdc-raised-button .mat-icon {
  color: #00C853 !important;
}
.mat-accent .mat-mdc-button-persistent-ripple::before { background-color: #00E676 !important; }

/* Toolbar */
.mat-toolbar { background: #ffffff !important; color: #1a1a1a !important; border-bottom: 1px solid #eeeeee !important; }

/* Sidebar */
.mat-sidenav { background: #ffffff !important; border-right: 1px solid #eeeeee !important; }

/* Links */
a { color: #00C853 !important; }

/* Input fields */
.mdc-text-field__input, .mat-mdc-input-element {
  color: #1a1a1a !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #1a1a1a !important;
}
.mdc-floating-label, .mat-mdc-floating-label { color: #888888 !important; }
.mdc-text-field--focused .mdc-floating-label { color: #00C853 !important; }
.mdc-line-ripple::before { border-bottom-color: #dddddd !important; }
.mat-icon { color: #888888 !important; }

/* Fix autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1a1a1a !important;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  transition: background-color 5000s ease-in-out 0s;
}
input.mdc-text-field__input {
  font-size: 16px !important;
  font-family: inherit !important;
  color: #1a1a1a !important;
  -webkit-text-fill-color: #1a1a1a !important;
}

/* === LOGIN ONLY === */
tb-login-page mat-card.mat-mdc-card,
tb-login-page .mdc-card.mat-mdc-card {
  padding-top: 72px !important;
  padding-bottom: 24px !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}
tb-login-page .mat-mdc-form-field { margin-bottom: 0 !important; }
tb-login-page mat-form-field { margin-bottom: 4px !important; }
tb-login-page .layout-padding { padding: 8px 16px !important; }
tb-login-page fieldset { border: none !important; padding: 0 !important; margin: 0 !important; }
tb-login-page mat-card-content,
tb-login-page .mat-mdc-card-content { padding: 0 !important; }

/* === DASHBOARD WHITE LABEL === */
a[href*="github"], .tb-github-star { display: none !important; }
a.tb-switch-to-pe { display: none !important; }
tb-getting-started-widget { display: none !important; }
.tb-version-info-container { display: none !important; }

/* Ascunde Connect mobile app */
tb-mobile-qr-code, [class*="mobile-qr"] { display: none !important; }

/* Force hide - max specificity */
html body div.tb-version-info-container,
html body .tb-version-info-container.flex,
html body .tb-version-info-container.flex-1 {
  display: none !important;
}

/* Ascunde Edge instances din meniu */
a[href="/edgeManagement/instances"] {
  display: none !important;
}

/* Loading spinner */
#tb-loading-spinner .tb-bounce1,
#tb-loading-spinner .tb-bounce2,
#tb-loading-spinner .tb-bounce3 {
  background-color: #00E676 !important;
}

/* Progress bar - verde */
mat-progress-bar .mat-progress-bar-fill::after,
.mat-progress-bar-fill::after {
  background-color: #00E676 !important;
}
mat-progress-bar .mat-progress-bar-buffer,
.mat-progress-bar-buffer {
  background-color: rgba(0, 230, 118, 0.2) !important;
}

/* Ascunde notificarile de eroare API */
tb-toast .tb-error-notification,
.tb-snack-bar-container.tb-error,
snack-bar-container.mat-snack-bar-container {
  display: none !important;
}

/* Ascunde toast-uri de eroare TB */
.tb-toast.error-toast,
tb-snack-bar-component,
div[class*="tb-toast"][class*="error"] {
  display: none !important;
}

/* Ascunde toate progress bar-urile */
mat-progress-bar,
.mat-progress-bar {
  display: none !important;
}

/* Ascunde progress bar login */
th-progress-bar, .tb-progress-cover, body > mat-progress-bar, tb-root > mat-progress-bar { display: none !important; }

/* Ascunde progress bar login pozitie fixa */
mat-progress-bar { position: fixed; top: -10px !important; opacity: 0 !important; }

/* Ascunde View docs (link extern ThingsBoard) */
a[href*="thingsboard.io"] {
  display: none !important;
}

/* Override butoane unelevated (Add device, Add dashboard etc.) */
button.mdc-button--unelevated.mat-primary,
button.mat-mdc-unelevated-button.mat-primary {
  background-color: #ffffff !important;
  color: #00C853 !important;
  border: 1.5px solid #00C853 !important;
  box-shadow: none !important;
}
button.mdc-button--unelevated.mat-primary .mdc-button__label,
button.mat-mdc-unelevated-button.mat-primary .mdc-button__label {
  color: #00C853 !important;
}

/* Butoane outlined - border si text negru */
button.mdc-button--outlined,
a.mdc-button--outlined {
  border-color: #333333 !important;
  color: #333333 !important;
}
button.mdc-button--outlined .mdc-button__label,
a.mdc-button--outlined .mdc-button__label {
  color: #333333 !important;
}
button.mdc-button--outlined.mat-mdc-button-base,
a.mdc-button--outlined.mat-mdc-button-base {
  border-color: #333333 !important;
}

/* Fix toggle button group - elimina forma rectangulara */
mat-button-toggle-group {
  border-radius: 20px !important;
  overflow: hidden !important;
  border: 1px solid #333333 !important;
}
.mat-button-toggle {
  border-radius: 0 !important;
}
.mat-button-toggle:first-child {
  border-radius: 20px 0 0 20px !important;
}
.mat-button-toggle:last-child {
  border-radius: 0 20px 20px 0 !important;
}

/* Ascunde buton help din toate dialogurile */
button.tb-help-popup-button {
}

/* Ascunde buton help din toate dialogurile */
button.tb-help-popup-button {
  display: none !important;
}

/* Ascunde toate butoanele cu iconita help */
button:has(mat-icon.material-icons:only-child) {
  display: none !important;
}

/* Ascunde buton help din toolbar-ul dialogurilor */
mat-dialog-container mat-toolbar button:has(mat-icon),
[id^="mat-mdc-dialog"] mat-toolbar button:has(mat-icon) {
  display: none !important;
}
