/* Product Cards Styles */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Prompt', sans-serif;
}

/* Tailwind utilities override for proper image sizing */
.h-64 {
    height: 16rem !important; /* 256px */
}

.h-80 {
    height: 20rem !important; /* 320px */
}

.relative {
    position: relative !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.w-full {
    width: 100% !important;
}

.h-full {
    height: 100% !important;
}

.object-cover {
    object-fit: cover !important;
}

/* Ensure image containers have proper sizing */
.product-card .relative {
    height: 0;
    padding-bottom: 100%; /* Maintain 1:1 aspect ratio */
    position: relative;
    background: #f8fafc;
    border-radius: 1rem 1rem 0 0;
    overflow: hidden;
}

.product-card .relative > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Image gallery styling to match detail page */
.product-card .carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1rem 1rem 0 0;
}

.product-card .carousel-slide {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.product-card .carousel-slide.active {
    display: flex;
}

.product-card .carousel-slide img {
    width: 95%;
    height: 95%;
    object-fit: contain;
    border-radius: 0.25rem;
}

/* Detail tabs styling */
.detail-tab-btn {
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
}

/* Points badge styling */
.points-badge {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border: 2px solid #ffdf00;
    color: #8b4513;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
    animation: gentle-glow 2s ease-in-out infinite alternate;
}

.points-badge .fa-star {
    color: #ff6b35;
    animation: star-twinkle 1.5s ease-in-out infinite;
}

@keyframes gentle-glow {
    0% { box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 4px 8px rgba(255, 215, 0, 0.5); }
}

@keyframes star-twinkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.detail-tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}

.detail-tab-btn.active {
    background-color: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    color: #8b5cf6 !important;
    z-index: 1;
}

.detail-tab-btn.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 1px;
}

