/* main.css - Updated featured sections with proper responsive fixes */
@import './static.css';

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 {
  font-size: 1.75rem;
  color: var(--secondary-text-color) !important; 
}

p {
  margin-bottom: 1rem;
  color: var(--secondary-text-color);
}

a {
  color: var(--accent-color);
  text-decoration: none !important;
  transition: color 0.3s;
}

a:hover {
  color: var(--navbar-icon-color);
  text-decoration: underline;
}

/* Loader styles */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;  
  z-index: 9997;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  opacity: 1;
  transition: opacity 0.3s ease;
}
 
.loader-icon,
.loader-spinner {
  border-radius: 50%;
  border-style: solid;
  /* faint track + bright leading edge + gap (transparent side) */
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--electric-lime);
  border-right-color: transparent;
  animation: loader-spin 0.9s linear 0.2s infinite;
  will-change: transform;
  box-sizing: border-box;
}

[data-theme="dark"] .loader-icon,
[data-theme="dark"] .loader-spinner {
  border-color: rgba(255, 255, 255, 0.14);
  border-top-color: var(--electric-lime);
  border-right-color: transparent;
}

.loader-icon {
  width: 50px;
  height: 50px;
  border-width: 5px;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
  flex-shrink: 0;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-icon,
  .loader-spinner {
    animation: none;
  }
}

.main-container {
  transition: visibility 0.1s ease;
}

.main-container.visible {
  visibility: visible !important;
}
/* Card styles */
.card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Button styles */
.btn-primary {
  background-color: var(--sapphire-blue);
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-primary:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-primary {
  background-color: var(--electric-lime);
  color: var(--dark-background);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: #05b305;
}

/* Tooltip styles */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 1000;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem !important;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--primary-text);
  background: var(--warm-white);
  border-radius: 0.375rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.2s ease;
}

[data-theme="dark"] [data-tooltip]::after {
  background: var(--dark-background);
  color: var(--primary-text-dark);
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  z-index: 1001;
  width: 0;
  height: 0;
  border-style: solid;
  border-color: transparent;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
}

[data-tooltip][data-placement="top"]::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
}

[data-tooltip][data-placement="top"]::before {
  bottom: calc(100% - 5px);
  left: 50%;
  margin-left: -5px;
  border-width: 5px 5px 0;
  border-top-color: var(--warm-white);
}

[data-theme="dark"] [data-tooltip][data-placement="top"]::before {
  border-top-color: var(--warm-white);
}

[data-tooltip][data-placement="bottom"]::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
}

[data-tooltip][data-placement="bottom"]::before {
  top: calc(100% - 5px);
  left: 50%;
  margin-left: -5px;
  border-width: 0 5px 5px;
  border-bottom-color: var(--warm-white);
}

[data-theme="dark"] [data-tooltip][data-placement="bottom"]::before {
  border-bottom-color: var(--warm-white);
}

[data-tooltip][data-placement="left"]::after {
  right: 100%;
  top: 50%;
  transform: translateX(5px) translateY(-50%);
  left: auto;
}

[data-tooltip][data-placement="left"]::before {
  right: -5px;
  top: 50%;
  margin-top: -5px;
  border-width: 5px 0 5px 5px;
  border-left-color: var(--warm-white);
  left: auto;
}

[data-theme="dark"] [data-tooltip][data-placement="left"]::before {
  border-left-color: var(--dark-background);
}

[data-tooltip][data-placement="right"]::after {
  left: 100%;
  top: 50%;
  right: auto;
  transform: translateX(-5px) translateY(-50%);
}

[data-tooltip][data-placement="right"]::before {
  left: calc(100% - 5px);
  top: 50%;
  margin-top: -5px;
  border-width: 5px 5px 5px 0;
  border-right-color: var(--warm-white);
  right: auto;
}

[data-theme="dark"] [data-tooltip][data-placement="right"]::before {
  border-right-color: var(--dark-background);
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
}

[data-tooltip][data-placement="top"]:hover::after,
[data-tooltip][data-placement="top"]:hover::before {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip][data-placement="bottom"]:hover::after,
[data-tooltip][data-placement="bottom"]:hover::before {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip][data-placement="left"]:hover::after,
[data-tooltip][data-placement="left"]:hover::before {
  transform: translateX(0) translateY(-50%);
}

