/* AILHC - Common Styles */

:root {
  /* Elegant Brand Palette */
  --bg-body: #f9f9f9; /* Warm Alabaster */
  --bg-surface: #ffffff; /* Pure White */
  --bg-surface-hover: #fcfbf9; /* Very light warm tint */

  --text-primary: #676767; /* Logo Dark Grey */
  --text-secondary: #7d7d80; /* Medium Grey */
  --text-tertiary: #b0b0b3; /* Light Grey */

  /* Brand Colors */
  --primary-color: #4c4c4e; /* Logo Dark Grey (Primary Action) */
  --primary-inverse: #ffffff;

  /* Elegant Accents */
  --accent-gold: #92866a; /* Logo Muted Gold */
  --accent-blue: #5c7c94; /* Slate Blue */
  --accent-green: #5c946e; /* Sage */
  --accent-red: #945c5c; /* Marsala */
  --accent-purple: #785c94; /* Muted Violet */

  /* Functional Colors */
  --success-color: var(--accent-green);
  --danger-color: var(--accent-red);
  --warning-color: var(--accent-gold);
  --info-color: var(--accent-blue);

  --border-color: rgba(76, 76, 78, 0.1); /* Subtle grey border */

  /* Glassmorphism Effects */
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px rgba(76, 76, 78, 0.05);

  /* Shadows - Soft & Diffused */
  --shadow-sm: 0 2px 8px rgba(76, 76, 78, 0.04);
  --shadow-md: 0 8px 24px rgba(76, 76, 78, 0.06);
  --shadow-lg: 0 16px 48px rgba(76, 76, 78, 0.1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 80%; /* Scaled down by 20% (from 100% or 16px) */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  background-image: none;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography - Clean Sans */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.03em; /* Tighter tracking for modern look */
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Login Page Styles */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  padding: 20px;
}

.login-container {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 60px 48px;
  width: 100%;
  max-width: 480px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.login-header {
  text-align: center;
  margin-bottom: 48px;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.login-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 16px;
}

.form-control {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all 0.2s;
  background-color: var(--bg-body);
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(146, 134, 106, 0.2);
  outline: none;
}

.form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all 0.2s;
  background-color: var(--bg-body);
  color: var(--text-primary);
}

.form-select:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(146, 134, 106, 0.2);
  outline: none;
}

/* Modern Form Aliases & Extras */
.form-select-modern {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all 0.2s;
  background-color: var(--bg-body);
  color: var(--text-primary);
}

.form-select-modern:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(146, 134, 106, 0.2);
  outline: none;
}

.form-label-modern {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Buttons - High Contrast */
.btn {
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 2rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-transform: none;
  border: none;
}

.btn-modern {
  border-radius: var(--radius-pill);
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s ease;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary-modern {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #7a7155 100%);
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: var(
    --radius-pill
  ); /* Ensure pill shape if used with btn class, or override if needed */
  padding: 0.6rem 1.25rem;
}

.btn-primary-modern:hover {
  background: linear-gradient(135deg, #b39b5e 0%, #635c45 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 158, 94, 0.3);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--primary-inverse);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: white;
}

.btn-login {
  background-color: var(--primary-color);
  color: var(--primary-inverse);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  height: auto;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background-color: #222;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-login:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Dashboard Styles */
.navbar-ailhc {
  background: transparent; /* Fully transparent, content floats */
  border-bottom: none;
  box-shadow: none;
  height: 80px;
  padding-top: 16px;
}

.sidebar {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  min-height: calc(100vh - 32px);
  margin: 16px 0 16px 16px;
  border-radius: var(--radius-lg);
  padding: 24px 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-sm);
  height: calc(100vh - 32px); /* Ensure it takes height */
  overflow-y: auto; /* Scrollable if needed */
}

.sidebar-nav {
  list-style: none;
  padding: 0 16px;
}

.sidebar-nav li {
  margin-bottom: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  margin-left: 0;
  width: 100%;
}

.sidebar-nav a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-nav a.active {
  background-color: var(--primary-color);
  color: var(--primary-inverse);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Brand active override if needed, but black/white is preferred */
.sidebar-nav a.active.brand-active {
  background-color: var(--primary-color);
  color: var(--primary-inverse);
}

.menu-section {
  padding: 24px 20px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
}

.sidebar-nav i {
  margin-right: 16px;
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: inherit;
}

.main-content {
  padding: 16px 32px;
  background: transparent;
  min-height: calc(100vh - 80px);
}

/* Cards - Glassmorphism Borderless */
.card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.5); /* Very subtle white border for glass edge */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  margin-bottom: 24px;
  overflow: hidden; /* Keep content inside radius */
}

.card:hover {
  box-shadow: var(--shadow-md);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 24px;
}

/* Badges - High Contrast Pills */
.badge {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Tables - Clean Data View */
.table {
  background: transparent;
  border-radius: 0;
  margin-bottom: 0;
  --bs-table-bg: transparent;
}

.table thead th {
  background: transparent;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  padding: 16px 24px;
}

.table tbody td {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Loading Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .login-container {
    padding: 32px 24px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 16px;
  }
}

/* Utility Classes */
.text-muted {
  color: var(--text-secondary) !important;
}

.bg-light {
  background-color: rgba(255, 255, 255, 0.5) !important;
}

.border-radius-lg {
  border-radius: var(--radius-lg);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

/* Module Card Specifics (Apple Style) */
.module-card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 32px;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Remove accent line for cleaner look */
.module-card::before {
  display: none;
}

.module-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  background: var(--bg-surface);
}

.module-card .module-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px; /* Squircle */
  background-color: var(--accent-gold);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--bg-body);
  transition: all 0.3s ease;
}

.module-card:hover .module-icon {
  transform: scale(1.05);
  background-color: var(--accent-gold);
  color: white;
}

.module-card h5 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.module-card .module-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.module-card .module-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 32px;
  flex-grow: 1;
}

.btn-module {
  color: var(--text-primary);
  background: transparent;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-module:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--bg-body);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dashboard-header {
  background: transparent;
  color: var(--text-primary);
  padding: 0 0 32px 0;
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  background: none;
  background-clip: border-box;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: currentcolor;
}

.dashboard-header .subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  letter-spacing: -0.03em;
}

/* Financial Data Visualization Accents */
.text-accent-blue {
  color: var(--accent-blue) !important;
}
.text-accent-green {
  color: var(--accent-green) !important;
}
.text-accent-red {
  color: var(--accent-red) !important;
}
.text-accent-purple {
  color: var(--accent-purple) !important;
}

.bg-accent-blue {
  background-color: var(--accent-blue) !important;
  color: white;
}
.bg-accent-green {
  background-color: var(--accent-green) !important;
  color: black;
}
.bg-accent-red {
  background-color: var(--accent-red) !important;
  color: white;
}

/* Notebook Feel - Grid Lines */
.notebook-grid {
  background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Modern Tabs */
.nav-tabs {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s;
  background: transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.nav-tabs .nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  background: transparent;
  border-bottom: 2px solid var(--accent-gold);
}

/* Modern Modal */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--bg-surface);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
}