.tab-content {
    transition: all 0.3s ease;
    background-color: white;
    border: 1px solid #f3f4f6;
    border-radius: 0.5rem;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.tab-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.tab-pane {
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane.hidden {
    display: none;
}

/* Tab container styling */
.detail-tab-btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.detail-tab-btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Expandable text styling */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.expand-btn {
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
}

.expand-btn:hover {
    transform: translateY(-1px);
    color: #7c3aed;
}

.expand-btn:active {
    transform: translateY(0);
}

.text-content {
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Product Card Styles */
.product-card {
    position: relative;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f8fafc;
    border-radius: 0.5rem 0.5rem 0 0;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    border-radius: 0;
}

.product-card:hover .carousel-slide img {
    transform: scale(1.05);
}

/* Default image styling */
.product-card .bg-gradient-to-br {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    border-radius: 1rem 1rem 0 0;
}

.product-card .bg-gradient-to-br i {
    font-size: 4rem;
    opacity: 0.6;
    color: white;
}

/* Carousel Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 15;
    opacity: 1;
    visibility: visible;
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.indicator {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    max-width: 6px !important;
    max-height: 6px !important;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.indicator.active {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

/* Badge Styles */
.product-card .absolute {
    position: absolute;
}

/* Best Seller Badge */
.product-card .bg-gradient-to-r.from-orange-400.to-red-500 {
    background: linear-gradient(135deg, #fb923c, #ef4444);
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Nike Logo Style */
.product-card .bg-white.rounded-full {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

/* Discount Badge */
.product-card .bg-red-500 {
    background: #ef4444;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Card Content Styles */
.product-card .p-6 {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Action Buttons Container */
.product-card .space-y-3 {
    margin-top: auto;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Button Styles */
.rent-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    transition: all 0.3s ease;
}

.rent-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
}

.rent-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.rent-btn:hover::before {
    left: 100%;
}

/* View Details Button */
.product-card a.block {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-card a.block:hover {
    border-color: #8b5cf6;
    background: #f3f4f6;
    transform: translateY(-1px);
}

/* Options Preview Styles */
.product-card .space-y-1 > div {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.product-card .space-y-1 > div:last-child {
    border-bottom: none;
}

/* Price Styles */
.product-card .text-2xl {
    background: linear-gradient(135deg, #1f2937, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stock Status */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stock-available {
    background: #dcfce7;
    color: #166534;
}

.stock-low {
    background: #fef3c7;
    color: #92400e;
}

.stock-out {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    /* Adjust image container for mobile */
    .product-card .relative {
        height: 280px;
    }
    
    .product-card .bg-gradient-to-br {
        height: 280px;
    }
    
    .carousel-container {
        height: 280px;
    }
    
    /* Fix image cropping on mobile */
    .carousel-slide img {
        object-fit: contain !important;
        background: #f8fafc;
    }
    
    .carousel-indicators {
        bottom: 8px;
        gap: 3px;
    }
    
    .indicator {
        width: 5px !important;
        height: 5px !important;
        min-width: 5px !important;
        min-height: 5px !important;
        max-width: 5px !important;
        max-height: 5px !important;
    }
    
    .indicator.active {
        transform: scale(1.2);
    }
    
    .product-card .p-6 {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .product-card:hover {
        transform: translateY(-4px);
    }
    
    .rent-btn:hover {
        transform: scale(1.01);
    }
    
    /* Smaller image container for small screens */
    .carousel-container {
        min-height: 200px;
    }
}

/* Loading Animation */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-state i {
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* Notification Styles Integration */
.notifications-container {
    margin-bottom: 2rem;
}

.notification-alert {
    border-radius: 0.75rem;
    border: none;
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

.priority-urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border-left: 4px solid #ef4444;
}

.priority-high {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border-left: 4px solid #f59e0b;
}

.priority-medium {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border-left: 4px solid #3b82f6;
}

.priority-low {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(75, 85, 99, 0.1));
    border-left: 4px solid #6b7280;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
}

/* Focus States for Accessibility */
.rent-btn:focus,
.product-card a:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.indicator:focus {
    outline: 1px solid white;
    outline-offset: 1px;
}

/* Override any conflicting styles for indicators */
.carousel-indicators .indicator,
.product-card .carousel-indicators .indicator {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    max-width: 6px !important;
    max-height: 6px !important;
    font-size: 0 !important;
    line-height: 0 !important;
    display: block !important;
    overflow: hidden;
    box-sizing: border-box !important;
}

/* Additional specificity for Bootstrap/other frameworks override */
.product-card .carousel-indicators button.indicator,
.carousel-indicators button.indicator,
button.indicator {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    max-width: 6px !important;
    max-height: 6px !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: rgba(255, 255, 255, 0.5) !important;
    border-radius: 50% !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
}

button.indicator.active {
    background-color: white !important;
    transform: scale(1.1) !important;
}

/* For mobile devices */
@media (max-width: 768px) {
    .carousel-indicators .indicator,
    .product-card .carousel-indicators .indicator,
    .product-card .carousel-indicators button.indicator,
    .carousel-indicators button.indicator,
    button.indicator {
        width: 5px !important;
        height: 5px !important;
        min-width: 5px !important;
        min-height: 5px !important;
        max-width: 5px !important;
        max-height: 5px !important;
    }

    /* Reduce product-grid margins on tablet/mobile */
    .product-grid {
        margin-left: -5px !important;
        margin-right: -5px !important;
        padding: 0 !important;
    }

    .product-card {
        margin-left: 5px !important;
        margin-right: 5px !important;
    }
}

/* Print Styles */
@media print {
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .rent-btn,
    .carousel-indicators {
        display: none;
    }
}

/* Force override for Bootstrap carousel indicators if present */
.carousel-indicators [data-bs-target] {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    max-width: 6px !important;
    max-height: 6px !important;
    border-radius: 50% !important;
    margin-left: 2px !important;
    margin-right: 2px !important;
    text-indent: -999px !important;
    background-color: rgba(255, 255, 255, 0.5) !important;
    border: none !important;
}

.carousel-indicators [data-bs-target].active {
    background-color: white !important;
}

/* Additional responsive breakpoints for consistent card image sizing */
@media (max-width: 480px) {
    .product-card .relative {
        height: 240px;
    }
    
    .product-card .bg-gradient-to-br {
        height: 240px;
    }
    
    .carousel-container {
        height: 240px;
    }
    
    /* Ensure images fit properly on very small screens */
    .carousel-slide img {
        object-fit: contain !important;
        background: #f8fafc;
        padding: 8px;
    }

    /* Reduce product-grid margins on small phones */
    .product-grid {
        margin-left: -4px !important;
        margin-right: -4px !important;
        padding: 0 !important;
    }

    .product-card {
        margin-left: 4px !important;
        margin-right: 4px !important;
    }
}

/* iPhone SE and similar small screens (375px and below) */
@media (max-width: 375px) {
    .product-card .relative {
        height: 220px;
    }
    
    .product-card .bg-gradient-to-br {
        height: 220px;
    }
    
    .carousel-container {
        height: 220px;
    }
    
    .carousel-slide img {
        object-fit: contain !important;
        background: #f8fafc;
        padding: 12px;
        max-width: 100%;
        max-height: 100%;
    }
}

@media (min-width: 1200px) {
    .product-card .relative {
        height: 450px;
    }
    
    .product-card .bg-gradient-to-br {
        height: 450px;
    }
    
    .carousel-container {
        height: 450px;
    }
    
    /* Use cover on large screens for better visual */
    .carousel-slide img {
        object-fit: cover !important;
        padding: 0;
        background: transparent;
    }
}

/* Reset any inherited styles */
.indicator * {
    display: none !important;
}

.indicator::before,
.indicator::after {
    display: none !important;
}

/* ==============================================
   DARK THEME SUPPORT - Product Cards
   ============================================== */

/* Product Card Tab Content - Dark Theme */
body[data-theme-type="dark"] .tab-pane,
body[data-theme-type="dark"] .tab-content,
body.seasonal-theme-dark .tab-pane,
body.seasonal-theme-dark .tab-content {
    color: var(--theme-text, #B1CEDC) !important;
}

body[data-theme-type="dark"] .tab-pane p,
body[data-theme-type="dark"] .tab-pane li,
body[data-theme-type="dark"] .tab-pane span,
body.seasonal-theme-dark .tab-pane p,
body.seasonal-theme-dark .tab-pane li,
body.seasonal-theme-dark .tab-pane span {
    color: var(--theme-text-muted, #82B0C4) !important;
}

body[data-theme-type="dark"] .tab-pane strong,
body[data-theme-type="dark"] .tab-pane b,
body.seasonal-theme-dark .tab-pane strong,
body.seasonal-theme-dark .tab-pane b {
    color: var(--theme-text, #B1CEDC) !important;
}

/* Product Card Text Content - Dark Theme */
body[data-theme-type="dark"] .text-content,
body[data-theme-type="dark"] .product-description,
body[data-theme-type="dark"] .option-description,
body.seasonal-theme-dark .text-content,
body.seasonal-theme-dark .product-description,
body.seasonal-theme-dark .option-description {
    color: var(--theme-text-muted, #82B0C4) !important;
}

/* Expand button - Dark Theme */
body[data-theme-type="dark"] .expand-btn,
body.seasonal-theme-dark .expand-btn {
    color: var(--theme-primary, #357FA7) !important;
}

body[data-theme-type="dark"] .expand-btn:hover,
body.seasonal-theme-dark .expand-btn:hover {
    color: var(--theme-secondary, #82B0C4) !important;
}

/* Tab container background - Dark Theme */
body[data-theme-type="dark"] .tab-content,
body.seasonal-theme-dark .tab-content {
    background: var(--theme-card-bg, #0C2233) !important;
}

body[data-theme-type="dark"] .tab-content::before,
body.seasonal-theme-dark .tab-content::before {
    background: linear-gradient(90deg, transparent, var(--theme-border-color, rgba(177, 206, 220, 0.15)), transparent) !important;
}
