﻿body {
  background: linear-gradient(135deg, #0a1e4a 0%, #1b2e6f 100%) !important;
  color: #ffffff;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

/* Headers */
h1, h2, h3, h4, h6 {
  color: white !important;
}

/* Buttons */
.btn-primary {
  background-color: #258cfb;
  border-color: #258cfb;
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: #1a5fb4;
  border-color: #1a5fb4;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: #f2f4f8;
  border-color: #f2f4f8;
  color: #258cfb;
  border-radius: 0.5rem;
  font-weight: 600;
}
.btn-secondary:hover, .btn-secondary:focus {
  background-color: #e9ecef;
  color: #1a5fb4;
}

/* Links */
a {
  color: #258cfb;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover, a:focus {
  color: #1a5fb4;
  text-decoration: underline;
}

/* Forms */
.form-control, .form-select {
  border-radius: 0.5rem;
  border: 1px solid #dbe3ea;
  background: #ffffff;
  color: #222e3a;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: #258cfb;
  box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.1);
}

/* Admin page form styling - ensure white backgrounds */
.admin-page .form-control,
.admin-page .form-select,
.admin-page input[type=text],
.admin-page input[type=email],
.admin-page input[type=password],
.admin-page input[type=number],
.admin-page input[type=tel],
.admin-page input[type=url],
.admin-page input[type=search],
.admin-page input[type=date],
.admin-page input[type=datetime-local],
.admin-page input[type=month],
.admin-page input[type=week],
.admin-page input[type=time],
.admin-page textarea,
.admin-page select {
  background: #ffffff !important;
  color: #222e3a !important;
  border: 1px solid #dbe3ea;
}
.admin-page .form-control::placeholder,
.admin-page .form-select::placeholder,
.admin-page input[type=text]::placeholder,
.admin-page input[type=email]::placeholder,
.admin-page input[type=password]::placeholder,
.admin-page input[type=number]::placeholder,
.admin-page input[type=tel]::placeholder,
.admin-page input[type=url]::placeholder,
.admin-page input[type=search]::placeholder,
.admin-page input[type=date]::placeholder,
.admin-page input[type=datetime-local]::placeholder,
.admin-page input[type=month]::placeholder,
.admin-page input[type=week]::placeholder,
.admin-page input[type=time]::placeholder,
.admin-page textarea::placeholder,
.admin-page select::placeholder {
  color: #6c757d !important;
}
.admin-page .form-control:focus,
.admin-page .form-select:focus,
.admin-page input[type=text]:focus,
.admin-page input[type=email]:focus,
.admin-page input[type=password]:focus,
.admin-page input[type=number]:focus,
.admin-page input[type=tel]:focus,
.admin-page input[type=url]:focus,
.admin-page input[type=search]:focus,
.admin-page input[type=date]:focus,
.admin-page input[type=datetime-local]:focus,
.admin-page input[type=month]:focus,
.admin-page input[type=week]:focus,
.admin-page input[type=time]:focus,
.admin-page textarea:focus,
.admin-page select:focus {
  background: #ffffff !important;
  color: #222e3a !important;
  border-color: #258cfb;
}

/* Global form control overrides */
.form-control,
.form-select,
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=tel],
input[type=url],
input[type=search],
input[type=date],
input[type=datetime-local],
input[type=month],
input[type=week],
input[type=time],
textarea,
select {
  background: #ffffff !important;
  color: #222e3a !important;
}
.form-control::placeholder,
.form-select::placeholder,
input[type=text]::placeholder,
input[type=email]::placeholder,
input[type=password]::placeholder,
input[type=number]::placeholder,
input[type=tel]::placeholder,
input[type=url]::placeholder,
input[type=search]::placeholder,
input[type=date]::placeholder,
input[type=datetime-local]::placeholder,
input[type=month]::placeholder,
input[type=week]::placeholder,
input[type=time]::placeholder,
textarea::placeholder,
select::placeholder {
  color: #6c757d !important;
}
.form-control:focus,
.form-select:focus,
input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
input[type=number]:focus,
input[type=tel]:focus,
input[type=url]:focus,
input[type=search]:focus,
input[type=date]:focus,
input[type=datetime-local]:focus,
input[type=month]:focus,
input[type=week]:focus,
input[type=time]:focus,
textarea:focus,
select:focus {
  background: #ffffff !important;
  color: #222e3a !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  color: white !important;
}

/* Card/Panel */
.card, .panel, .modal-content {
  border-radius: 1rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  border: none;
}

/* Accent highlight */
.accent {
  color: #ffd600;
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, rgb(2, 3, 129) 0%, rgb(40, 116, 252) 100%) !important;
  color: #ffffff;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(10, 30, 74, 0.1);
}

/* Utility */
.mt-4 {
  margin-top: 2rem !important;
}

.mb-4 {
  margin-bottom: 2rem !important;
}

