/* Konek Account Console - Dashboard Style
 * Modern, clean design matching Konek dashboard backend
 * Overrides PatternFly v5 defaults
 */

/* ===== ROOT & LAYOUT ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base) !important;
  background-color: #f5f6f7;
  color: var(--tc-surface);
  line-height: 1.5;
}

/* Main container layout */
.pf-c-page {
  background-color: #f5f6f7;
}

.pf-c-page__main {
  padding: 0 !important;
}

.pf-c-page__main-section {
  padding: 2rem !important;
  background-color: #f5f6f7;
}

/* ===== HEADER/TOP BAR ===== */
.pf-c-page__header {
  background: linear-gradient(135deg, var(--color-navy-700) 0%, var(--color-navy-500) 100%) !important;
  box-shadow: 0 2px 8px rgba(27, 54, 93, 0.15) !important;
  border-bottom: none !important;
}

.pf-c-page__header .pf-c-page-header-tools {
  --pf-c-page-header-tools--PaddingRight: 2rem;
  --pf-c-page-header-tools--PaddingLeft: 2rem;
}

.pf-c-page__header .pf-c-button {
  color: white !important;
}

.pf-c-page__header .pf-c-button:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

/* Brand logo in header */
.pf-c-page__header-brand-link {
  padding: 0 2rem !important;
  display: flex !important;
  align-items: center !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: white !important;
  text-decoration: none !important;
}

.pf-c-page__header-brand-link:hover {
  opacity: 0.9;
}

/* User dropdown in header */
.pf-c-menu.pf-m-top {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-radius: var(--br-md) !important;
}

/* ===== SIDEBAR NAVIGATION ===== */
.pf-c-page__sidebar {
  background-color: #ffffff;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
  width: 260px !important;
}

.pf-c-page__sidebar.pf-m-expanded {
  width: 260px !important;
}

/* Navigation list styling */
.pf-c-nav__list {
  padding: 2rem 0 !important;
}

