/* ===================================================
   TEMPLATES SECTION - MODERN DESIGN
   =================================================== */

/* CSS Variables for Templates */
:root {
    --template-primary: #4361ee;
    --template-secondary: #7209b7;
    --template-accent: #f72585;
    --template-gradient: linear-gradient(135deg, var(--template-primary) 0%, var(--template-secondary) 50%, var(--template-accent) 100%);
    --template-gradient-hover: linear-gradient(135deg, var(--template-accent) 0%, var(--template-primary) 50%, var(--template-secondary) 100%);
    --template-shadow: 0 10px 30px rgba(67, 97, 238, 0.15);
    --template-shadow-hover: 0 20px 60px rgba(67, 97, 238, 0.25);
    --template-border-radius: 20px;
    --template-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --template-scale-hover: 1.05;
    --template-rotate-hover: 2deg;
}

/* Templates Section Container */
#templates {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
}

#templates::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.05) 0%, transparent 70%);
    animation: templateFloating 20s ease-in-out infinite;
    z-index: 1;
}

#templates .container {
    position: relative;
    z-index: 2;
}

/* Section Header */
#templates .section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

#templates .section-title {
    font-size: 3rem;
    font-weight: 800;
    background: var(--template-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

#templates .section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--template-gradient);
    border-radius: 2px;
    animation: templatePulse 2s ease-in-out infinite;
}

#templates .section-subtitle {
    font-size: 1.2rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Templates Slider Container */
.templates-grid-v2 {
    position: relative;
    margin-top: 60px;
    padding: 20px;
    overflow: hidden;
}

/* Templates Slider Wrapper */
.templates-slider-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

/* Templates Slider Track */
.templates-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 30px;
    padding: 10px;
}

/* Templates Grid Layout */
.templates-slider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    min-width: 100%;
    flex-shrink: 0;
}

/* Template Card */
.template-card-v2 {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--template-border-radius);
    overflow: hidden;
    box-shadow: var(--template-shadow);
    transition: var(--template-transition);
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
    width: 100%;
    min-height: 420px;
}

/* Slider Navigation */
.templates-slider-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.slider-btn {
    background: var(--template-gradient);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: var(--template-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.slider-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.slider-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Slider Dots */
.slider-dots {
    display: flex;
    gap: 10px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(67, 97, 238, 0.3);
    border: none;
    cursor: pointer;
    transition: var(--template-transition);
}

.slider-dot.active {
    background: var(--template-primary);
    transform: scale(1.2);
}

.slider-dot:hover {
    background: var(--template-primary);
    transform: scale(1.1);
}

/* Auto-play Indicator */
.auto-play-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.auto-play-indicator.paused {
    background: rgba(255, 107, 107, 0.8);
}

.template-card-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--template-gradient);
    opacity: 0;
    transition: var(--template-transition);
    z-index: 1;
    border-radius: var(--template-border-radius);
}

.template-card-v2:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg) scale(var(--template-scale-hover));
    box-shadow: var(--template-shadow-hover);
}

.template-card-v2:hover::before {
    opacity: 0.1;
}

/* Template Image Wrapper */
.template-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 280px;
    background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
    z-index: 2;
}

.template-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

.template-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--template-transition);
    filter: brightness(1.1) contrast(1.05);
}

.template-card-v2:hover .template-image-wrapper img {
    transform: scale(1.15) rotate(2deg);
    filter: brightness(1.2) contrast(1.1) saturate(1.2);
}

/* Template Info */
.template-info {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    position: relative;
    z-index: 2;
}

.template-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    transition: var(--template-transition);
    position: relative;
}

.template-card-v2:hover .template-name {
    background: var(--template-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(5px);
}

/* Template Button */
.template-button {
    background: var(--template-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--template-transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.template-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--template-transition);
}

.template-button:hover {
    background: var(--template-gradient-hover);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.template-button:hover::before {
    left: 100%;
}

.template-button i {
    transition: var(--template-transition);
}

.template-button:hover i {
    transform: translateX(-3px);
}

/* Badge Styles */
.badge-v2 {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 3;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: templateBadgePulse 2s ease-in-out infinite;
}

.badge-v2.coming-soon {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Animations */
@keyframes templateFloating {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes templatePulse {
    0%, 100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scaleX(1.2);
        opacity: 0.8;
    }
}

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

/* Loading Animation */
.template-card-v2.loading {
    opacity: 0;
    transform: translateY(50px);
    animation: templateSlideIn 0.8s ease-out forwards;
}

@keyframes templateSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #templates {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .template-card-v2 {
        background: rgba(45, 55, 72, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .template-info {
        background: rgba(45, 55, 72, 0.98);
    }
    
    .template-name {
        color: #f7fafc;
    }
    
    #templates .section-subtitle {
        color: #a0aec0;
    }
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 1200px) {
    .templates-slider-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    #templates {
        padding: 60px 0;
    }
    
    #templates .section-title {
        font-size: 2.2rem;
    }
    
    .templates-slider-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .templates-grid-v2 {
        padding: 10px;
    }
    
    .template-info {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
        text-align: center;
    }
    
    .template-button {
        justify-content: center;
    }
    
    .template-card-v2:hover {
        transform: translateY(-10px) scale(1.02);
    }
    
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .auto-play-indicator {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #templates .section-title {
        font-size: 1.8rem;
    }
    
    .template-image-wrapper {
        height: 220px;
    }
    
    .template-info {
        padding: 20px;
    }
    
    .template-name {
        font-size: 1.2rem;
    }
}

/* Print Styles */
@media print {
    #templates {
        background: white;
        padding: 40px 0;
    }
    
    .template-card-v2 {
        background: white;
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .template-button {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .template-card-v2,
    .template-image-wrapper img,
    .template-button,
    .template-name {
        transition: none;
        animation: none;
    }
    
    .template-card-v2:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .template-card-v2 {
        border: 2px solid #000;
    }
    
    .template-button {
        background: #000;
        color: #fff;
    }
    
    .template-name {
        color: #000;
    }
}