/* CrownateStudio Project Cost Transparency Database - Stylesheet */

:root {
  --trans-bg: #030508;
  --trans-surface: #0a0e17;
  --trans-sidebar: #05070c;
  --trans-border: rgba(255, 255, 255, 0.07);
  --trans-accent: #ffd700;
  --trans-accent-rgb: 255, 215, 0;
  --trans-blue: #3b82f6;
  --trans-success: #10b981;
  --trans-danger: #ef4444;
  --trans-warning: #f59e0b;
  --trans-info: #06b6d4;
  --trans-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.trans-page-custom {
  background-color: var(--trans-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 215, 0, 0.015) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.015) 0%, transparent 50%);
  background-attachment: fixed;
  color: #e2e8f0 !important;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* High Contrast Visibility Overrides for Dark Theme elements */
.trans-page-custom h1,
.trans-page-custom h2,
.trans-page-custom h3,
.trans-page-custom h4,
.trans-page-custom h5,
.trans-page-custom h6 {
  color: #ffffff !important;
}

.trans-page-custom label {
  color: #cbd5e1 !important; /* Ensure readable form labels */
  font-weight: 500;
}

.trans-page-custom .text-muted {
  color: #94a3b8 !important; /* Elevate low contrast gray to readable slate-400 */
}

.trans-page-custom a:not(.btn) {
  color: var(--trans-accent) !important;
  text-decoration: none;
  transition: var(--trans-transition);
}

.trans-page-custom a:not(.btn):hover {
  color: #ffffff !important;
  text-decoration: underline;
}

/* Form input styling and autocompletes */
.trans-page-custom .form-control {
  color: #ffffff !important;
  background-color: #05080e !important;
}

.trans-page-custom .form-control::placeholder {
  color: #475569 !important;
  opacity: 0.9 !important;
}

/* Fix autofill styles on dark backgrounds */
.trans-page-custom input:-webkit-autofill,
.trans-page-custom input:-webkit-autofill:hover, 
.trans-page-custom input:-webkit-autofill:focus, 
.trans-page-custom input:-webkit-autofill:active {
  -webkit-background-clip: text;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s;
  box-shadow: inset 0 0 20px 20px #05080e !important;
}

/* Style checkboxes */
.trans-page-custom .form-check-input {
  background-color: #05080e !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.trans-page-custom .form-check-input:checked {
  background-color: var(--trans-accent) !important;
  border-color: var(--trans-accent) !important;
}

/* Glass & Premium Cards */
.glass-panel {
  background: var(--trans-surface);
  border: 1px solid var(--trans-border);
  border-radius: 12px;
  box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.8);
  transition: var(--trans-transition);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Auth Gate UI */
.auth-card-wrapper {
  border-top: 4px solid var(--trans-accent);
  animation: fadeIn 0.4s ease-out;
}

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

.step-dot {
  width: 32px;
  height: 32px;
  background: #111827;
  border: 1px solid var(--trans-border);
  color: #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  transition: var(--trans-transition);
}

.step-dot.active {
  background: var(--trans-accent);
  color: #000;
  border-color: var(--trans-accent);
  box-shadow: 0 0 15px rgba(var(--trans-accent-rgb), 0.3);
}

/* Layout Architecture */
#app-workspace {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
}

.sidebar-wrapper {
  width: 260px;
  background: var(--trans-sidebar);
  border-right: 1px solid var(--trans-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.workspace-main {
  flex-grow: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--trans-bg);
}

.workspace-content {
  flex-grow: 1;
  overflow-y: auto;
}

/* Navigation Links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--trans-transition);
  margin-bottom: 4px;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  padding-left: 20px;
}

.sidebar-link.active {
  background: rgba(255, 215, 0, 0.05);
  color: var(--trans-accent);
  border-left: 3px solid var(--trans-accent);
  border-radius: 0 8px 8px 0;
  padding-left: 18px;
}

.sidebar-link i {
  font-size: 16px;
}

/* KPI Summary Styling */
.kpi-card {
  border-left: 4px solid rgba(255, 255, 255, 0.1);
  padding: 20px !important;
}
.kpi-card.estimated { border-left-color: var(--trans-info); }
.kpi-card.actual { border-left-color: var(--trans-warning); }
.kpi-card.variance { border-left-color: var(--trans-success); }
.kpi-card.compliance { border-left-color: #a855f7; }

/* Spreadsheet Grid System */
.spreadsheet-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--trans-border);
  background: rgba(15, 23, 42, 0.2);
}

.spreadsheet-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #cbd5e1;
}

.spreadsheet-grid th {
  background: #090d16 !important;
  color: #94a3b8 !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.07em;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

.spreadsheet-grid td {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  transition: var(--trans-transition);
  white-space: nowrap;
}

.spreadsheet-grid tr:hover td {
  background: rgba(255, 255, 255, 0.02) !important;
  color: #fff;
}

/* Editable cells */
.editable-cell {
  position: relative;
  cursor: pointer;
  background: rgba(255, 215, 0, 0.005);
  padding-right: 20px !important;
}

.editable-cell:hover {
  background: rgba(255, 215, 0, 0.03) !important;
  box-shadow: inset 0 0 0 1px rgba(var(--trans-accent-rgb), 0.15);
}

.editable-cell::after {
  content: '\F4E5';
  font-family: 'bootstrap-icons';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--trans-accent);
  font-size: 10px;
  transition: opacity 0.2s ease;
}