.pf-c-nav__item {
  margin: 0 !important;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.pf-c-nav__link {
  padding: 0.875rem 1.5rem !important;
  color: var(--tc-surface-low) !important;
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  border-left: 3px solid transparent !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.pf-c-nav__link:hover {
  background-color: #f8f9fa;
  color: var(--tc-surface) !important;
  padding-left: 1.75rem !important;
}

.pf-c-nav__link.pf-m-current {
  color: var(--bg-primary) !important;
  background-color: rgba(74, 144, 217, 0.1);
  border-left-color: var(--bg-primary) !important;
  font-weight: 600 !important;
}

.pf-c-nav__link.pf-m-current:hover {
  background-color: rgba(74, 144, 217, 0.15);
  padding-left: 1.75rem !important;
}

/* Toggle button styling */
.pf-c-page__sidebar-body {
  padding: 0 !important;
}

/* ===== MAIN CONTENT ===== */
.pf-c-page__main-section {
  max-width: 1400px;
  margin: 0 auto;
}

/* Page title */
.pf-c-page-header-title {
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: var(--tc-surface) !important;
  margin-bottom: 0.5rem !important;
}

.pf-c-page-header-title__pre-title {
  font-size: 0.875rem !important;
  color: var(--tc-surface-low) !important;
  font-weight: 500 !important;
  text-transform: none !important;
}

/* ===== CARDS & SECTIONS ===== */
.pf-c-card {
  background-color: #ffffff !important;
  border: 1px solid #e8eaed !important;
  border-radius: var(--br-md) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  padding: 1.5rem !important;
  transition: all 0.2s ease;
}

.pf-c-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.pf-c-card__header {
  padding: 0 !important;
  margin-bottom: 1.5rem !important;
  border-bottom: none !important;
}

.pf-c-card__title {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: var(--tc-surface) !important;
  margin: 0 !important;
}

.pf-c-card__body {
  padding: 0 !important;
}

/* Page sections */
.pf-c-page-header-tools {
  background: transparent !important;
}

/* ===== FORMS ===== */
.pf-c-form {
  --pf-c-form--gap: 2rem;
}

.pf-c-form__group {
  margin-bottom: 2rem !important;
}

.pf-c-form__group-label {
  margin-bottom: 0.5rem !important;
}

.pf-c-form__label {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: var(--tc-surface) !important;
}

.pf-c-form__label-required {
  color: var(--bg-danger) !important;
  margin-left: 0.25rem !important;
}

/* Input fields */
.pf-c-form-control {
  border: 1px solid #d0d3d7 !important;
  border-radius: var(--br-xs) !important;
  padding: 0.625rem 0.875rem !important;
  font-size: 0.95rem !important;
  background-color: #ffffff !important;
  transition: all 0.2s ease;
}

.pf-c-form-control:hover {
  border-color: #a1a7b3 !important;
}

.pf-c-form-control:focus {
  border-color: var(--bg-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1) !important;
}

.pf-c-form-control::placeholder {
  color: var(--tc-surface-low) !important;
  /* Opaque on purpose: faded #6B7280 drops below 4.5:1 (Firefox also fades placeholders by default). */
  opacity: 1;
}

/* Disabled inputs */
.pf-c-form-control:disabled {
  background-color: #f5f6f7 !important;
  color: var(--tc-surface-low) !important;
  cursor: not-allowed !important;
}

/* ===== CHECKBOXES & RADIOS ===== */
.pf-c-check {
  margin-bottom: 1rem !important;
}

.pf-c-check__label {
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  color: var(--tc-surface) !important;
  margin-left: 0.5rem !important;
}

.pf-c-check__input {
  width: 1.25rem !important;
  height: 1.25rem !important;
  cursor: pointer !important;
  accent-color: var(--bg-primary) !important;
}

.pf-c-check__input:focus {
  outline: 2px solid var(--bg-primary) !important;
  outline-offset: 2px !important;
}

/* ===== BUTTONS ===== */
.pf-c-button {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  padding: 0.625rem 1.25rem !important;
  border-radius: var(--br-xs) !important;
  transition: all 0.2s ease;
  cursor: pointer !important;
  border: none !important;
}

/* Primary button */
.pf-c-button.pf-m-primary {
  background-color: var(--bg-primary) !important;
  color: white !important;
}

.pf-c-button.pf-m-primary:hover {
  background-color: var(--bg-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.2) !important;
}

.pf-c-button.pf-m-primary:active {
  background-color: var(--bg-primary-active) !important;
  transform: translateY(0);
}

.pf-c-button.pf-m-primary:disabled {
  background-color: #d0d3d7 !important;
  color: white !important;
  cursor: not-allowed !important;
}

/* Secondary/Outline button */
.pf-c-button.pf-m-secondary {
  background-color: transparent !important;
  color: var(--tc-surface) !important;
  border: 1px solid #d0d3d7 !important;
}

.pf-c-button.pf-m-secondary:hover {
  background-color: #f5f6f7 !important;
  border-color: #a1a7b3 !important;
  color: var(--tc-surface) !important;
}

/* Danger button */
.pf-c-button.pf-m-danger {
  background-color: var(--bg-danger) !important;
  color: white !important;
}

.pf-c-button.pf-m-danger:hover {
  background-color: var(--bg-danger-hover) !important;
  box-shadow: 0 2px 8px rgba(255, 82, 82, 0.2) !important;
}

/* Link button */
.pf-c-button.pf-m-link {
  color: var(--tc-link) !important;
  background-color: transparent !important;
  padding: 0 !important;
  text-decoration: none !important;
}

.pf-c-button.pf-m-link:hover {
  color: var(--bg-primary-hover) !important;
  text-decoration: underline !important;
}

/* ===== ALERTS/MESSAGES ===== */
.pf-c-alert {
  border-radius: var(--br-md) !important;
  border: none !important;
  margin-bottom: 1.5rem !important;
}

/* Success alert */
.pf-c-alert.pf-m-success {
  background-color: #e6fbf0 !important;
  color: #055a3d !important;
}

.pf-c-alert.pf-m-success .pf-c-alert__icon {
  color: var(--bg-secondary) !important;
}

/* Danger/Error alert */
.pf-c-alert.pf-m-danger {
  background-color: #fde2e2 !important;
  color: #7d1d1d !important;
}

.pf-c-alert.pf-m-danger .pf-c-alert__icon {
  color: var(--bg-danger) !important;
}

/* Warning alert */
.pf-c-alert.pf-m-warning {
  background-color: #fff5e6 !important;
  color: #7d5a1a !important;
}

.pf-c-alert.pf-m-warning .pf-c-alert__icon {
  color: var(--bg-warning) !important;
}

/* Info alert */
.pf-c-alert.pf-m-info {
  background-color: #e3f6ff !important;
  color: #0a4d7a !important;
}

.pf-c-alert.pf-m-info .pf-c-alert__icon {
  color: var(--bg-info) !important;
}

/* ===== TABLES ===== */
.pf-c-table {
  border-collapse: collapse;
  width: 100%;
}

.pf-c-table__thead {
  background-color: #f5f6f7 !important;
  border-bottom: 2px solid #e8eaed !important;
}

.pf-c-table__th {
  padding: 1rem 1.5rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--tc-surface) !important;
  text-transform: none !important;
}

.pf-c-table__tr {
  border-bottom: 1px solid #e8eaed !important;
}

.pf-c-table__tr:hover {
  background-color: #f5f6f7 !important;
}

.pf-c-table__td {
  padding: 1rem 1.5rem !important;
  color: var(--tc-surface) !important;
  font-size: 0.95rem !important;
}

/* ===== TABS ===== */
.pf-c-tabs__nav {
  border-bottom: 2px solid #e8eaed !important;
}

.pf-c-tabs__item {
  margin: 0 1rem !important;
  border-bottom: 3px solid transparent !important;
  padding-bottom: 1rem !important;
  color: var(--tc-surface-low) !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
}

.pf-c-tabs__item:hover {
  color: var(--tc-surface) !important;
}

.pf-c-tabs__item.pf-m-current {
  border-bottom-color: var(--bg-primary) !important;
  color: var(--bg-primary) !important;
  font-weight: 600 !important;
}

/* ===== MODALS/DIALOGS ===== */
.pf-c-modal-box {
  border-radius: var(--br-md) !important;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2) !important;
  border: none !important;
}

