/**
 * Etinion Course Category New — eccn-category-new.css
 * Widget: Etinion Course Category New
 * Prefix: eccn-
 *
 * Grid + Horizontal Scroll CSS — EXACT same pattern as ecgn-course-grid-new.css & ettn-testimonial.css
 * Standalone — no shared CSS dependency.
 */

/* ══════════════════════════════════════════════════════
   1. ROOT & LAYOUT
   ══════════════════════════════════════════════════════ */

.eccn-category-new {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* ── Grid Mode (default) ── */
.eccn-grid {
    display: grid;
    grid-template-columns: repeat(var(--eccn-cols-d, 4), 1fr);
    gap: var(--eccn-gap-d, 20px);
    /* Prevent box-shadow clipping on all edges */
    padding: 10px 16px;
    margin: -10px -16px;
}

/* Tablet & mobile grid — fallback if inline <style> isn't present */
@media (max-width: 1024px) {
    .eccn-grid {
        grid-template-columns: repeat(var(--eccn-cols-t, 3), 1fr);
        gap: var(--eccn-gap-t, 16px);
    }
}

@media (max-width: 767px) {
    .eccn-grid {
        grid-template-columns: repeat(var(--eccn-cols-m, 1.5), 1fr);
        gap: var(--eccn-gap-m, 12px);
    }
}

/* ══════════════════════════════════════════════════════
   2. HORIZONTAL SCROLL — EXACT SAME PATTERN AS COURSE GRID NEW
   ══════════════════════════════════════════════════════ */

/* Shared hscroll base: flex row, scroll, vertical-only shadow breathing */
.eccn-hscroll-desktop .eccn-grid,
.eccn-hscroll-mobile .eccn-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Only vertical padding/margin to avoid clipping top/bottom box-shadow.
       NO horizontal padding — keeps card widths exactly matching visible area. */
    padding: 12px 0;
    margin: -12px 0;
}

/* Items inside hscroll must use auto height so align-items:stretch
   can equalise them to the tallest card */
.eccn-hscroll-desktop .eccn-grid > .eccn-item,
.eccn-hscroll-mobile .eccn-grid > .eccn-item {
    height: auto;
    flex-shrink: 0;
}

/* Desktop card sizing — placed OUTSIDE media query so it works
   in Elementor editor iframe (which is narrower than 1025px) */
.eccn-hscroll-desktop .eccn-grid {
    gap: var(--eccn-gap-d, 20px);
}

.eccn-hscroll-desktop .eccn-grid > .eccn-item {
    flex: 0 0 var(--eccn-card-w-d, 24%);
    min-width: var(--eccn-card-w-d, 24%);
    scroll-snap-align: start;
}

/* Desktop horizontal scroll — scrollbar styling only */
@media (min-width: 1025px) {
    .eccn-hscroll-desktop .eccn-grid {
        /* Hide scrollbar by default, show on hover */
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
    }

    .eccn-hscroll-desktop .eccn-grid:hover {
        scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
    }

    .eccn-hscroll-desktop .eccn-grid::-webkit-scrollbar {
        height: 6px;
    }

    .eccn-hscroll-desktop .eccn-grid::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 3px;
    }

    .eccn-hscroll-desktop .eccn-grid::-webkit-scrollbar-thumb {
        background: transparent;
        border-radius: 3px;
        transition: background 0.2s ease;
    }

    .eccn-hscroll-desktop .eccn-grid:hover::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.5);
    }

    .eccn-hscroll-desktop .eccn-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(148, 163, 184, 0.8);
    }
}

/* Tablet horizontal scroll */
@media (min-width: 768px) and (max-width: 1024px) {
    .eccn-hscroll-mobile .eccn-grid {
        gap: var(--eccn-gap-t, 16px);
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
    }

    .eccn-hscroll-mobile .eccn-grid::-webkit-scrollbar {
        height: 4px;
    }

    .eccn-hscroll-mobile .eccn-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .eccn-hscroll-mobile .eccn-grid::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.3);
        border-radius: 2px;
    }

    .eccn-hscroll-mobile .eccn-grid > .eccn-item {
        flex: 0 0 var(--eccn-card-w-t, 32%);
        min-width: var(--eccn-card-w-t, 32%);
        scroll-snap-align: start;
    }
}

