/* Bootstrap 5 Custom Dark Theme for Pension Lawyer Website */

/* ==================== CSS Variables Override ==================== */
:root {
  /* Bootstrap color overrides */
  --bs-primary: #ffb703;
  --bs-primary-rgb: 255, 183, 3;
  --bs-secondary: #7b2cff;
  --bs-secondary-rgb: 123, 44, 255;
  --bs-success: #2dd4bf;
  --bs-success-rgb: 45, 212, 191;
  --bs-danger: #ff4d6d;
  --bs-danger-rgb: 255, 77, 109;
  --bs-info: #00c2a8;
  --bs-info-rgb: 0, 194, 168;
  --bs-warning: #ffb703;
  --bs-warning-rgb: 255, 183, 3;
  --bs-dark: #0f0b1e;
  --bs-dark-rgb: 15, 11, 30;

  /* Body colors */
  --bs-body-bg: #0f0b1e;
  --bs-body-color: #f5f7ff;
  --bs-border-color: #2a2354;

  /* Border radius */
  --bs-border-radius: 14px;
  --bs-border-radius-sm: 10px;
  --bs-border-radius-lg: 16px;

  /* Custom theme variables */
  --bg-soft: #17132b;
  --glass: #1b1535cc;
  --muted: #c9cbe3;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --accent-2: #7b2cff;
}

/* ==================== Global Styles ==================== */
body {
  background: radial-gradient(1200px 800px at 10% 10%, #1e1740 0%, #0f0b1e 50%), #0f0b1e;
  background-attachment: fixed;
  color: var(--bs-body-color);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  padding-top: 70px; /* Offset for fixed navbar */
}

html {
  scroll-behavior: smooth;
}

/* ==================== Links ==================== */
a {
  color: var(--bs-info);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover, a:focus {
  color: var(--bs-primary);
}

/* ==================== Navbar Dark Theme ==================== */
.navbar {
  backdrop-filter: blur(10px);
  background: linear-gradient(90deg, rgba(27, 21, 53, 0.67), rgba(22, 18, 43, 0.6)) !important;
  border-bottom: 1px solid var(--bs-border-color);
}

.navbar-brand img {
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--bs-info);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--bs-body-color) !important;
}

