/* ===================================
   Components — Кнопки, Карточки, Формы
   =================================== */

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-slow);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent));
    transition: left var(--transition-slow);
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    box-shadow: 0 20px 50px var(--accent-glow);
    transform: translateY(-3px);
}

.btn-secondary {
    display: inline-block;
    padding: 18px 40px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Responsive Buttons */
@media (max-width: 640px) {
    .btn-primary,
    .btn-secondary {
        padding: 14px 28px;
        font-size: 12px;
        width: 100%;
        text-align: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
    }
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 48px 36px;
    transition: all var(--transition-slow);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 61, 61, 0.4), transparent, rgba(255, 140, 66, 0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(255, 61, 61, 0.15), rgba(255, 140, 66, 0.15));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    font-size: 28px;
    transition: all var(--transition-base);
}

.card:hover .card-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
}

.card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 14px;
}

.card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Services Carousel */
.services-carousel {
    position: relative;
    margin: 0;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
    
.carousel-card {
    flex: 0 0 calc((100% - (24px * 2)) / 3);
    max-width: calc((100% - (24px * 2)) / 3);
    transition: all 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.carousel-card.featured {
    border: 1px solid rgba(255, 61, 61, 0.3);
    box-shadow: 0 0 30px rgba(255, 61, 61, 0.15);
}

.carousel-card .card-icon {
    width: 64px;
    height: 64px;
    font-size: 32px;
    margin-bottom: 24px;
}

.carousel-card .card-icon-image {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-card .card-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 10;
}

.carousel-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-btn svg {
    width: 24px;
    height: 24px;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

/* Carousel Pagination */
.carousel-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.carousel-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-dot:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.carousel-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

/* Responsive Carousel */
@media (max-width: 1024px) {
    .carousel-track {
        gap: 20px;
    }
    
    .carousel-card {
        flex: 0 0 calc((100% - 20px) / 2);
        max-width: calc((100% - 20px) / 2);
    }
}

@media (max-width: 768px) {
    .carousel-track {
        gap: 16px;
    }
    
    .carousel-btn {
        width: 44px;
        height: 44px;
    }
    
    .carousel-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .carousel-dot {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .carousel-pagination {
        margin-top: 30px;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .carousel-track {
        gap: 12px;
    }
    
    .carousel-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .carousel-dot {
        width: 32px;
        height: 32px;
        font-size: 11px;
        padding: 0;
    }
    
    .carousel-pagination {
        margin-top: 24px;
        gap: 6px;
    }
    
    .carousel-card .card-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .carousel-card .card-icon-image {
        width: 56px;
        height: 56px;
        margin-bottom: 20px;
    }
    
    .carousel-card h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .carousel-card p {
        font-size: 13px;
    }
}

/* Technologies Grid - 6 columns on desktop */
.technologies-grid {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1200px) {
    .technologies-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .technologies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
    
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card {
        padding: 32px 24px;
    }
    
    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .card h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .card p {
        font-size: 13px;
    }
}

/* Section Labels */
.section-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    display: block;
}

.section-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 16px;
    color: var(--text-secondary);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 80px;
}

/* Responsive Section Headers */
@media (max-width: 1024px) {
    .section-title {
        font-size: 40px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 32px;
    }
    
    .section-desc {
        font-size: 14px;
    }
    
    .section-header {
        margin: 0 auto 60px;
    }
}

@media (max-width: 640px) {
    .section-title {
        font-size: 26px;
    }
    
    .section-desc {
        font-size: 13px;
    }
    
    .section-header {
        margin: 0 auto 40px;
    }
    
    .section-label {
        font-size: 10px;
        letter-spacing: 1.5px;
    }
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 61, 61, 0.05);
    border: 1px solid rgba(255, 61, 61, 0.2);
    border-radius: 50px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.8s forwards 0.3s;
}

.hero-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

/* Admin Badges */
.badge-success {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    color: #22c55e;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-muted {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(75, 85, 99, 0.1);
    border: 1px solid rgba(75, 85, 99, 0.2);
    border-radius: 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}