[data-tooltip][data-placement="right"]:hover::after,
[data-tooltip][data-placement="right"]:hover::before {
  transform: translateX(0) translateY(-50%);
}

.tooltip, .tooltip-arrow, .tooltip-inner, .bs-tooltip-top, 
.bs-tooltip-bottom, .bs-tooltip-left, .bs-tooltip-right {
  display: none !important;
}

/* ===== FEATURED SECTIONS - COMPLETELY REWRITTEN ===== */
/* ===== FEATURED SECTIONS - OPTIMIZED ===== */
.featured-section {
  padding: 40px 20px;
  background-color: var(--surface-color);
  margin: 10px 0;
  width: 100%;
  overflow: hidden;
}

.section-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-color);
  font-size: 1.8rem;
}

.carousel-wrapper {
  position: relative;
}

.carousel-container {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-item {
  flex: 0 0 300px;
  margin-right: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  min-height: 280px;
}

.carousel-item:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.item-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
    /* Ensure alt text doesn't show on image failure */
    color: transparent;
    font-size: 0;
}

.item-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.item-name {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color) !important;
  font-size: 1rem;
}

.item-detail {
  font-size: 0.85rem;
  color: var(--text-color) !important;
  margin-bottom: 5px;
}

.favorite-btn {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--small-bg-color);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  z-index: 3;
}

.favorite-btn:hover {
  color: var(--selected-bg-color);
  transform: scale(1.2);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card-bg);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.carousel-arrow:hover {
  opacity: 1;
  background: var(--accent-color);
  color: white;
}


.carousel-arrow.left {
  left: 10px !important; 
}

.carousel-arrow.right {
  right: 10px !important;
}


/* Onboarding Section Styles */
.onboarding-section {
  padding: 40px 20px;
  text-align: center;
  background-color: var(--surface-color);
  transition: all 0.3s ease;
}

.onboarding-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

.onboarding-heading {
  font-size: 2rem;
  margin-bottom: auto !important;
  color: var(--text-color);
  animation: fadeInUp 0.6s ease both;
}

.onboarding-subheading {
  font-size: 1.25rem;
  color: var(--tertiary-text-color);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.onboarding-btn {
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--sapphire-blue), var(--electric-lime));
  transition: all 0.4s ease;
  animation: fadeInUp 0.6s ease 0.4s both;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  display: inline-block;
}

.onboarding-btn:hover {
  background: linear-gradient(135deg, #005bb8, #05b305);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.animate-pop {
  opacity: 0;
  transform: scale(0.8) translateY(40px);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-pop.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.onboarding-heading.animate-pop {
  transition-delay: 0.1s;
}

.onboarding-subheading.animate-pop {
  transition-delay: 0.3s;
}

.onboarding-btn.animate-pop {
  transition-delay: 0.5s;
}

/* Footer styles */
.main-footer {
  background-color: var(--surface-color);
  color: var(--text-color);
  padding: 40px 0 20px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-bottom: 20px;
}

.footer-section {
  width: 100%;
  max-width: 800px;
  text-align: center;
}

.footer-section h3 {
  color: var(--text-color);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.quick-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  padding: 0;
}

.quick-links li {
  margin: 0;
}

.footer-section a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #aaa;
}

.copyright {
  text-align: center;
  padding-top: 20px; 
  font-size: 0.9rem;
  color: var(--text-color);
}

.copyright p {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
  margin-bottom: 5px;
  font-size: 1rem;
}

.copyright a {
  color: var(--text-color); 
  text-decoration: none;
  transition: color 0.3s;
}

/* Home page css styles */
.pill-card {
  border-radius: 50px;
  padding: 35px 40px;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sapphire-blue), var(--electric-lime));
  transition: all 0.5s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pill-card:hover,
.pill-card:focus {
  background: var(--toggle-gradient-bg);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.pill-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.pill-content i {
  font-size: 1.5rem;
}

.pill-content h3 {
  margin-bottom: 5px;
  font-weight: 600;
}

.pill-content p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.search-pill input {
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  width: 100%;
  padding: 5px 10px;
  outline: none;
}

.search-pill input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.quick-action-card {
  background-color: var(--surface-color);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.quick-action-card:hover {
  transform: translateY(-5px);
}

.action-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: white;
}

.quick-action-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--navbar-icon-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}



