/**
 * @package     AVM Showcase
 * @subpackage  mod_avm_showcase
 *
 * @copyright   Copyright (C) 2026 AVICOM Multimedia. All rights reserved.
 * @license     GNU General Public License version 3 or later
 */

/* ============================================
   BASE & CONTAINER
   ============================================ */
.avm-showcase {
    width: 100%;
    box-sizing: border-box;
    padding: 80px 0;
    background: #f8fafc;
}

.avm-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HEADER
   ============================================ */
.avm-header {
    text-align: center;
    margin-bottom: 56px;
}

.avm-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px 0;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.avm-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    margin: 16px auto 0;
    background: var(--avm-primary, #00B9AD);
    border-radius: 2px;
}

.avm-subtitle {
    font-size: 1.15rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   GRID
   ============================================ */
.avm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ============================================
   CARD
   ============================================ */
.avm-card {
    position: relative;
    height: 340px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--avm-shadow, 0 12px 35px rgba(0, 0, 0, 0.08));
    background: #e2e8f0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    animation: cardEntrance 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.avm-card:hover {
    transform: translateY(-12px) scale(1.01);
    box-shadow: var(--avm-shadow-hover, 0 20px 55px rgba(0, 0, 0, 0.15));
}

.avm-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.avm-card-link:focus-visible {
    outline: 3px solid var(--avm-primary, #00B9AD);
    outline-offset: 4px;
    border-radius: 22px;
}

/* ============================================
   FIGURE & IMAGE
   ============================================ */
.avm-figure {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: inherit;
}

.avm-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background-color: #e2e8f0;
    filter: brightness(0.95);
}

.avm-card:hover .avm-image {
    transform: scale(1.08);
    filter: brightness(0.75);
}

/* ============================================
   FALLBACK
   ============================================ */
.avm-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.avm-fallback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px;
    text-align: center;
}

.avm-fallback-icon {
    width: 80px;
    height: 80px;
    color: #0f172a;
    opacity: 0.3;
}

.avm-fallback-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    opacity: 0.5;
    letter-spacing: 0.02em;
}

/* ============================================
   BADGE
   ============================================ */
.avm-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    display: inline-block;
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--avm-accent, #FF6B35);
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.avm-card:hover .avm-badge {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================
   OVERLAY
   ============================================ */
.avm-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 80%
    );
    opacity: 0;
    transform: translateY(20%);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0;
    box-sizing: border-box;
    pointer-events: none;
}

.avm-card-link .avm-overlay {
    pointer-events: auto;
}

.avm-card:hover .avm-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   CONTENT
   ============================================ */
.avm-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    padding: 36px 30px 32px 30px;
    box-sizing: border-box;
}

.avm-title-card {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.2;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s,
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s;
}

.avm-card:hover .avm-title-card {
    transform: translateY(0);
    opacity: 1;
}

.avm-subtitle-card {
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0 0 4px 0;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s,
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
}

.avm-card:hover .avm-subtitle-card {
    transform: translateY(0);
    opacity: 1;
}

.avm-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 6px 0 0 0;
    color: rgba(255, 255, 255, 0.7);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3em;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s,
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
}

.avm-card:hover .avm-description {
    transform: translateY(0);
    opacity: 1;
}

.avm-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF;
    opacity: 0;
    transform: translateX(-8px);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
                gap 0.3s ease;
    cursor: pointer;
    pointer-events: none;
}

.avm-card-link .avm-arrow {
    pointer-events: auto;
}

.avm-card:hover .avm-arrow {
    transform: translateX(0);
    opacity: 1;
}

.avm-arrow:hover {
    gap: 14px;
}

.avm-arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.avm-arrow:hover .avm-arrow-icon {
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .avm-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }
    .avm-showcase {
        padding: 60px 0;
    }
}

@media (max-width: 768px) {
    .avm-showcase {
        padding: 48px 0;
    }
    .avm-container {
        padding: 0 20px;
    }
    .avm-title {
        font-size: 2.2rem;
    }
    .avm-subtitle {
        font-size: 1rem;
    }
    .avm-header {
        margin-bottom: 40px;
    }
    .avm-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }
    .avm-card {
        height: 300px;
        border-radius: 18px;
    }
    .avm-title-card {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .avm-showcase {
        padding: 36px 0;
    }
    .avm-container {
        padding: 0 16px;
    }
    .avm-title {
        font-size: 1.8rem;
    }
    .avm-title::after {
        width: 40px;
        height: 3px;
        margin-top: 12px;
    }
    .avm-subtitle {
        font-size: 0.9rem;
    }
    .avm-header {
        margin-bottom: 32px;
    }
    .avm-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .avm-card {
        height: 280px;
        border-radius: 16px;
    }
    .avm-content {
        padding: 28px 22px 24px 22px;
    }
    .avm-title-card {
        font-size: 1.2rem;
    }
    .avm-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 1;
        max-height: 1.5em;
    }
    .avm-badge {
        font-size: 0.6rem;
        padding: 4px 14px;
        top: 14px;
        left: 14px;
    }
    .avm-arrow {
        font-size: 0.8rem;
        margin-top: 10px;
    }
    .avm-arrow-icon {
        width: 18px;
        height: 18px;
    }
    .avm-fallback-icon {
        width: 60px;
        height: 60px;
    }
    .avm-fallback-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .avm-card,
    .avm-image,
    .avm-overlay,
    .avm-title-card,
    .avm-subtitle-card,
    .avm-description,
    .avm-arrow,
    .avm-badge {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        transform: none !important;
        opacity: 1 !important;
    }
    .avm-card {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    .avm-card:hover {
        transform: none !important;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08) !important;
    }
    .avm-card:hover .avm-image {
        transform: none !important;
        filter: brightness(0.85) !important;
    }
    .avm-overlay {
        opacity: 1 !important;
        transform: none !important;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0.3) 50%,
            transparent 80%
        ) !important;
    }
    .avm-badge {
        transform: none !important;
        opacity: 1 !important;
    }
    .avm-arrow {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* ============================================
   KEYBOARD NAVIGATION
   ============================================ */
.avm-card:focus-within {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.15);
}
.avm-card:focus-within .avm-image {
    transform: scale(1.05);
    filter: brightness(0.8);
}
.avm-card:focus-within .avm-overlay {
    opacity: 1;
    transform: translateY(0);
}
.avm-card:focus-within .avm-title-card,
.avm-card:focus-within .avm-subtitle-card,
.avm-card:focus-within .avm-description,
.avm-card:focus-within .avm-arrow {
    transform: translateY(0);
    opacity: 1;
}
.avm-card:focus-within .avm-badge {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================
   ALERT
   ============================================ */
.avm-alert {
    padding: 20px 24px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    font-size: 1rem;
    text-align: center;
    border-left: 4px solid var(--avm-primary, #00B9AD);
}
.avm-alert-info {
    background: #f0f9ff;
    border-left-color: #0ea5e9;
    color: #0369a1;
}