/* Morning Ag Clips Theme for Publisher Application */
/* Inspired by the professional agricultural news aesthetic */

/* Custom CSS Variables for Morning Ag Theme */
:root {
  /* Primary Brand Colors - Deep Red Palette */
  --ag-primary: #ae2e1f;
  --ag-primary-dark: #b31b1d;
  --ag-primary-light: #d45540;
  --ag-primary-lighter: #e8776a;
  --ag-primary-subtle: #f8e8e6;

  /* Secondary Colors */
  --ag-secondary: #5a5a5a;
  --ag-secondary-light: #8a8a8a;
  --ag-secondary-dark: #333333;

  /* Background Colors */
  --ag-bg-primary: #ffffff;
  --ag-bg-secondary: #f7f7f7;
  --ag-bg-tertiary: #f0f0f0;
  --ag-bg-dark: #2c2c2c;

  /* Text Colors */
  --ag-text-primary: #333333;
  --ag-text-secondary: #666666;
  --ag-text-muted: #999999;
  --ag-text-white: #ffffff;

  /* Typography */
  --ag-font-serif: "Times New Roman", "Georgia", serif;
  --ag-font-sans: "Arial", "Helvetica Neue", "Helvetica", sans-serif;
  --ag-font-condensed: "Arial Narrow", "Arial", sans-serif;

  /* Shadows and Effects */
  --ag-shadow-light: 0 2px 4px rgba(174, 46, 31, 0.1);
  --ag-shadow-medium: 0 4px 12px rgba(174, 46, 31, 0.15);
  --ag-shadow-heavy: 0 8px 24px rgba(174, 46, 31, 0.2);

  /* Border Radius */
  --ag-radius-sm: 3px;
  --ag-radius-md: 5px;
  --ag-radius-lg: 8px;
}

/* Override Falcon Theme Colors with Ag Theme */
:root,
[data-bs-theme=light] {
  --falcon-primary: var(--ag-primary);
  --falcon-primary-rgb: 174, 46, 31;
  --falcon-danger: var(--ag-primary-dark);
  --falcon-danger-rgb: 179, 27, 29;
  --falcon-body-bg: var(--ag-bg-secondary);
  --falcon-body-bg-rgb: 247, 247, 247;
  --falcon-body-color: var(--ag-text-primary);
  --falcon-heading-color: var(--ag-text-primary);
  --falcon-link-color: var(--ag-primary);
  --falcon-link-hover-color: var(--ag-primary-dark);
}

/* Typography Overrides */
body {
  font-family: var(--ag-font-sans);
  background-color: var(--ag-bg-secondary);
  color: var(--ag-text-primary);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--ag-font-serif);
  font-weight: 600;
  color: var(--ag-text-primary);
  margin-bottom: 0.75rem;
}

h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

/* Navigation Brand */
.navbar-brand {
  font-family: var(--ag-font-serif);
  font-weight: 700;
  color: var(--ag-primary) !important;
  font-size: 1.5rem;
  text-decoration: none;
}

.ag-brand-text {
  font-family: var(--ag-font-serif);
  font-weight: 700;
  color: var(--ag-primary);
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

/* Sidebar Navigation Styling */
.navbar-vertical {
  background-color: var(--ag-bg-primary);
  border-right: 2px solid var(--ag-primary);
  box-shadow: var(--ag-shadow-medium);
}

.navbar-vertical .nav-link {
  color: var(--ag-text-secondary);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: var(--ag-radius-sm);
  margin: 0.125rem 0.5rem;
  transition: all 0.2s ease;
}

.navbar-vertical .nav-link:hover {
  background-color: var(--ag-primary-subtle);
  color: var(--ag-primary);
  transform: translateX(3px);
}

.navbar-vertical .nav-link.active {
  background-color: var(--ag-primary);
  color: var(--ag-text-white);
  font-weight: 600;
}

.navbar-vertical .nav-link-icon {
  color: var(--ag-primary);
  margin-right: 0.5rem;
  width: 1.25rem;
  text-align: center;
  font-size: 1.5625em !important;
}

.navbar-vertical .nav-link-icon span {
  font-size: 1.5625em !important;
}

.navbar-vertical .nav-link-icon .fas,
.navbar-vertical .nav-link-icon .far,
.navbar-vertical .nav-link-icon .fab {
  font-size: 1.5625em !important;
}

.navbar-vertical .navbar-vertical-label {
  color: var(--ag-primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--ag-font-condensed);
}

/* Card Styling */
.card {
  border: 1px solid #e5e5e5;
  border-radius: var(--ag-radius-md);
  box-shadow: var(--ag-shadow-light);
  background-color: var(--ag-bg-primary);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: var(--ag-bg-secondary);
  border-bottom: 2px solid var(--ag-primary);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--ag-text-primary);
}

