/* ===================================
   Template Carousel Styles - Transparent Overlay
   =================================== */

.template-carousel-container {
    padding: 3rem 0;
    margin: 2rem 0;
    position: relative;
}

.template-carousel-container h3 {
    font-weight: 600;
    color: #333;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.template-carousel-container h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Carousel Wrapper */
.carousel-wrapper {
    position: relative;
    padding: 0 50px;
}

.carousel-inner-wrapper {
    position: relative;
}

/* Bootstrap Carousel Overrides */
#templateCarousel {
    position: relative;
}

#templateCarousel .carousel-inner {
    padding: 20px 0;
}

#templateCarousel .carousel-item {
    transition: transform 0.8s ease-in-out;
}

/* Carousel Cards with Transparent Overlay */
.carousel-card {
    position: relative;
    height: 350px;
    margin: 0 10px;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.carousel-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-card-front {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: hidden;
}

/* Carousel Image */
.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.carousel-card:hover .carousel-image {
    transform: scale(1.05);
}

/* Template Number Badge */
.template-number {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.carousel-card:hover .template-number {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

/* Transparent Overlay that appears on hover */
.carousel-overlay-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.85) 0%, 
        rgba(118, 75, 162, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.carousel-card:hover .carousel-overlay-info {
    opacity: 1;
}

.info-content {
    text-align: center;
    color: white;
    padding: 20px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.1s;
}

.carousel-card:hover .info-content {
    transform: translateY(0);
    opacity: 1;
}

.info-content h5 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.info-content p {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.info-content .btn {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: 2px solid transparent;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.info-content .btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: white;
}

/* Carousel Controls Styling */
.carousel-control-prev,
.carousel-control-next {
    width: 45px;
    height: 45px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev {
    left: 0;
}

.carousel-control-next {
    right: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* Carousel Indicators */
.carousel-indicators {
    bottom: -40px;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    border: none;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 30px;
    border-radius: 6px;
}

/* Animation Classes */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carousel-item.active .col-md-4:nth-child(1) .carousel-card {
    animation: slideInFromLeft 0.6s ease-out;
}

.carousel-item.active .col-md-4:nth-child(2) .carousel-card {
    animation: fadeInScale 0.6s ease-out 0.1s both;
}

.carousel-item.active .col-md-4:nth-child(3) .carousel-card {
    animation: slideInFromRight 0.6s ease-out 0.2s both;
}

/* Hover Effects */
.carousel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Glow Effect on Hover */
.carousel-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    border-radius: 15px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.carousel-card:hover::before {
    opacity: 0.5;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .carousel-wrapper {
        padding: 0 20px;
    }
    
    .carousel-card {
        height: 280px;
        margin: 0 5px;
    }
    
    .info-content h5 {
        font-size: 1.2rem;
    }
    
    .info-content p {
        font-size: 0.85rem;
    }
    
    #templateCarousel .row {
        margin: 0 -5px;
    }
    
    #templateCarousel .col-md-4 {
        padding: 0 5px;
        margin-bottom: 20px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 576px) {
    .template-carousel-container {
        padding: 2rem 0;
    }
    
    .carousel-card {
        height: 250px;
    }
    
    /* Show only 1 card on mobile */
    #templateCarousel .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    #templateCarousel .col-md-4:not(:first-child) {
        display: none;
    }
    
    .carousel-control-prev {
        left: 10px;
    }
    
    .carousel-control-next {
        right: 10px;
    }
    
    .info-content h5 {
        font-size: 1.1rem;
    }
    
    .info-content p {
        font-size: 0.8rem;
    }
    
    .info-content .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

/* Loading State */
.carousel-card.loading .carousel-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .carousel-card-inner,
    .carousel-card,
    .carousel-image,
    .carousel-overlay-info,
    .info-content {
        transition: none !important;
        animation: none !important;
    }
    
    .carousel-item {
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .carousel-card {
        border: 2px solid currentColor;
    }
    
    .template-number {
        background: white;
        color: black;
        border: 2px solid black;
    }
    
    .carousel-overlay-info {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .info-content .btn {
        background: white;
        color: black;
        border: 2px solid white;
    }
}

/* Print Styles */
@media print {
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators {
        display: none;
    }
    
    .carousel-card {
        page-break-inside: avoid;
    }
}