.navbar-nav .nav-link {
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  color: var(--bs-body-color) !important;
  background: transparent;
  transition: all 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  background: linear-gradient(145deg, #251d49, #181333);
  color: var(--bs-primary) !important;
}

/* ==================== Cards with Glass Morphism ==================== */
.card {
  background: linear-gradient(180deg, rgba(27, 21, 53, 0.73), #15112d);
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border-radius: var(--bs-border-radius);
}

.card-img-top {
  border-bottom: 1px solid var(--bs-border-color);
  height: 260px;
  object-fit: cover;
}

.card-body {
  padding: 1.1rem;
}

/* ==================== Buttons with Gradient ==================== */
.btn-primary {
  background: linear-gradient(145deg, #ffb703 0%, #ff8f3d 100%);
  border: none;
  color: #160f02;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.2s, background 0.2s;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  transform: translateY(-1px);
  background: linear-gradient(145deg, #ff8f3d 0%, #ffb703 100%);
  color: #160f02 !important;
  border: none;
}

.btn-outline-primary {
  background: transparent;
  color: var(--bs-info);
  border: 1px solid var(--bs-border-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background: linear-gradient(145deg, #251d49, #181333);
  color: var(--bs-info) !important;
  border-color: var(--bs-border-color);
}

.btn-success {
  background: linear-gradient(145deg, #2dd4bf, #00c2a8);
  color: #061b18;
  border: none;
  font-weight: 600;
}

.btn-outline-danger {
  background: transparent;
  color: #ff7a90;
  border: 1px solid #3b2740;
}

.btn-outline-warning {
  background: transparent;
  color: var(--bs-primary);
  border: 1px solid #614215;
}

/* ==================== Forms Dark Theme ==================== */
.form-control,
.form-select {
  background: #161235;
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  border-radius: 12px;
  padding: 0.8rem;
}

.form-control:focus,
.form-select:focus {
  background: #1a1640;
  border-color: var(--bs-primary);
  color: var(--bs-body-color);
  box-shadow: 0 0 0 0.25rem rgba(255, 183, 3, 0.25);
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.form-label {
  color: var(--bs-body-color);
  margin-bottom: 0.5rem;
}

textarea.form-control {
  min-height: 160px;
  resize: vertical;
}

/* Form checkboxes */
.form-check-input {
  background-color: #161235;
  border: 1px solid var(--bs-border-color);
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(255, 183, 3, 0.25);
}

.form-check-label {
  color: var(--bs-body-color);
}

/* ==================== Badges and Pills ==================== */
.badge {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--bs-border-color);
  background: #19143a;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.badge:hover {
  color: var(--bs-primary);
  background: #1f1a44;
}

.badge.bg-dark {
  background: linear-gradient(90deg, #231a46, #1a1534) !important;
  border: 1px solid var(--bs-border-color);
  color: var(--muted);
}

/* ==================== Modals Dark Theme ==================== */
.modal-content {
  background: #130f29;
  border: 1px solid var(--bs-border-color);
  box-shadow: var(--shadow);
  border-radius: 16px;
}

.modal-header,
.modal-footer {
  border-color: var(--bs-border-color);
}

.modal-title {
  color: var(--bs-body-color);
  font-weight: 700;
}

.modal-body {
  color: var(--bs-body-color);
}

.btn-close {
  filter: invert(1);
  opacity: 0.7;
}

.btn-close:hover {
  opacity: 1;
}

/* ==================== Footer ==================== */
.footer {
  margin-top: 2rem;
  background: linear-gradient(180deg, #14102a, #0f0b1e);
  border-top: 1px solid var(--bs-border-color);
  padding: 1.5rem 0;
}

.footer a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--bs-primary);
}

.footer h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* ==================== Custom Components ==================== */

/* KPI Cards */
.kpi-card {
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(15, 138, 122, 0.2), rgba(123, 44, 255, 0.13));
  border: 1px solid #265a55;
}

.kpi-card strong {
  font-size: 1.3rem;
  display: block;
}

/* Notice Box */
.notice {
  padding: 0.8rem;
  border: 1px dashed #3a2f6b;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(23, 19, 56, 0.3);
}

/* Testimonial Cards */
.testimonial {
  padding: 1rem;
  background: linear-gradient(160deg, #1d1740, #15122f);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
}

.testimonial small {
  color: var(--muted);
}

/* Blog Post Cards */
.post {
  background: linear-gradient(160deg, #1b1535, #15112d);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  overflow: hidden;
}

.post-cover {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-bottom: 1px solid var(--bs-border-color);
}

.post-meta {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Sidebar Links */
.sidebar a {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #171338;
  border: 1px solid var(--bs-border-color);
  color: var(--muted);
  transition: background 0.2s;
}

.sidebar a:hover {
  background: #1f1a44;
  color: var(--bs-primary);
}

/* Cookie Bar (Fixed Position) */
.cookie-bar {
  backdrop-filter: blur(8px);
  background: rgba(14, 11, 32, 0.94) !important;
  border-top: 1px solid var(--bs-border-color);
}

/* Team Images */
.team-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

/* Icon Styling (if using inline SVG) */
.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

/* ==================== Utility Overrides ==================== */

/* Text colors */
.text-muted {
  color: var(--muted) !important;
}

/* Background colors */
.bg-dark {
  background-color: var(--bs-dark) !important;
}

/* Border utilities */
.border {
  border-color: var(--bs-border-color) !important;
}

.border-top {
  border-top-color: var(--bs-border-color) !important;
}

.border-bottom {
  border-bottom-color: var(--bs-border-color) !important;
}

.border-secondary {
  border-color: var(--bs-border-color) !important;
}

.border-info {
  border-color: var(--bs-info) !important;
}

/* ==================== Responsive Adjustments ==================== */

@media (max-width: 991px) {
  .navbar-collapse {
    background: #110d28;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1rem;
    margin-top: 0.5rem;
    border-radius: 10px;
  }

  .navbar-nav {
    gap: 0.5rem !important;
  }
}

@media (max-width: 576px) {
  body {
    padding-top: 65px;
  }

  .hero h1 {
    font-size: clamp(28px, 3.3vw, 44px);
  }
}

/* ==================== ENHANCED TYPOGRAPHY ==================== */
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.011em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.display-1, .display-2, .display-3 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
}

.lead {
  font-size: 1.2rem;
  line-height: 1.75;
  font-weight: 400;
  color: var(--muted);
}

p {
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

/* Better readability for long text */
article p, .content p {
  max-width: 72ch;
  line-height: 1.85;
}

/* ==================== ANIMATIONS & TRANSITIONS ==================== */

/* Smooth transitions for all interactive elements */
* {
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Pulse animation for call-to-action */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 183, 3, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 183, 3, 0.6);
  }
}

/* Apply animations to elements */
.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Stagger animations for lists */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* ==================== HOVER EFFECTS ==================== */

/* Card hover effects */
.card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 183, 3, 0.1), transparent);
  transition: left 0.6s ease;
  z-index: 1;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(123, 44, 255, 0.3), 0 10px 20px rgba(0, 0, 0, 0.5);
  border-color: var(--bs-primary);
}

/* Card image zoom effect */
.card-img-top {
  transition: transform 0.6s ease;
}

.card:hover .card-img-top {
  transform: scale(1.1);
}

/* Button hover effects */
.btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: -1;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 183, 3, 0.5);
}

.btn-primary:active {
  transform: translateY(-1px);
}

/* Link hover effects */
a {
  position: relative;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--bs-primary);
  transition: width 0.3s ease, left 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
  width: 80%;
  left: 10%;
}

/* Badge hover effect */
.badge {
  transition: all 0.3s ease;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 183, 3, 0.3);
  background: linear-gradient(145deg, #251d49, #1f1a44) !important;
  border-color: var(--bs-primary) !important;
}

/* Icon hover effects */
.bi, .icon {
  transition: transform 0.3s ease, color 0.3s ease;
}

a:hover .bi, a:hover .icon {
  transform: scale(1.2) rotate(5deg);
  color: var(--bs-primary);
}

/* ==================== ICON ENHANCEMENTS ==================== */

/* Icon wrapper with gradient background */
.icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.2), rgba(123, 44, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bs-border-color);
  transition: all 0.3s ease;
}