/* Mobile horizontal scroll */
@media (max-width: 767px) {
    .eccn-hscroll-mobile .eccn-grid {
        gap: var(--eccn-gap-m, 12px);
        scrollbar-width: none;
    }

    .eccn-hscroll-mobile .eccn-grid::-webkit-scrollbar {
        display: none;
    }

    .eccn-hscroll-mobile .eccn-grid > .eccn-item {
        flex: 0 0 var(--eccn-card-w-m, 100%);
        min-width: var(--eccn-card-w-m, 100%);
        scroll-snap-align: start;
    }
}

/* ══════════════════════════════════════════════════════
   3. CARD BASE
   ══════════════════════════════════════════════════════ */

.eccn-item {
    display: flex;
}

.eccn-item > .eccn-card {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.eccn-card {
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: inherit;
    cursor: default;
}

a.eccn-card {
    cursor: pointer;
}

a.eccn-card:hover {
    text-decoration: none;
    color: inherit;
}

/* ── Card Variants ── */

.eccn-variant-shadow .eccn-card {
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08);
}

.eccn-variant-shadow .eccn-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.eccn-variant-border .eccn-card {
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.eccn-variant-border .eccn-card:hover {
    border-color: #3b5edb;
}

.eccn-variant-flat .eccn-card {
    box-shadow: none;
    border: none;
}

/* ── Hover Transforms ── */

.eccn-hover-lift .eccn-card:hover {
    transform: translateY(-4px);
}

.eccn-hover-lift-more .eccn-card:hover {
    transform: translateY(-8px);
}

.eccn-hover-scale .eccn-card:hover {
    transform: scale(1.03);
}

.eccn-hover-scale-more .eccn-card:hover {
    transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════
   4. ICON WRAPPER
   ══════════════════════════════════════════════════════ */

.eccn-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8ecf8 100%);
    margin-bottom: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.eccn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #3b5edb;
    line-height: 1;
}

.eccn-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.eccn-icon i {
    font-size: inherit;
}

a.eccn-card:hover .eccn-icon-wrap {
    transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════
   5. CONTENT
   ══════════════════════════════════════════════════════ */

.eccn-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.eccn-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px;
    color: #1e293b;
    word-break: break-word;
}

.eccn-subtitle {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #64748b;
    margin: 0 0 8px;
    word-break: break-word;
}

