/* COPP Middleware - Purple theme (dashboard + login) */

:root {
  --purple-primary: #7c3aed;
  --purple-primary-hover: #6d28d9;
  --purple-light: rgba(124, 58, 237, 0.15);
  --purple-gradient-start: #667eea;
  --purple-gradient-end: #764ba2;
}

body {
  background-color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.dashboard-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  background-color: #f9fafb;
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.d-flex.flex-grow-1 {
  overflow: hidden;
}

/* Header - match Dow Jones structure */
.dashboard-header {
  background-color: white;
  padding: 16px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.dashboard-header .header-title {
  color: #111827;
  font-weight: 600;
  font-size: 20px;
  margin: 0;
}

/* Sidebar */
.dashboard-sidebar {
  background-color: var(--purple-primary);
  color: white;
  padding: 0;
  width: 250px;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.dashboard-sidebar .sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.dashboard-sidebar .sidebar-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.dashboard-sidebar .sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.dashboard-sidebar .sidebar-badge {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.dashboard-sidebar .sidebar-nav {
  padding: 16px 0;
  flex: 1;
  overflow-y: auto;
}

.dashboard-sidebar .nav-link {
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
}

.dashboard-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.dashboard-sidebar .nav-link.active-nav {
  background-color: rgba(255, 255, 255, 0.15);
  border-left-color: white;
  color: white;
  font-weight: 500;
}

.dashboard-sidebar .nav-link.logout-btn {
  color: #fca5a5;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 1rem;
}

.dashboard-sidebar .nav-link.logout-btn:hover {
  color: #f87171;
  background-color: rgba(255, 255, 255, 0.1);
}

.dashboard-sidebar .sidebar-nav-group > .nav-link {
  font-weight: 500;
}

.dashboard-sidebar .sidebar-submenu {
  list-style: none;
  padding: 0 0 4px 0;
  margin: 0;
}

.dashboard-sidebar .sidebar-submenu li {
  margin: 0;
}

.dashboard-sidebar .sidebar-submenu-link {
  padding: 8px 16px 8px 44px !important;
  font-size: 0.875rem;
  font-weight: 400;
  border-left: 3px solid transparent;
  gap: 8px;
}

.dashboard-sidebar .sidebar-submenu-link i {
  font-size: 0.95rem;
  opacity: 0.95;
}

.dashboard-sidebar .sidebar-submenu-link.active-nav {
  font-weight: 500;
}

/* Cards */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: white;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 20px;
  font-weight: 600;
  color: #111827;
  border-radius: 8px 8px 0 0;
}

.card-body {
  padding: 20px;
}

/* Stat cards */
.stat-card {
  border: none;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.stat-label {
  color: #6c757d;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  font-size: 2rem;
  opacity: 0.35;
}

/* Buttons - purple */
.btn-primary {
  background-color: var(--purple-primary);
  border-color: var(--purple-primary);
}

.btn-primary:hover {
  background-color: var(--purple-primary-hover);
  border-color: var(--purple-primary-hover);
}

.btn-outline-primary {
  border-color: var(--purple-primary);
  color: var(--purple-primary);
}

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

.btn {
  border-radius: 6px;
  font-weight: 500;
  padding: 10px 20px;
  font-size: 14px;
  transition: all 0.2s;
}

/* Form controls */
.form-control,
.form-select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: #111827;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px var(--purple-light);
  outline: none;
}

/* Tables - match Dow Jones */
.table {
  background-color: white;
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 2px solid #e5e7eb;
  color: #374151;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
}

.table tbody tr:hover {
  background-color: #f9fafb;
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: #111827;
  font-weight: 600;
}

/* Page headers - match Dow Jones */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

main h1.h3,
main .page-title {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 24px;
}

/* Login page - matches Dow Jones UI structure, purple theme */
body.login-page {
  background-color: #f5f5f5;
  min-height: 100vh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.login-page .login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

body.login-page .login-card {
  width: 100%;
  max-width: 450px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

body.login-page .login-header {
  background: var(--purple-primary);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

body.login-page .login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
}

body.login-page .login-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: white;
}

body.login-page .login-header p {
  font-size: 14px;
  opacity: 0.95;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

body.login-page .login-body {
  padding: 30px;
  background: white;
}

body.login-page .form-group-custom {
  margin-bottom: 20px;
}

body.login-page .form-icon-wrapper {
  position: relative;
}

body.login-page .form-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  z-index: 10;
  width: 18px;
  height: 18px;
  font-size: 18px;
  pointer-events: none;
}

body.login-page .form-control-custom {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

body.login-page .form-control-custom:focus {
  outline: none;
  border-color: var(--purple-primary);
  box-shadow: 0 0 0 3px var(--purple-light);
}

body.login-page .form-control-custom::placeholder {
  color: #9ca3af;
}

body.login-page .btn-signin {
  width: 100%;
  padding: 12px;
  background: var(--purple-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

body.login-page .btn-signin:hover {
  background: var(--purple-primary-hover);
  color: white;
}

body.login-page .btn-signin:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--purple-light);
}

body.login-page .btn-signin:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

body.login-page .credentials-box {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin-top: 24px;
}

body.login-page .credentials-title {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.login-page .info-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  color: var(--purple-primary);
  flex-shrink: 0;
}

body.login-page .credentials-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

body.login-page .credentials-row:last-of-type {
  margin-bottom: 0;
}

body.login-page .credentials-label {
  color: #6b7280;
  font-weight: 400;
}

body.login-page .credentials-value {
  color: #111827;
  font-weight: 500;
}

body.login-page .credentials-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dc2626;
  font-size: 12px;
  margin-top: 12px;
  font-weight: 400;
}

body.login-page .warning-icon {
  width: 14px;
  height: 14px;
  font-size: 14px;
  flex-shrink: 0;
}

body.login-page .nav-buttons {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

body.login-page .btn-nav {
  flex: 1;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

body.login-page .btn-nav-back {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

body.login-page .btn-nav-back:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

body.login-page .btn-nav-docs {
  background: var(--purple-primary);
  color: white;
  border: none;
}

body.login-page .btn-nav-docs:hover {
  background: var(--purple-primary-hover);
  color: white;
}

body.login-page .nav-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

body.login-page .alert-custom {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

body.login-page .alert {
  border-radius: 6px;
  border: none;
}

/* Filter card - same as other cards */
.filter-card .card-header {
  font-weight: 600;
  color: #111827;
}

/* Chart containers - use card layout like Dow Jones */
.chart-container {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  border: none;
}

.chart-container h5 {
  margin-bottom: 1rem;
  font-weight: 600;
  color: #111827;
  font-size: 1rem;
}

/* DataTables overrides for purple */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: var(--purple-primary) !important;
  border-color: var(--purple-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  border-color: var(--purple-primary);
  color: var(--purple-primary) !important;
}

/* Nav tabs */
.nav-tabs .nav-link.active {
  color: var(--purple-primary);
  border-color: #dee2e6 #dee2e6 #fff;
  font-weight: 500;
}

.nav-tabs .nav-link:hover {
  color: var(--purple-primary-hover);
}