.p-4 {
  padding: 2rem !important;
}

/* Account partial margin */
.account {
  margin: 0.5rem !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: #6c757d;
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ============================================================================
   CUSTOM STYLES FOR INDEX.CSHTML
   ============================================================================ */
.background-overlay {
  display: none !important;
}

/* Expandable row styles */
.expandable-row {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.expandable-row:hover {
  background-color: rgba(37, 140, 251, 0.05) !important;
  border-left-color: #258cfb;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(37, 140, 251, 0.1);
}
.expandable-row:hover .toggle-nodes-icon {
  background-color: rgba(37, 140, 251, 0.2) !important;
  transform: scale(1.1);
}
.expandable-row:hover .toggle-nodes-icon svg {
  color: #258cfb !important;
}
.expandable-row.expanded {
  background-color: rgba(37, 140, 251, 0.08) !important;
  border-left-color: #258cfb;
}
.expandable-row.expanded .toggle-nodes-icon svg {
  transform: rotate(90deg);
}

/* Country nodes row styling */
.country-nodes-row {
  background-color: #f8f9fa;
  border-left: 3px solid #258cfb;
}
.country-nodes-row td {
  padding: 1rem;
  background-color: #f8f9fa;
}

/* Sidebar styles - EXACT FROM IMAGE */
.sidebar-card {
  background: #142a5c;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(10, 30, 74, 0.15);
  color: #ffffff;
  border: none;
}

.sidebar-title {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(203, 230, 255, 0.2);
}

.continent-link {
  color: #cbe6ff;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: block;
  text-decoration: none;
}
.continent-link.active {
  font-weight: 600;
  background: #ffffff !important;
  color: #0a1e4a !important;
  box-shadow: 0 2px 8px rgba(27, 182, 247, 0.1);
  border-left: 4px solid #1bb6f7;
}
.continent-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(2px);
}

/* Main content area - EXACT FROM IMAGE */
.main-content-area {
  background: #1a1a2e;
  min-height: 100vh;
  padding: 2rem;
}

/* Main content card - EXACT FROM IMAGE */
.main-content-card {
  background: #ffffff;
  border-radius: 20px;
  min-height: 400px;
  box-shadow: 0 8px 32px rgba(10, 30, 74, 0.18);
  color: #0a1e4a;
}

/* Table improvements - EXACT FROM IMAGE */
#continent-summary table {
  margin-top: 1rem;
}
#continent-summary .table {
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  color: #0a1e4a;
}
#continent-summary th {
  background: #142a5c;
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 1.05rem;
  border-bottom: 2px solid #1bb6f7;
}
#continent-summary td, #continent-summary th {
  vertical-align: middle;
}
#continent-summary .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.95rem;
  border-radius: 20px;
}
#continent-summary .btn-nodes {
  background: linear-gradient(90deg, #1bb6f7 0%, #258cfb 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(27, 182, 247, 0.1);
  transition: background 0.2s, color 0.2s;
}
#continent-summary .btn-nodes:hover {
  background: #ffd600;
  color: #0a1e4a;
}

/* Table badge styles (for Yes/No) */
#continent-summary .badge-success {
  background: #28a745;
  color: #ffffff;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.35em 0.9em;
  font-size: 0.95em;
}
#continent-summary .badge-danger {
  background: #e74c3c;
  color: #ffffff;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.35em 0.9em;
  font-size: 0.95em;
}

/* Global badge overrides for Bootstrap 5 */
.badge.bg-success {
  background: #28a745 !important;
  color: #ffffff !important;
}

.badge.bg-danger {
  background: #e74c3c !important;
  color: #ffffff !important;
}

/* Responsive tweaks */
@media (max-width: 991.98px) {
  .sidebar-card {
    margin-bottom: 1rem;
  }
  .main-content-card {
    margin-top: 1rem;
  }
}
/* ============================================================================
   HUDAGRO NAVBAR
   ============================================================================ */
.navbar-hudagro {
  background: linear-gradient(135deg, rgb(2, 3, 129) 0%, rgb(40, 116, 252) 100%) !important;
  color: #ffffff;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(10, 30, 74, 0.1);
}
.navbar-hudagro .navbar-brand {
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 1.35rem;
}
.navbar-hudagro .nav-link-hudagro {
  color: #cbe6ff !important;
  font-weight: 500;
  margin-right: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  padding: 0.5rem 1rem;
}
.navbar-hudagro .nav-link-hudagro:hover, .navbar-hudagro .nav-link-hudagro.active {
  background: linear-gradient(90deg, #1bb6f7 0%, #258cfb 100%);
  color: #ffffff !important;
}

/* ============================================================================
   SELECT2 CUSTOM THEME
   ============================================================================ */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: #ffffff !important;
  color: #222e3a !important;
  border: 1px solid #dbe3ea;
  border-radius: 0.5rem;
  min-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #222e3a !important;
  line-height: 36px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #258cfb !important;
  color: #ffffff !important;
  border: none;
  border-radius: 0.5rem;
  margin-top: 4px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #ffffff !important;
}

