
:root {
  --primary-theme-color: #d32f2f;
  --secondary-theme-color: #c2185b;
  --text-dark: #2d3748;
  --text-light: #718096;
  --page-bg: #f4f7f6;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #16a34a;
  --warning-color: #f59e0b;
  --primary-action-color: #0d6efd;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1rem;
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.12);
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--page-bg);
  color: var(--text-dark);
}

/* --- Awesome Navbar --- */
.user-navbar {
  background-color: var(--card-bg);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07);
  padding: 0.75rem 0;
}
.user-navbar .navbar-brand {
  font-weight: 700;
  color: var(--text-dark);
}
.user-navbar .navbar-toggler {
  border: none;
  box-shadow: none !important;
}
.user-navbar .dropdown-toggle::after {
  display: none;
}
.user-navbar .profile-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-color);
}
.user-navbar #nav-profile-icon .bi-person-circle {
  font-size: 40px;
  color: #cbd5e0;
}
.user-navbar .dropdown-menu {
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  min-width: 11rem;
  padding: 0.5rem 0;
}
.user-navbar .dropdown-item {
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}
.user-navbar .dropdown-item i {
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-light);
}
.user-navbar .dropdown-item:hover {
  background-color: #f7fafc;
}

/* --- Main Content Area --- */
main.container {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

/* --- Dashboard Page (index.php) Specific Styles --- */
.dashboard-action-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  height: 100%;
}
.dashboard-action-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

/* 
================================================
|       *** NEW LOYALTY CARD STYLES ***       |
================================================
*/

/* --- New Top Info Card --- */
.user-info-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}
.user-info-card .user-details {
  font-weight: 500;
}
.user-info-card .user-details strong {
  font-weight: 600;
  color: var(--text-dark);
}
.user-info-card .user-details .mobile-no {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* --- Action Buttons inside the card --- */
.action-buttons {
  display: flex;
  gap: 0.75rem; /* 12px */
}
.action-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* 8px */
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  border: none;
  transition: all 0.2s ease-in-out;
}
.action-buttons .btn-add-purchase {
  background-color: var(--success-color);
  color: #fff;
  flex-grow: 1; /* Takes up available space */
}
.action-buttons .btn-add-purchase:hover {
  background-color: #148a3d;
}
.action-buttons .btn-refresh {
  background-color: var(--primary-action-color);
  color: #fff;
  flex-shrink: 0; /* Prevents button from shrinking */
}
.action-buttons .btn-refresh:hover {
  background-color: #0b5ed7;
}

/* --- Stats Bar inside the card --- */
.stats-bar {
  background-color: #f8f9fa;
  border-radius: var(--border-radius-md);
  padding: 1rem;
  margin-top: 1rem;
}
.stats-bar .stat-value {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-dark);
}
.stats-bar .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* --- General Loyalty Card Wrapper for stamps --- */
.loyalty-card-wrapper {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.loyalty-card-stamps {
  padding: 1.5rem;
}
@media (min-width: 768px) {
  .loyalty-card-stamps {
    padding: 2.5rem;
  }
}

.card-header-title { 
  color: var(--primary-theme-color);
}

/* --- Redesigned Stamp Grid & Boxes --- */
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);  
  gap: 1rem;
}
@media (min-width: 576px) {
  .stamp-grid {
    grid-template-columns: repeat(5, 1fr);  
  }
}

