/* ============================================
   CARD BASE V2 — Katalog template styles
   Modern card with image, overlay, category pill.
   ============================================ */

/* Grid layout for the course list */
.block_katalog-courseslist .courses-list,
.block_katalog-courseslist.coursebox {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* ============================================
   COURSE CARDS
   ============================================ */
.katalog-card-wrapper {
    margin-bottom: 0;
    padding: 0;
}

.katalog-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.katalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

/* Premium Badge */
.katalog-premium-badge {
    position: absolute;
    top: 0;
    right: 12px;
    width: 40px;
    height: 60px;
    background-size: cover;
    background-position: center;
    z-index: 20;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Image Section */
.katalog-card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.katalog-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    opacity: 0.6;
}



/* Overlay on image hover */
.katalog-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    padding: 20px;
}

.katalog-card:hover .katalog-card-overlay {
    opacity: 1;
}

.katalog-card-overlay-content {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    color: #fff;
}

.katalog-card-overlay-content * {
    color: #fff;
}

/* Custom fields dans l'overlay */
.katalog-card-overlay-content > div > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    line-height: 1.4;
}

.katalog-card-overlay-content > div > div:last-child {
    border-bottom: none;
}

/* Description dans l'overlay */
.katalog-card-overlay-content p {
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.9;
    margin: 0 0 8px 0;
}

/* Specs list in overlay */
.katalog-specs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    color: #fff;
    font-size: 0.9rem;
}

.katalog-specs-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.katalog-specs-list li:last-child {
    border-bottom: none;
}

.spec-label {
    opacity: 0.8;
    font-weight: 500;
    flex-shrink: 0;
    max-width: 45%;
    white-space: normal;
    margin-right: 15px;
}

.spec-value {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    flex-grow: 1;
    min-width: 0;
}

/* Body Content */
.katalog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.katalog-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary, #0f6cbf);
    font-weight: 700;
    margin-bottom: 8px;
}

.katalog-card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.katalog-card-spacer {
    flex-grow: 1;
}

/* Progress Bar */
.katalog-card-progress {
    margin-bottom: 15px;
}

.progress-bar-bg {
    height: 6px;
    background: #edf2f7;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #0f6cbf), #4fd1c5);
    border-radius: 3px;
}

.progress-text {
    font-size: 0.75rem;
    color: #718096;
    text-align: right;
}

/* Footer / Actions */
.katalog-card-footer {
    margin-top: 10px;
}

.katalog-btn {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.katalog-btn-primary {
    background-color: transparent;
    color: var(--primary, #0f6cbf);
    border: 2px solid var(--primary, #0f6cbf);
}

.katalog-btn-primary:hover {
    background-color: var(--primary, #0f6cbf);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   SKELETON LOADING ANIMATION
   ============================================ */
@keyframes katalog-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.katalog-skeleton-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    height: 320px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.katalog-skeleton-image {
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: katalog-shimmer 1.5s ease-in-out infinite;
}

.katalog-skeleton-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.katalog-skeleton-title {
    height: 24px;
    width: 80%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: katalog-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.katalog-skeleton-text {
    height: 14px;
    width: 60%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: katalog-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.katalog-skeleton-text.short { width: 40%; }

.katalog-skeleton-button {
    height: 40px;
    width: 100%;
    margin-top: auto;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: katalog-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Fade in animation */
.courses-list .katalog-card {
    animation: katalog-fadeIn 0.6s ease-out;
}

@keyframes katalog-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