.icon-wrapper:hover {
  transform: rotate(5deg) scale(1.1);
  box-shadow: 0 10px 30px rgba(255, 183, 3, 0.4);
}

/* Animated icons */
.bi-star-fill {
  animation: pulse 2s infinite;
}

/* Social media icons */
.footer .bi {
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.footer a:hover .bi {
  transform: scale(1.3) translateY(-3px);
  color: var(--bs-primary);
}

/* ==================== DECORATIVE ELEMENTS ==================== */

/* Gradient overlays */
.section-hero {
  position: relative;
  overflow: hidden;
}

.section-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(123, 44, 255, 0.15), transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: pulse 8s infinite;
}

.section-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 183, 3, 0.1), transparent);
  border-radius: 50%;
  pointer-events: none;
}

/* Quote blocks */
.quote-block {
  border-left: 4px solid var(--bs-primary);
  padding: 1.5rem;
  background: linear-gradient(90deg, rgba(255, 183, 3, 0.1), transparent);
  border-radius: 0 14px 14px 0;
  margin: 2rem 0;
  font-style: italic;
}

/* Highlight boxes */
.highlight-box {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(123, 44, 255, 0.15), rgba(45, 212, 191, 0.15));
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.highlight-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--bs-primary), var(--bs-secondary));
}

/* ==================== MOBILE OPTIMIZATION ==================== */

/* Touch-friendly elements */
@media (max-width: 768px) {
  /* Larger touch targets */
  .btn {
    min-height: 48px;
    padding: 0.9rem 1.3rem;
    font-size: 1rem;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Better spacing */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  /* Mobile-friendly cards */
  .card {
    margin-bottom: 1.5rem;
  }

  .card-img-top {
    height: 220px;
  }

  /* Stack footer columns */
  .footer .row > div {
    margin-bottom: 2rem;
  }

  /* Mobile navbar */
  .navbar-collapse {
    background: linear-gradient(180deg, #110d28, #0d0a1f);
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .navbar-nav {
    gap: 0.5rem !important;
  }

  .navbar-nav .nav-link {
    padding: 1rem !important;
    background: rgba(27, 21, 53, 0.5);
    border-radius: 10px;
  }

  /* Cookie bar mobile */
  .cookie-bar {
    padding: 1rem;
  }

  .cookie-bar .container {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .cookie-btn {
    width: 100%;
  }

  /* Form improvements */
  .form-control,
  .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Better image handling */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 991px) {
  .card-img-top {
    height: 240px;
  }

  .container {
    max-width: 720px;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  h1 {
    font-size: 3.5rem;
  }
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

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

/* ==================== ACCESSIBILITY ==================== */

/* Focus styles */
*:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bs-border-color: #ffffff;
  }

  .card {
    border: 2px solid var(--bs-border-color);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