.card-header h5,
.card-header .h5 {
  margin-bottom: 0;
  color: var(--ag-primary);
  font-family: var(--ag-font-serif);
  text-transform: uppercase;
  font-size: 1.5rem !important;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.card-body {
  padding: 1.25rem;
}

/* Button Styling */
.btn-primary {
  background-color: var(--ag-primary);
  border-color: var(--ag-primary);
  color: var(--ag-text-white);
  font-weight: 500;
  border-radius: var(--ag-radius-sm);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--ag-primary-dark);
  border-color: var(--ag-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--ag-shadow-medium);
}

.btn-outline-primary {
  color: var(--ag-primary);
  border-color: var(--ag-primary);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--ag-primary);
  border-color: var(--ag-primary);
  color: var(--ag-text-white);
}

.btn-success {
  background-color: #2d5a2d;
  border-color: #2d5a2d;
}

.btn-danger {
  background-color: var(--ag-primary-dark);
  border-color: var(--ag-primary-dark);
}

/* Table Styling */
.table {
  background-color: var(--ag-bg-primary);
  border-radius: var(--ag-radius-md);
  overflow: hidden;
}

.table th {
  background-color: var(--ag-primary);
  color: var(--ag-text-white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  border: none;
  padding: 1rem 0.75rem;
}

.table td {
  padding: 0.875rem 0.75rem;
  border-color: #e5e5e5;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: var(--ag-primary-subtle);
}

/* Email Table Column Width Adjustments */
#emailTable th:nth-child(3),
#emailTable td:nth-child(3) {
  width: 140px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#emailTable th:nth-child(6),
#emailTable td:nth-child(6) {
  width: auto;
  min-width: 250px;
}

/* Extracted Inline Styles */
.table-cell-width-28 {
  width: 28px;
}

.warning-icon-large {
  font-size: 4rem;
}

.card-corner-min-width {
  min-width: 12rem;
}

.status-icon-large {
  font-size: 2rem;
}

.star-gold {
  color: gold;
  text-shadow: 1px 1px 1px dimgrey;
}

.star-gold-large {
  color: gold;
  text-shadow: 1px 1px 1px dimgrey;
  font-size: 1.5em;
}

.star-gold-medium {
  color: gold;
  text-shadow: 1px 1px 1px dimgrey;
  font-size: 1.3em;
}

.wordpress-link {
  font-weight: bold;
  font-size: 0.8em;
  text-decoration: underline;
  margin-left: 2px;
}

.unread-email {
  font-weight: bold;
}

.badge-small {
  font-size: 0.7em;
}

.button-spacing {
  margin-left: 20px;
}

.textarea-code {
  width: 100%;
  font-family: monospace;
}

.textarea-code-auto {
  width: auto;
  font-family: monospace;
  caret-color: rgb(0, 0, 0);
  font: inherit;
  font-synthesis-small-caps: inherit;
  font-synthesis-weight: inherit;
  tab-size: inherit;
  padding-left: 60.8px;
}

.attachment-image {
  max-width: 500px;
}

.attachment-image-small {
  max-width: 400px;
  border-radius: 4px;
}

.image-attachment-row {
  cursor: pointer;
}

.featured-image-thumbnail {
  max-width: 200px;
  max-height: 200px;
}

.placeholder-icon-large {
  font-size: 3rem;
}

.notification-bell {
  font-size: 33px;
  transform-origin: 0.4375em 0.5em;
}

.scrollbar-max-height {
  max-height: 19rem;
}

.container-centered {
  max-width: 600px;
}

.text-right {
  text-align: right;
}

.hidden {
  display: none;
}

/* Badge Styling */
.badge {
  font-weight: 500;
  border-radius: var(--ag-radius-sm);
  padding: 0.375rem 0.75rem;
}

.badge.bg-success {
  background-color: #2d5a2d !important;
}

.badge.bg-primary {
  background-color: var(--ag-primary) !important;
}