.pf-c-modal-box__header {
  padding: 1.5rem !important;
  border-bottom: 1px solid #e8eaed !important;
}

.pf-c-modal-box__title {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: var(--tc-surface) !important;
}

.pf-c-modal-box__body {
  padding: 1.5rem !important;
}

.pf-c-modal-box__footer {
  padding: 1.5rem !important;
  border-top: 1px solid #e8eaed !important;
  background-color: #f5f6f7 !important;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* ===== DROPDOWNS ===== */
.pf-c-menu {
  border-radius: var(--br-md) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid #e8eaed !important;
}

.pf-c-menu__item {
  padding: 0.75rem 1rem !important;
  color: var(--tc-surface) !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease;
}

.pf-c-menu__item:hover {
  background-color: #f5f6f7 !important;
}

/* ===== BADGES ===== */
.pf-c-badge {
  background-color: #f5f6f7 !important;
  color: var(--tc-surface) !important;
  border-radius: var(--br-xs) !important;
  padding: 0.25rem 0.75rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
}

.pf-c-badge.pf-m-blue {
  background-color: rgba(74, 144, 217, 0.1) !important;
  color: var(--bg-primary) !important;
}

.pf-c-badge.pf-m-green {
  background-color: rgba(34, 197, 94, 0.1) !important;
  color: var(--bg-secondary) !important;
}

.pf-c-badge.pf-m-red {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: var(--bg-danger) !important;
}

/* ===== TOOLTIPS ===== */
.pf-c-tooltip {
  background-color: #1b1f2e !important;
  color: white !important;
  border-radius: var(--br-xs) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .pf-c-page__sidebar {
    width: 220px !important;
  }

  .pf-c-page__main-section {
    padding: 1.5rem !important;
  }
}

@media (max-width: 768px) {
  /* Hide sidebar on tablet */
  .pf-c-page__sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .pf-c-page__sidebar.pf-m-expanded {
    left: 0;
  }

  /* Full width main content */
  .pf-c-page__main {
    width: 100%;
  }

  /* Adjusted header */
  .pf-c-page__header {
    padding: 1rem !important;
  }

  /* Adjusted spacing */
  .pf-c-page__main-section {
    padding: 1rem !important;
  }

  .pf-c-card {
    padding: 1rem !important;
  }

  .pf-c-table {
    font-size: 0.875rem !important;
  }

  .pf-c-table__th,
  .pf-c-table__td {
    padding: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  /* Extra small phones */
  .pf-c-page__header-brand-link {
    font-size: 1.25rem !important;
  }

  .pf-c-page-header-title {
    font-size: 1.5rem !important;
  }

  .pf-c-button {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
  }

  .pf-c-form__group {
    margin-bottom: 1.5rem !important;
  }
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .pf-c-page__sidebar,
  .pf-c-page__header,
  .pf-c-button {
    display: none !important;
  }

  body {
    background-color: white !important;
  }
}