.editable-cell:hover::after {
  opacity: 0.6;
}

.cell-editor {
  width: 100%;
  background: #05080e !important;
  border: 1px solid var(--trans-accent) !important;
  color: #fff !important;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(var(--trans-accent-rgb), 0.25);
  outline: none;
  font-family: 'JetBrains Mono', monospace;
}

/* Status Badges */
.status-badge {
  font-size: 9px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.under-budget {
  background: rgba(16, 185, 129, 0.1);
  color: var(--trans-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.over-budget {
  background: rgba(239, 68, 68, 0.1);
  color: var(--trans-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge.on-track {
  background: rgba(59, 130, 246, 0.1);
  color: var(--trans-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-badge.flagged {
  background: rgba(245, 158, 11, 0.1);
  color: var(--trans-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Category pills */
.cat-pill {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-transform: uppercase;
  color: #94a3b8;
  transition: var(--trans-transition);
}

.cat-pill.active, .cat-pill:hover {
  background: rgba(255, 215, 0, 0.07);
  color: var(--trans-accent);
  border-color: rgba(255, 215, 0, 0.2);
}

/* Modals Override */
.modal-transparency-content {
  background: #07090f;
  border: 1px solid var(--trans-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 16px;
}

/* Beacon Indicator dot */
.top-beacon-dot {
  width: 7px;
  height: 7px;
  background-color: var(--trans-success);
  border-radius: 50%;
  display: inline-block;
  animation: pulseBeacon 2s infinite;
}

@keyframes pulseBeacon {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Session Warnings Overlay */
.session-warning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(15px);
  z-index: 2000;
}

/* Mock Uploader styles */
.mock-uploader-box {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--trans-border);
  transition: var(--trans-transition);
  cursor: pointer;
}

.mock-uploader-box:hover {
  background: rgba(255, 215, 0, 0.02);
  border-color: var(--trans-accent);
}

/* Forms override */
.form-control, .form-select {
  background-color: #05080e !important;
  border: 1px solid var(--trans-border) !important;
  color: #fff !important;
  font-size: 13px;
  padding: 8px 12px;
  transition: var(--trans-transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--trans-accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--trans-accent-rgb), 0.15) !important;
}

/* Interactive elements buttons */
.btn-warning {
  background-color: var(--trans-accent) !important;
  border-color: var(--trans-accent) !important;
  color: #000 !important;
  transition: var(--trans-transition);
}

.btn-warning:hover {
  background-color: #e6c200 !important;
  border-color: #e6c200 !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(var(--trans-accent-rgb), 0.3) !important;
}

.btn-outline-info {
  color: var(--trans-info) !important;
  border-color: var(--trans-info) !important;
}

.btn-outline-info:hover {
  background-color: var(--trans-info) !important;
  color: #000 !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(6, 182, 212, 0.3) !important;
}

.btn-outline-light {
  color: #94a3b8 !important;
  border-color: var(--trans-border) !important;
}

.btn-outline-light:hover {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
  transform: translateY(-2px);
}

/* Utility details styling */
.text-xxs { font-size: 10px; }
.text-gold { color: var(--trans-accent) !important; }
.font-mono { font-family: 'JetBrains Mono', monospace !important; }
.italic { font-style: italic; }

/* Custom Details Tab list styling */
#details-nav-tabs .nav-link {
  color: #94a3b8;
  background: transparent;
  border-radius: 8px;
  padding: 10px;
  font-weight: 500;
  transition: var(--trans-transition);
}

#details-nav-tabs .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.02);
}

#details-nav-tabs .nav-link.active {
  color: var(--trans-accent);
  background: rgba(255, 215, 0, 0.07);
}

/* Chat board styling */
.chat-feed-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Audit checklist layout */
.audit-checklist-item {
  border-left: 3px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  background: rgba(255,255,255,0.01);
  border-radius: 6px;
}

.audit-checklist-item.pass { border-left-color: var(--trans-success); }
.audit-checklist-item.fail { border-left-color: var(--trans-danger); }

/* Responsive & Mobile Drawer Architecture */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.sidebar-backdrop.active {
  display: block;
}

.transparency-mobile-toggle {
  display: none;
  background: var(--trans-surface);
  border: 1px solid var(--trans-border);
  color: var(--trans-accent);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
}

.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--trans-border);
}

@media (max-width: 991px) {
  .transparency-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .sidebar-wrapper {
    width: 260px;
    position: fixed;
    top: 0;
    left: -280px;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
  }

  .sidebar-wrapper.mobile-active {
    left: 0;
  }

  .sidebar-wrapper .sidebar-brand span, 
  .sidebar-wrapper .sidebar-profile, 
  .sidebar-wrapper .sidebar-link span,
  .sidebar-wrapper .sidebar-footer span {
    display: inline-block !important;
  }

  .workspace-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .workspace-content {
    padding: 15px !important;
  }

  .stat-grid-4col {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .stat-grid-4col {
    grid-template-columns: 1fr !important;
  }

  .auth-card-wrapper {
    padding: 24px 16px !important;
  }
}

/* Micro Button Styles */
.btn-xxs {
  padding: 2px 6px !important;
  font-size: 9px !important;
  border-radius: 4px !important;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  line-height: 1.2;
}

.btn-xs {
  padding: 4px 8px !important;
  font-size: 10px !important;
  border-radius: 6px !important;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