.badge.bg-danger {
  background-color: var(--ag-primary-dark) !important;
}

.badge.bg-warning {
  background-color: #b8860b !important;
  color: var(--ag-text-white);
}

/* Alert Styling */
.alert {
  border-radius: var(--ag-radius-md);
  border-left: 4px solid;
  font-weight: 500;
}

.alert-primary {
  background-color: var(--ag-primary-subtle);
  border-left-color: var(--ag-primary);
  color: var(--ag-primary-dark);
}

.alert-success {
  background-color: #e8f4e8;
  border-left-color: #2d5a2d;
  color: #1a3d1a;
}

.alert-danger {
  background-color: var(--ag-primary-subtle);
  border-left-color: var(--ag-primary-dark);
  color: var(--ag-primary-dark);
}

.alert-warning {
  background-color: #fff8e1;
  border-left-color: #b8860b;
  color: #8b6914;
}

/* Form Styling */
.form-control {
  border: 2px solid #e5e5e5;
  border-radius: var(--ag-radius-sm);
  padding: 0.75rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--ag-primary);
  box-shadow: 0 0 0 0.2rem rgba(174, 46, 31, 0.15);
}

.form-label {
  font-weight: 600;
  color: var(--ag-text-primary);
  margin-bottom: 0.5rem;
}

/* Dropdown Styling */
.dropdown-menu {
  border: 1px solid #e5e5e5;
  border-radius: var(--ag-radius-md);
  box-shadow: var(--ag-shadow-medium);
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  color: var(--ag-text-secondary);
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--ag-primary-subtle);
  color: var(--ag-primary);
}

.dropdown-item.active {
  background-color: var(--ag-primary);
  color: var(--ag-text-white);
}

/* Breadcrumb Styling */
.breadcrumb {
  background-color: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--ag-primary);
  content: "›";
  font-weight: bold;
}

.breadcrumb-item a {
  color: var(--ag-primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--ag-text-secondary);
}

/* Page Header Styling */
.page-header {
  background: linear-gradient(135deg, var(--ag-primary) 0%, var(--ag-primary-dark) 100%);
  color: var(--ag-text-white);
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: var(--ag-radius-lg);
}

.page-header h1,
.page-header .h1 {
  color: var(--ag-text-white);
  margin-bottom: 0.5rem;
}

/* Status Indicators */
.status-healthy {
  color: #2d5a2d;
  background-color: #e8f4e8;
}

.status-warning {
  color: #b8860b;
  background-color: #fff8e1;
}

.status-critical {
  color: var(--ag-primary-dark);
  background-color: var(--ag-primary-subtle);
}

/* Custom Agricultural Icons */
.ag-icon {
  color: var(--ag-primary);
  margin-right: 0.5rem;
}

.ag-icon-large {
  font-size: 2rem;
  color: var(--ag-primary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .navbar-vertical {
    border-right: none;
    border-bottom: 2px solid var(--ag-primary);
  }

  .card {
    margin-bottom: 1rem;
  }

  .page-header {
    padding: 1.5rem 0;
  }

  h1, .h1 { font-size: 2rem; }
  h2, .h2 { font-size: 1.75rem; }
  h3, .h3 { font-size: 1.5rem; }
}

/* Animation and Transitions */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--ag-primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Metric Cards for Dashboard */
.ag-metric-card {
  border: 2px solid var(--ag-primary);
  border-radius: var(--ag-radius-lg);
  background: linear-gradient(135deg, var(--ag-bg-primary) 0%, var(--ag-bg-tertiary) 100%);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ag-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ag-primary) 0%, var(--ag-primary-dark) 100%);
}

.ag-metric-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ag-shadow-heavy);
  border-color: var(--ag-primary-dark);
}

.ag-metric-value {
  color: var(--ag-primary);
  font-weight: 700;
  font-family: var(--ag-font-condensed);
}

.ag-metric-card .card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ag-text-secondary);
  letter-spacing: 1px;
  font-family: var(--ag-font-condensed);
}

/* Enhanced Status Indicators */
.status-healthy {
  color: #2d5a2d !important;
}

.status-warning {
  color: #b8860b !important;
}

.status-critical {
  color: var(--ag-primary-dark) !important;
}

/* Custom Focus States */
*:focus {
  outline: 2px solid var(--ag-primary);
  outline-offset: 2px;
}