/* ===== RESPONSIVE DESIGN - COMPLETELY REWRITTEN ===== */

/* Large desktops */
@media (min-width: 1440px) {
  .carousel-item {
    width: calc(25% - 11.25px); /* 4 items per row */
    flex: 0 0 calc(25% - 11.25px);
  }
}

/* Standard desktops */
@media (min-width: 1200px) and (max-width: 1439px) {
  .carousel-item {
    width: calc(33.333% - 10px); /* 3 items per row */
    flex: 0 0 calc(33.333% - 10px);
  }
}

/* Medium desktops and laptops */
@media (min-width: 992px) and (max-width: 1199px) {
  .carousel-item {
    width: calc(33.333% - 10px); /* 3 items per row */
    flex: 0 0 calc(33.333% - 10px);
  }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
  .main-container {
    padding: 30px 30px !important;
  }
  
   .featured-section {
    padding: 30px 15px;
  }
  
  .carousel-item {
    flex: 0 0 calc(50% - 7.5px);
  }
  
  .item-image {
    height: 160px;
  }
  
  .carousel-arrow {
    width: 35px;
    height: 35px;
  }
  
  .carousel-arrow.left {
    left: 15px;
  }
  
  .carousel-arrow.right {
    right: 15px;
  }
}

/* Small tablets and large phones */
@media (min-width: 597px) and (max-width: 767px) {
  .main-container {
    padding: 25px 20px !important;
  }
  
 .featured-section {
    padding: 25px 10px;
  }
  
  .carousel-item {
    flex: 0 0 calc(50% - 7.5px);
  }
  
  .item-image {
    height: 150px;
  }
  
  .carousel-arrow {
    width: 32px;
    height: 32px;
  }
}

/* ===== CRITICAL FIXES FOR SCREENS BELOW 596px ===== */

/* Medium phones */
@media (max-width: 596px) {
  .main-container {
    padding: 20px 15px !important;
  }
  
.featured-section {
    padding: 20px 10px;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .carousel-item {
    flex: 0 0 calc(50% - 5px);
    min-height: 260px;
  }
  
  .item-image {
    height: 140px;
  }
  
  .carousel-arrow {
    width: 30px;
    height: 30px;
  }
  
  .carousel-arrow.left {
    left: 10px;
  }
  
  .carousel-arrow.right {
    right: 10px;
  }
  
  /* Home page adjustments */
  .pill-card {
    padding: 25px 30px;
    margin: 0 5px 15px 5px;
  }
  
  .pill-content i {
    font-size: 1.2rem;
  }
  
  .quick-actions-section .col-md-3 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 15px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .main-container {
    padding: 15px 10px !important;
  }
  
 .featured-section {
    padding: 15px 8px;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
  
  .carousel-item {
    flex: 0 0 calc(50% - 4px);
    min-height: 240px;
  }
  
  .item-image {
    height: 120px;
  }
  
  .carousel-arrow {
    width: 28px;
    height: 28px;
  }
}

/* Very small phones */
@media (max-width: 375px) {
  .main-container {
    padding: 12px 8px !important;
  }
  
  .featured-section {
    padding: 12px 5px;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
  
  .carousel-item {
    flex: 0 0 calc(50% - 3px);
    min-height: 220px;
  }
  
  .item-image {
    height: 110px;
  }
  
  .carousel-arrow {
    width: 25px;
    height: 25px;
  }
  
  .pill-card {
    padding: 20px 25px;
  }
}

/* Extra small phones */
@media (max-width: 320px) {
  .main-container {
    padding: 10px 5px !important;
  }
  
  .featured-section {
    padding: 10px 3px;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
  
  .carousel-item {
    flex: 0 0 100%;
    min-height: 200px;
  }
  
  .item-image {
    height: 100px;
  }
  
  .pill-card {
    padding: 18px 20px;
  }
  
  .pill-content i {
    font-size: 1rem;
  }
  
  .pill-content h3 {
    font-size: 0.9rem;
  }
  
  .pill-content p {
    font-size: 0.75rem;
  }
}