/* Custom styles for the Excel analysis application */

:root {
  /* Primary Colors - Financial Prestige */
  --primary-navy: #0A2647;
  --primary-gold: #D4AF37;

  /* Secondary Colors - Subtle Variations */
  --deep-navy: #072041;
  --light-navy: #2C5282;
  --muted-gold: #C4A03A;
  --light-gold: #F4E4C1;

  /* Neutral Grays - Professional Base */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;

  /* Accent Colors - Reserved for CTAs and Alerts ONLY */
  --accent-success: #059669;
  --accent-warning: #D97706;
  --accent-danger: #DC2626;

  /* Legacy Support (mapped to new palette) */
  --primary-color: var(--primary-navy);
  --secondary-color: var(--primary-gold);
  --danger-color: var(--accent-danger);
  --warning-color: var(--accent-warning);
  --info-color: var(--light-navy);
  --dark-color: var(--gray-800);
  --light-color: var(--gray-50);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button animations */
button {
  transition: all 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

/* Data table enhancements */
.data-table-container {
  max-height: 600px;
  overflow-y: auto;
  position: relative;
}

.data-table thead th {
  background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Highlight row on hover */
.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
  background-color: #f0f9ff !important;
}

/* Alternating row colors */
.data-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

/* Pulse animation for loading */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Grid card layout */
.grid-card {
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.grid-card:hover {
  border-color: var(--primary-color);
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-primary {
  background-color: #E8EDF5;
  color: var(--primary-navy);
}

.badge-success {
  background-color: #D1FAE5;
  color: var(--accent-success);
}

.badge-warning {
  background-color: #FEF3C7;
  color: var(--accent-warning);
}

.badge-danger {
  background-color: #FEE2E2;
  color: var(--accent-danger);
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.875rem;
  white-space: nowrap;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .data-table {
    font-size: 0.75rem;
  }

  .data-table td,
  .data-table th {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }
}

/* Print styles */
@media print {

  header,
  footer,
  #upload-section,
  #breadcrumb,
  button {
    display: none !important;
  }

  .data-table {
    page-break-inside: avoid;
  }
}

/* Body and Base Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* RTL specific adjustments */
.rtl-flip {
  transform: scaleX(-1);
}

/* Chart Containers */
.chart-container {
  position: relative;
  height: 300px;
}

/* Hamburger Menu & Sidebar */
.hamburger-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--deep-navy) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(10, 38, 71, 0.4);
  transition: all 0.3s ease;
}

.hamburger-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(10, 38, 71, 0.6);
}

.hamburger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  opacity: 1;
  right: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2) {
  top: 7px;
}

.hamburger-icon span:nth-child(3) {
  top: 14px;
}

.hamburger-btn.open .hamburger-icon span:nth-child(1) {
  top: 7px;
  transform: rotate(135deg);
}

.hamburger-btn.open .hamburger-icon span:nth-child(2) {
  opacity: 0;
  right: -60px;
}

.hamburger-btn.open .hamburger-icon span:nth-child(3) {
  top: 7px;
  transform: rotate(-135deg);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.sidebar.open {
  right: 0;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.sidebar-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: #6b7280;
}

.sidebar-tab:hover {
  background: #f3f4f6;
}

.sidebar-tab.active {
  background: white;
  color: var(--primary-navy);
  border-bottom-color: var(--primary-gold);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Companies Table */
.companies-table {
  width: 100%;
  font-size: 0.875rem;
}

.companies-table th,
.companies-table td {
  padding: 8px;
  border: 1px solid #e5e7eb;
  text-align: right;
}

.companies-table th {
  background: #f9fafb;
  font-weight: 600;
}

.companies-table input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
}

.companies-table button {
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.btn-edit {
  background: var(--light-navy);
  color: white;
}

.btn-edit:hover {
  background: var(--primary-navy);
}

.btn-delete {
  background: var(--accent-danger);
  color: white;
}

.btn-delete:hover {
  background: #B91C1C;
}

.btn-save {
  background: var(--primary-gold);
  color: var(--primary-navy);
  font-weight: 600;
}

.btn-save:hover {
  background: var(--muted-gold);
}

.btn-cancel {
  background: var(--gray-500);
  color: white;
}

.btn-cancel:hover {
  background: var(--gray-600);
}

/* Hierarchy Cubes */
.hierarchy-cube {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  position: relative;
  overflow: hidden;
}

.hierarchy-cube:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.hierarchy-cube::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-navy) 0%, var(--primary-gold) 100%);
}

.cube-icon {
  font-size: 3rem;
  color: var(--primary-navy);
  margin-bottom: 16px;
  text-align: center;
}

.cube-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0A2647;
  margin-bottom: 8px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 12px;
}

.cube-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.cube-stats .stat-item {
  text-align: center;
}

.cube-stats .stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.cube-stats .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.cube-tag {
  display: inline-block;
  background: #E8EDF5;
  color: var(--primary-navy);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 4px;
}

.cube-tag-sm {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  margin: 2px;
}

.favorite-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--primary-gold) 0%, var(--light-gold) 100%);
  color: var(--primary-navy);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
}

.corporation-cube {
  border-left: 4px solid var(--primary-navy);
}

.company-cube {
  border-left: 4px solid var(--light-navy);
}

.fundtype-cube {
  border-left: 4px solid var(--primary-gold);
}

.track-cube {
  border-left: 4px solid var(--muted-gold);
}