.eccn-count {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #3b5edb;
    background: rgba(59, 94, 219, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: auto;
    align-self: flex-start;
}

/* ── Arrow Indicator ── */

.eccn-arrow-indicator {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.eccn-arrow-indicator svg {
    width: 20px;
    height: 20px;
    stroke: #3b5edb;
}

a.eccn-card:hover .eccn-arrow-indicator {
    opacity: 1;
    right: 12px;
}

/* ══════════════════════════════════════════════════════
   6. STYLE: Icon Box (default)
   ══════════════════════════════════════════════════════ */

.eccn-card-icon-box {
    padding: 24px;
}

/* ══════════════════════════════════════════════════════
   7. STYLE: Overlay Card
   ══════════════════════════════════════════════════════ */

.eccn-card-overlay {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 200px;
    justify-content: flex-end;
    padding: 24px;
    position: relative;
}

.eccn-card-overlay .eccn-card-overlay-bg {
    position: absolute;
    inset: 0;
    background-color: #0f172a;
    opacity: 0.55;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.eccn-card-overlay:hover .eccn-card-overlay-bg {
    opacity: 0.7;
}

.eccn-card-overlay .eccn-content {
    position: relative;
    z-index: 2;
}

.eccn-card-overlay .eccn-icon-wrap {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.15);
}

.eccn-card-overlay .eccn-title {
    color: #ffffff;
}

.eccn-card-overlay .eccn-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.eccn-card-overlay .eccn-count {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.eccn-card-overlay .eccn-icon {
    color: #ffffff;
}

.eccn-card-overlay .eccn-arrow-indicator svg {
    stroke: #ffffff;
}

/* ══════════════════════════════════════════════════════
   8. STYLE: Minimal Clean
   ══════════════════════════════════════════════════════ */

.eccn-card-minimal {
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.eccn-card-minimal .eccn-icon-wrap {
    margin-bottom: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

.eccn-card-minimal .eccn-icon {
    font-size: 22px;
}

.eccn-card-minimal .eccn-icon svg {
    width: 22px;
    height: 22px;
}

.eccn-card-minimal .eccn-content {
    flex: 1 1 auto;
}

.eccn-card-minimal .eccn-title {
    font-size: 15px;
    margin-bottom: 2px;
}

.eccn-card-minimal .eccn-subtitle {
    font-size: 12px;
    margin-bottom: 4px;
}

.eccn-card-minimal .eccn-count {
    padding: 2px 8px;
    font-size: 11px;
}

.eccn-card-minimal:hover {
    border-color: #3b5edb;
    background: rgba(59, 94, 219, 0.03);
}

.eccn-card-minimal .eccn-arrow-indicator {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    opacity: 0.4;
}

a.eccn-card-minimal:hover .eccn-arrow-indicator {
    opacity: 1;
    right: auto;
}

/* ══════════════════════════════════════════════════════
   9. STYLE: Gradient Card
   ══════════════════════════════════════════════════════ */

.eccn-card-gradient {
    padding: 28px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.eccn-card-gradient .eccn-icon-wrap {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.eccn-card-gradient .eccn-icon {
    color: #ffffff;
}

.eccn-card-gradient .eccn-title {
    color: #ffffff;
}

.eccn-card-gradient .eccn-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.eccn-card-gradient .eccn-count {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.eccn-card-gradient .eccn-arrow-indicator svg {
    stroke: #ffffff;
}

/* Gradient variations for different items */
.eccn-item:nth-child(4n+1) .eccn-card-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.eccn-item:nth-child(4n+2) .eccn-card-gradient {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.eccn-item:nth-child(4n+3) .eccn-card-gradient {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.eccn-item:nth-child(4n+4) .eccn-card-gradient {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* ══════════════════════════════════════════════════════
   10. SKELETON SHIMMER
   ══════════════════════════════════════════════════════ */

@keyframes eccn-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.eccn-skeleton {
    display: grid;
    grid-template-columns: repeat(var(--eccn-cols-d, 4), 1fr);
    gap: var(--eccn-gap-d, 20px);
    padding: 10px 16px;
    margin: -10px -16px;
}

.eccn-is-loaded .eccn-skeleton {
    display: none;
}

.eccn-is-loading .eccn-grid {
    display: none;
}

/* ── Base skeleton card ── */

.eccn-skeleton-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eccn-sk-icon,
.eccn-sk-title,
.eccn-sk-subtitle,
.eccn-sk-count {
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200px 100%;
    animation: eccn-shimmer 1.5s ease-in-out infinite;
}

.eccn-sk-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
}

.eccn-sk-title {
    height: 16px;
    width: 70%;
}

.eccn-sk-subtitle {
    height: 12px;
    width: 90%;
}

.eccn-sk-count {
    height: 24px;
    width: 80px;
    border-radius: 20px;
    margin-top: auto;
}

/* ── Skeleton: Overlay style ── */

.eccn-sk-overlay {
    position: relative;
    min-height: 200px;
    background: #1e293b;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.eccn-sk-overlay .eccn-sk-overlay-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(15, 23, 42, 0.7) 100%);
    border-radius: inherit;
}

.eccn-sk-overlay .eccn-sk-overlay-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eccn-sk-overlay .eccn-sk-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200px 100%;
}

.eccn-sk-overlay .eccn-sk-title {
    height: 16px;
    width: 65%;
    background: linear-gradient(90deg, rgba(255,255,255,0.12) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.12) 75%);
    background-size: 200px 100%;
}

.eccn-sk-overlay .eccn-sk-count {
    height: 20px;
    width: 70px;
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.16) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200px 100%;
    margin-top: 4px;
}

/* ── Skeleton: Minimal style ── */

.eccn-sk-minimal {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.eccn-sk-minimal .eccn-sk-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}

.eccn-sk-minimal .eccn-sk-minimal-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eccn-sk-minimal .eccn-sk-title {
    height: 14px;
    width: 60%;
}

.eccn-sk-minimal .eccn-sk-subtitle {
    height: 11px;
    width: 80%;
}

/* ── Skeleton: Gradient style ── */

.eccn-sk-gradient {
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eccn-sk-gradient .eccn-sk-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(255,255,255,0.18) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.18) 75%);
    background-size: 200px 100%;
}

.eccn-sk-gradient .eccn-sk-title {
    height: 16px;
    width: 70%;
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 25%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.15) 75%);
    background-size: 200px 100%;
}

.eccn-sk-gradient .eccn-sk-subtitle {
    height: 12px;
    width: 85%;
    background: linear-gradient(90deg, rgba(255,255,255,0.12) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.12) 75%);
    background-size: 200px 100%;
}

.eccn-sk-gradient .eccn-sk-count {
    height: 24px;
    width: 80px;
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.14) 25%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.14) 75%);
    background-size: 200px 100%;
    margin-top: auto;
}

