/* ===== CHEAT SHEETS LAYOUT ===== */
.cheat-sheets-section {
  position: relative;
  overflow: hidden;
  padding-top: 4rem;
}

.cheat-sheets-header {
  text-align: center;
  margin-bottom: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-actions {
  margin-top: 1.5rem;
}

.cheat-sheets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .cheat-sheets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== CARD DESIGN ===== */
.cheat-sheet-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.3s ease;
}

.cheat-sheet-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.15);
}

.cheat-sheet-card .card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.cheat-sheet-card .card-icon {
  font-size: 2.5rem;
}

.cheat-sheet-card h2 {
  font-family: Orbitron, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cheat-sheet-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex-grow: 1;
}

/* ===== COMPLEXITY TABLES ===== */
.complexity-section {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 1.2rem;
  border: 1px solid var(--glass-border);
}

.complexity-section h3 {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 0.8rem;
}

.complexity-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.complexity-table th, 
.complexity-table td {
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.complexity-table th {
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid var(--glass-border);
}

.complexity-table td {
  font-family: "Fira Code", monospace;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Time Complexity Colors */
.time-o1 {
  color: #22c55e; /* Green */
}

.time-ologn {
  color: #3b82f6; /* Blue */
}

.time-on {
  color: #fbbf24; /* Orange */
}

.space-on {
  color: #fbbf24;
}

.space-complexity {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ===== DETAILS SECTION ===== */
.details-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-block h4 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.detail-block h4 i {
  font-size: 0.95rem;
}

.detail-block ul {
  list-style: none;
  padding-left: 0;
}

.detail-block ul li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-block ul li::before {
  content: "•";
  position: absolute;
  left: 0.3rem;
  color: var(--primary-light);
  font-weight: bold;
}

.detail-block code {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: "Fira Code", monospace;
  font-size: 0.85rem;
}

/* ===== PRINT STYLES ===== */
@media print {
  body {
    background: #ffffff !important;
    color: #1a202c !important;
    font-family: Poppins, sans-serif;
  }

  body.light-mode, body {
    --text-primary: #1a202c !important;
    --text-secondary: #4a5568 !important;
  }

  .navbar, 
  .footer, 
  .scroll-top-btn, 
  .header-actions,
  #loading-screen,
  .hero-background {
    display: none !important;
  }

  .spacer {
    height: 0 !important;
  }

  .section {
    padding: 0 !important;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .cheat-sheets-header h1 {
    font-size: 2.2rem !important;
    color: #1a202c !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    margin-bottom: 0.5rem !important;
  }

  .cheat-sheets-header p {
    color: #4a5568 !important;
    margin-bottom: 2rem !important;
  }

  .cheat-sheets-grid {
    display: block !important;
  }

  .cheat-sheet-card {
   break-inside: avoid !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    margin-bottom: 2.5rem !important;
    padding: 1.5rem !important;
    color: #1a202c !important;
  }

  .cheat-sheet-card h2 {
    color: #1a202c !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
  }

  .complexity-section {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  .complexity-table th {
    color: #4a5568 !important;
    border-bottom: 2px solid #cbd5e1 !important;
  }

  .complexity-table td {
    color: #1a202c !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .detail-block h4 {
    color: #7c3aed !important;
  }

  .detail-block ul li {
    color: #4a5568 !important;
  }

  .detail-block ul li::before {
    color: #7c3aed !important;
  }

  .detail-block code {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
  }
}