.stamp-box {
  background-color: #f8f9fa;
  border: 2px dashed var(--border-color);
  color: #adb5bd;
  font-weight: 300;
  font-size: 0.9rem;
  aspect-ratio: 1.7 / 1;
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.stamp-box.filled {
  background: var(--success-color);
  border: 2px solid var(--success-color);
  color: #fff;
  /* flex-direction: column;   */
  gap: 0.25rem;
}

.stamp-box.filled .icon-wrapper {
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stamp-box.filled .bi-check-lg {
  font-size: 1.2rem;
  font-weight: bold;
}

.stamp-box.filled .stamp-text {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stamp-box.pending {
  border-style: solid;
  border-color: var(--warning-color);
  background-color: #fff3cd;
  color: #664d03;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-direction: column;
  gap: 0.5rem;
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

.stamp-box.pending {
  animation: pulse-warning 2s infinite;
}

/* --- History Card for Tables --- */
.history-card {
  background: transparent;
  box-shadow: none;
  border: none;
}
.history-card .table {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.history-card .table thead {
  background-color: #f3f4f6;
}

/* --- For spinning refresh icon --- */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.fa-spin {
  animation: spin 1s linear infinite;
}

/* --- Gift Gallery Styles --- */
.gift-card {
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gift-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg) !important;
}
.gift-card .card-img-top {
  height: 200px;
  object-fit: cover;
}

/* --- General Mobile Responsiveness --- */
@media (max-width: 767px) {
  main.container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .dashboard-action-btn {
    padding: 1rem 0.5rem;
    font-size: 0.8rem;
    text-align: center;
  }
  .dashboard-action-btn .bi {
    font-size: 1.75rem;
    margin-bottom: 0.25rem !important;
  }
  .gift-gallery-wrapper .row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0 1.5rem 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .gift-gallery-wrapper .row::-webkit-scrollbar {
    display: none;
  }
  .gift-gallery-wrapper .row > [class*="col-"] {
    flex: 0 0 65%;
    max-width: 250px;
    scroll-snap-align: start;
  }
}

/* --- WhatsApp Button Styles --- */
.whatsapp-fab {
  position: fixed;
  width: 55px;
  height: 55px;
  top: 80%;
  left: 0;
  transform: translateY(-50%);
  background-color: #25d366;
  color: #fff;
  border-radius: 0 30px 30px 0;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
}
.whatsapp-fab:hover {
  color: #fff;
  width: 60px;
}


/* winner  */
.welcome-header {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-bottom: 5px;
    }

    .welcome-header .profile-pic {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border: 2px solid #dee2e6;
    }

    .welcome-header .profile-icon {
        font-size: 60px;
        color: #ced4da;
    }

    .welcome-header .user-info h1 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .winner-announcement-card {
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .winner-announcement-card.standard {
        background-color: #e0f7fa;
        border: 1px solid #b2ebf2;
    }

    .winner-announcement-card .profile-pic {
        width: 60px;
        height: 60px;
        object-fit: cover;
    }

    .winner-announcement-card .profile-icon {
        font-size: 60px;
        color: #80deea;
    }

    .winner-announcement-card .winner-info h5 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
        font-weight: 700;
    }

    .winner-announcement-card .winner-info p {
        margin-bottom: 0;
        color: #00796b;
        font-weight: 500;
    }

    .winner-announcement-card.personal-win {
        background-color: #fff9c4;
        border: 1px solid #fff176;
    }

    .winner-announcement-card.personal-win .winner-info h5 {
        color: #f57f17;
    }

    .winner-announcement-card.personal-win .winner-name {
        display: inline-block;
        /* FIX: Animation now runs only once */
        animation: tada 1.5s ease 1;
    }

    @keyframes tada {
        from {
            transform: scale3d(1, 1, 1);
        }

        10%,
        20% {
            transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
        }

        30%,
        50%,
        70%,
        90% {
            transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
        }

        40%,
        60%,
        80% {
            transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
        }

        to {
            transform: scale3d(1, 1, 1);
        }
    }

    #slider-container {
        position: relative;
    }

    #gift-slider-viewport {
        overflow: hidden;
        width: 100%;
    }

    #gift-slider-track {
        display: flex;
    }

    .gift-slide {
        flex: 0 0 80%;
        max-width: 80%;
        box-sizing: border-box;
        padding: 0 0.5rem;
    }

    @media (min-width: 768px) {
        .gift-slide {
            flex: 0 0 33.333%;
            max-width: 33.333%;
        }
    }

    @media (min-width: 992px) {
        .gift-slide {
            flex: 0 0 25%;
            max-width: 25%;
        }
    }

    .slider-control {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(255, 255, 255, 0.85);
        border: 1px solid #dee2e6;
        border-radius: 50%;
        width: 38px;
        height: 38px;
        cursor: pointer;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
        transition: background-color 0.2s;
    }

    .slider-control:hover {
        background-color: #ffffff;
    }

    #slider-prev-btn {
        left: 0.5rem;
    }

    #slider-next-btn {
        right: 0.5rem;
    }

    .winner-marquee-viewport {
        overflow: hidden;
        width: 100%;  
    }

    .winner-marquee-track {
        display: flex;
        width: max-content;
        /* Important for the marquee effect */
    }

    .winner-marquee-track.is-scrolling {
        animation: marquee-scroll linear infinite;
    }

    .winner-marquee-item {
        flex-shrink: 0;
        width: 150px;
        margin-right: 1rem;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease;
    }

    .winner-marquee-item:hover {
        transform: scale(1.05);
    }

    .winner-marquee-item img {
        width: 100%;
        height: 150px;
        object-fit: cover;
    }

    .winner-marquee-item .caption {
        background: #fff;
        padding: 0.5rem;
        text-align: center;
        font-size: 0.8rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    @keyframes marquee-scroll {
        0% {
            transform: translateX(0%);
        }

        100% {
            transform: translateX(-50%);
        }

        /* Scroll exactly half the width */
    }

    .winner-marquee-viewport:hover .winner-marquee-track {
        animation-play-state: paused;
    }

    /* Other styles... */
    .welcome-header h1 {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .profile-pic {
        width: 50px;
        height: 50px;
    }

    .profile-icon {
        font-size: 50px;
    }

    .category-card {
        border: 1px solid #e9ecef;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        border-radius: 15px;
        background-color: #fff;
    }

     

    .category-card .icon-circle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
    }

    .bg-success-soft {
        background-color: rgba(40, 167, 69, 0.1);
    }

    .bg-primary-soft {
        background-color: rgba(13, 110, 253, 0.1);
    }

    .bg-warning-soft {
        background-color: rgba(255, 193, 7, 0.1);
    }

    .bg-danger-soft {
        background-color: rgba(220, 53, 69, 0.1);
    }

    .value-prop-item {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
    }

    .value-prop-icon {
        flex-shrink: 0;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(13, 110, 253, 0.1);
        color: #0d6efd;
    }

    @media (max-width: 576px) {
        .welcome-header h1 {
            font-size: 1.25rem;
        }

        .profile-pic {
            width: 45px;
            height: 45px;
        }

        .profile-icon {
            font-size: 45px;
        }

        .card-body.p-5 {
            padding: 1.5rem !important;
        }

        .category-card .card-text {
            font-size: 0.75rem;
        }

        .why-us-section .display-6 {
            font-size: 1.75rem;
        }
    }
     .winner-card {
        border-radius: 1rem;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border: 1px solid #e9ecef;
    }

    .winner-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }

    .winner-card img {
        width: 100%; 
        height:150px;
        object-fit: cover;
    }

    .winner-card .card-body {
        background: #fff;
    }

    .pagination .page-link {
        color: #c2185b;
    }

    .pagination .page-item.active .page-link {
        background-color: #c2185b;
        border-color: #c2185b;
        color: #fff;
    }
    .lead{
        font-size:16px;
    }

      /* Custom styles for larger navigation buttons */
    .custom-swiper-button {
        width: 40px !important;
        /* Larger width */
        height: 40px !important;
        /* Larger height */
        background-color: rgba(0, 0, 0, 0.5);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        /* Ensure it's above other elements */
    }

    .custom-swiper-button::after {
        font-size: 20px !important;
        /* Larger icon */
    }

    /* Positioning for larger buttons */
    .custom-swiper-button.swiper-button-prev {
        left: 10px !important;
        /* Adjust position as needed */
    }

    .custom-swiper-button.swiper-button-next {
        right: 10px !important;
        /* Adjust position as needed */
    }

    /* Responsive adjustments for navigation buttons */
    @media (max-width: 768px) {
        .custom-swiper-button {
            width: 30px !important;
            height: 30px !important;
        }

        .custom-swiper-button::after {
            font-size: 16px !important;
        }

        .custom-swiper-button.swiper-button-prev {
            left: 5px !important;
        }

        .custom-swiper-button.swiper-button-next {
            right: 5px !important;
        }
    }

    /* Styles for the winner images to ensure they are clickable and visible */
    .winner-marquee-item a {
        display: block;
        position: relative;
        overflow: hidden;
        /* To keep the caption within bounds */
        border-radius: 10px;
        /* Match the card style */
        text-decoration: none;
        /* Remove underline */
    }

    .winner-marquee-item img {
        width: 100%;
        height: 150px;
        /* Fixed height for consistent display */
        object-fit: cover;
        /* Crop images to fit */
        display: block;
        /* Remove bottom space */
    }

    .winner-marquee-item .caption {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 8px;
        font-size: 14px;
        text-align: center;
        /* Center the name */
        opacity: 1;
        /* Ensure it's visible */
        transition: opacity 0.3s ease-in-out;
    }

    /* Style for the Swiper container to ensure navigation buttons are visible */
    .swiper-container {
        overflow: hidden;
        /* Allow navigation buttons to be visible */
        position: relative;
        /* Needed for absolute positioning of buttons */
    }

    /* Ensure swiper-slide content is styled as before */
    .swiper-slide>div {
        background: #ffffff;
        border-radius: 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        text-align: center;
        overflow: hidden;
    }

    .swiper-slide img {
        width: 100%;
        height: 140px;
        object-fit: cover;
    }

    .swiper-slide h5 {
        font-size: 0.9rem;
        font-weight: bold;
        margin: 0;
        padding: 12px;
        /* Padding for the text */
    }