/* ── Skeleton responsive: overlay mobile ── */

@media (max-width: 767px) {
    .eccn-sk-overlay {
        min-height: 160px;
        padding: 16px;
    }

    .eccn-sk-minimal {
        padding: 14px;
        gap: 12px;
    }

    .eccn-sk-minimal .eccn-sk-icon {
        width: 40px;
        height: 40px;
    }

    .eccn-sk-gradient {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .eccn-sk-overlay {
        min-height: 140px;
        padding: 14px;
    }

    .eccn-sk-minimal {
        padding: 12px;
        gap: 10px;
    }

    .eccn-sk-gradient {
        padding: 14px;
    }
}

@media (max-width: 1024px) {
    .eccn-skeleton {
        grid-template-columns: repeat(var(--eccn-cols-t, 3), 1fr);
        gap: var(--eccn-gap-t, 16px);
    }
}

@media (max-width: 767px) {
    .eccn-skeleton {
        grid-template-columns: repeat(var(--eccn-cols-m, 1.5), 1fr);
        gap: var(--eccn-gap-m, 12px);
    }
}

/* ══════════════════════════════════════════════════════
   11. EMPTY STATE
   ══════════════════════════════════════════════════════ */

.eccn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
    text-align: center;
    gap: 12px;
}

.eccn-empty svg {
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.eccn-empty p {
    font-size: 14px;
    margin: 0;
}

/* ══════════════════════════════════════════════════════
   12. RESPONSIVE — TABLET (max-width: 1024px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .eccn-card-icon-box,
    .eccn-card-gradient {
        padding: 20px;
    }
}

/* ══════════════════════════════════════════════════════
   13. RESPONSIVE — MOBILE (max-width: 767px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    /* Reduce card padding on mobile */
    .eccn-card-icon-box,
    .eccn-card-gradient {
        padding: 16px;
    }

    .eccn-card-overlay {
        min-height: 160px;
        padding: 16px;
    }

    .eccn-card-minimal {
        padding: 14px;
        gap: 12px;
    }

    /* Smaller default icon on mobile */
    .eccn-icon-wrap {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .eccn-icon {
        font-size: 22px;
    }

    .eccn-icon svg {
        width: 22px;
        height: 22px;
    }

    .eccn-title {
        font-size: 14px;
    }

    .eccn-subtitle {
        font-size: 12px;
    }

    .eccn-arrow-indicator {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════
   14. RESPONSIVE — SMALL MOBILE (max-width: 480px)
   ══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .eccn-card-icon-box,
    .eccn-card-gradient {
        padding: 14px;
    }

    .eccn-card-overlay {
        min-height: 140px;
        padding: 14px;
    }

    .eccn-card-minimal {
        padding: 12px;
        gap: 10px;
    }

    .eccn-icon-wrap {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .eccn-icon {
        font-size: 18px;
    }

    .eccn-icon svg {
        width: 18px;
        height: 18px;
    }

    .eccn-title {
        font-size: 13px;
    }

    .eccn-count {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* ══════════════════════════════════════════════════════
   15. ELEMENTOR EDITOR SPECIFICS
   ══════════════════════════════════════════════════════ */

/* Ensure shadow variant is visible in Elementor editor */
.elementor-editor-active .eccn-variant-shadow .eccn-card,
.elementor-editor-preview .eccn-variant-shadow .eccn-card {
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08);
}

/* Minimal card: no shadow in editor */
.elementor-editor-active .eccn-card-minimal {
    box-shadow: none;
}

/* ══════════════════════════════════════════════════════
   16. PRINT
   ══════════════════════════════════════════════════════ */

@media print {
    .eccn-category-new {
        display: block;
    }

    .eccn-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .eccn-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }

    .eccn-skeleton,
    .eccn-arrow-indicator {
        display: none !important;
    }
}