.select2-dropdown {
  background-color: #ffffff !important;
  color: #222e3a !important;
  border: 1px solid #dbe3ea;
  border-radius: 0 0 0.5rem 0.5rem;
}

.select2-results__option {
  color: #222e3a !important;
  background: #ffffff !important;
  padding: 8px 12px;
  font-size: 1rem;
}
.select2-results__option--highlighted {
  background: linear-gradient(90deg, #258cfb 0%, #1bb6f7 100%) !important;
  color: #ffffff !important;
}
.select2-results__option[aria-selected=true] {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background: #ffffff !important;
  color: #222e3a !important;
  border-radius: 0.5rem;
  border: 1px solid #dbe3ea;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}

/* ============================================================================
   TEXT READABILITY FIXES
   ============================================================================ */
/* Fix readability for expand source text and similar elements */
.expand-source-text,
.click-to-expand,
.expand-text,
.source-expand-text,
[data-expand-text],
.expandable-text,
[class*=expand],
[class*=source],
[class*=click] {
  color: #222e3a !important;
  background-color: transparent !important;
}

/* Specific fix for "Click to expand source" text */
.main-content-card [class*=expand],
.main-content-card [class*=source],
.main-content-card [class*=click],
.main-content-card [id*=expand],
.main-content-card [id*=source],
.main-content-card [id*=click] {
  color: #222e3a !important;
  background-color: transparent !important;
}
.main-content-card p,
.main-content-card span:not(.btn *),
.main-content-card div:not(.btn *) {
  color: #222e3a !important;
}
.main-content-card .text-white {
  color: #222e3a !important;
}
.main-content-card .text-muted,
.main-content-card .text-secondary {
  color: #6c757d !important;
}
.main-content-card .btn {
  color: #ffffff !important;
}
.main-content-card .expand-source-text,
.main-content-card .click-to-expand,
.main-content-card .expand-text,
.main-content-card .source-expand-text,
.main-content-card [data-expand-text],
.main-content-card .expandable-text {
  color: #222e3a !important;
  background-color: transparent !important;
}

/* Ensure specific text elements in main content area are readable */
.card p,
.card span:not(.btn *),
.card div:not(.btn *), .panel p,
.panel span:not(.btn *),
.panel div:not(.btn *) {
  color: #222e3a;
}
.card .text-white, .panel .text-white {
  color: #222e3a;
}
.card .text-muted,
.card .text-secondary, .panel .text-muted,
.panel .text-secondary {
  color: #6c757d;
}
.card .btn, .panel .btn {
  color: #ffffff;
}

/* ============================================================================
   USER ACCOUNT STYLING
   ============================================================================ */
.account .user .manage {
  color: #ffffff;
  text-decoration: none;
}
.account .user .manage .full-name {
  display: block;
  font-weight: 600;
  color: #ffffff;
}
.account .user .manage .name {
  display: block;
  color: #cbe6ff;
  font-size: 0.9rem;
}
.account .logout {
  background: #258cfb;
  border-color: #258cfb;
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background 0.2s;
}
.account .logout:hover {
  background: #1a5fb4;
  border-color: #1a5fb4;
  color: #ffffff;
}

/* ============================================================================
   INFO BOX STYLING
   ============================================================================ */
.alert-info {
  background: rgba(27, 182, 247, 0.1);
  color: #222e3a;
  border: 1px solid rgba(27, 182, 247, 0.2);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(27, 182, 247, 0.05);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
}
.alert-info .alert-body {
  padding-left: 2.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #222e3a;
}

/* ============================================================================
   SOURCE TAGS STYLING
   ============================================================================ */
.badge.bg-info {
  background: rgba(27, 182, 247, 0.15) !important;
  color: #222e3a !important;
  border: 1px solid rgba(27, 182, 247, 0.3);
  border-radius: 12px;
  padding: 0.35em 0.9em;
  font-size: 0.85em;
  font-weight: 500;
  margin: 0.1rem;
}

/* General badge styling */
.badge {
  border-radius: 12px;
  padding: 0.35em 0.9em;
  font-size: 0.85em;
  font-weight: 500;
  margin: 0.1rem;
}

/* ============================================================================
   TABLE ROW HOVER EFFECTS
   ============================================================================ */
.table tbody tr:hover {
  background-color: rgba(37, 140, 251, 0.05) !important;
}

/* ============================================================================
   EXPAND/COLLAPSE ICON STYLING
   ============================================================================ */
.toggle-nodes-icon {
  background: rgba(37, 140, 251, 0.1);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.toggle-nodes-icon svg {
  color: #258cfb;
  transition: transform 0.2s ease;
}
