﻿/**
 * Phase 2 Modern Enhancements CSS
 * Version 4.0 - GitHub 2026 Patterns
 * - Swiper carousel styling
 * - Modern button animations
 * - Reviews cards
 * - Cross-sell & recently viewed sections
 * - Scroll animations
 */

/* ============================================
   GLOBAL ANIMATION UTILITIES
   ============================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   MODERN BUTTON ANIMATIONS (2026 GitHub)
   ============================================ */
.btn, .tab-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.btn:hover, .tab-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active, .tab-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Ripple Effect for buttons */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.ripple-effect:active::before {
    width: 300px;
    height: 300px;
}

/* Button Group Animations */
.btn-group-animated .btn {
    animation: fadeInUp 0.5s ease-out backwards;
}

.btn-group-animated .btn:nth-child(1) {
    animation-delay: 0.1s;
}

.btn-group-animated .btn:nth-child(2) {
    animation-delay: 0.2s;
}

.btn-group-animated .btn:nth-child(3) {
    animation-delay: 0.3s;
}

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

/* Gradient Hover Effect */
.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: #fff;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    color: #fff;
}

.btn-accent:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #007bff;
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================
   STATS SECTION WITH COUNTERS
   ============================================ */
.stats-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    padding: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: #212529;
    margin: 10px 0;
}

.stat-label {
    font-size: 1rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   REVIEWS CAROUSEL
   ============================================ */
.reviews-section {
    padding: 80px 0;
    background: #fff;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

.section-header h2 i {
    color: #007bff;
    margin-right: 15px;
}

.review-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    border: 1px solid #e9ecef;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.review-avatar {
    font-size: 3rem;
    color: #007bff;
    flex-shrink: 0;
}

.review-author {
    flex-grow: 1;
}

.review-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 5px;
}

.review-company {
    font-size: 0.9rem;
    color: #6c757d;
}

.review-rating {
    color: #ffc107;
    font-size: 1.2rem;
}

.review-rating i {
    margin: 0 2px;
}

.review-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #495057;
}

/* ============================================
   CROSS-SELL & RECENTLY VIEWED
   ============================================ */
.cross-sell-section,
.recently-viewed-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.recently-viewed-section {
    background: #fff;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

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

.product-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 3rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px;
    color: #212529;
    flex-grow: 1;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #007bff;
    padding: 0 15px 15px;
}

.product-card .btn-sm {
    margin: 0 15px 15px;
    text-align: center;
}

/* ============================================
   SWIPER CUSTOMIZATION
   ============================================ */
.swiper {
    padding: 20px 50px;
    margin: 0 -50px;
}

.swiper-button-prev,
.swiper-button-next {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #007bff;
    transform: scale(1.1);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 20px;
    color: #007bff;
    font-weight: 900;
}

.swiper-button-prev:hover::after,
.swiper-button-next:hover::after {
    color: #fff;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #dee2e6;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #007bff;
    width: 30px;
    border-radius: 6px;
}

/* ============================================
   APPLICATIONS SECTION
   ============================================ */
.applications-section {
    padding: 80px 0;
    background: #fff;
}

.applications-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: #212529;
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.application-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.application-card:hover {
    background: #fff;
    border-color: #007bff;
    transform: translateY(-10px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.application-icon {
    font-size: 3.5rem;
    color: #007bff;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.application-card:hover .application-icon {
    transform: scale(1.15) rotate(5deg);
}

.application-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #212529;
}

.application-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.95;
}

.cta-content .btn-primary {
    background: #fff;
    color: #007bff;
    font-size: 1.2rem;
    padding: 15px 40px;
}

.cta-content .btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .review-card {
        padding: 20px;
    }
    
    .swiper {
        padding: 15px 40px;
        margin: 0 -40px;
    }
    
    .applications-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .application-card {
        padding: 30px 20px;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-group-animated {
        flex-direction: column;
    }
    
    .btn-group-animated .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ============================================
   LOADING STATES & MICRO-INTERACTIONS
   ============================================ */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.btn:focus,
.tab-button:focus,
a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: #007bff;
    color: #fff;
}
/* Оптимизированные стили карточек и кнопок (2026) */

/* Карточки товаров - компактные */
.product-card {
    max-width: 280px;
    margin: 8px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Кнопки - адаптивные размеры */
.btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #0073e6;
    color: white;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .product-card {
        max-width: 100%;
        margin: 4px;
        padding: 8px;
    }
}

/* Десктоп - более компактные кнопки */
@media (min-width: 1024px) {
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Улучшение для Swiper слайдеров */
.swiper-slide .product-card {
    max-width: 240px;
}
