/* SJ Audio Category Grid styles */
.stjohn-audio-category-grid {
    display: block;
    width: 100%;
}

.sj-audio-grid-inner {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

/* Dynamic column classes - more forceful to ensure they apply */
.sj-cols-1 .sj-audio-grid-inner { grid-template-columns: 1fr !important; }
.sj-cols-2 .sj-audio-grid-inner { grid-template-columns: repeat(2, 1fr) !important; }
.sj-cols-3 .sj-audio-grid-inner { grid-template-columns: repeat(3, 1fr) !important; }
.sj-cols-4 .sj-audio-grid-inner { grid-template-columns: repeat(4, 1fr) !important; }

.sj-audio-item {
    padding: 0;
}

.sj-audio-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    margin-bottom: 20px;
    width: 100% !important;
    box-sizing: border-box !important;
}

.sj-inline-audio {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
}

.sj-audio-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

.sj-play {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e9e9eb;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    cursor: pointer;
    flex: 0 0 64px;
    transition: all 0.2s ease;
}

.sj-play .sj-play-icon {
    font-size: 20px;
    color: #6b6b72;
}

.sj-play.paused {
    background: #c79b3f;
    color: #fff;
}

.sj-audio-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sj-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #222;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.sj-times {
    font-size: 12px;
    color: #9aa0a6;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sj-times .sj-current {
    margin-right: auto;
}

.sj-progress {
    height: 8px;
    background: #eef0f3;
    border-radius: 6px;
    overflow: hidden;
}

.sj-progress-bar {
    height: 100%;
    width: 0;
    background: #c79b3f;
    transition: width 0.1s linear;
}

.sj-audio-card.playing {
    border-color: #c79b3f;
    box-shadow: 0 8px 24px rgba(199, 155, 63, 0.15);
}

/* Pagination styles - Modern Premium Look */
.sj-pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 40px !important;
    padding: 10px 0 !important;
}

.sj-pagination .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 16px !important;
    border-radius: 10px !important;
    background: #fdfdfd !important;
    border: 1px solid #e2e8f0 !important;
    color: #4a5568 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

.sj-pagination .page-numbers:hover {
    background: #ffffff !important;
    border-color: #c79b3f !important;
    color: #c79b3f !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(199, 155, 63, 0.2) !important;
}

.sj-pagination .page-numbers.current {
    background: #c79b3f !important;
    border-color: #c79b3f !important;
    color: #ffffff !important;
    box-shadow: 0 6px 15px rgba(199, 155, 63, 0.3) !important;
    cursor: default !important;
    transform: none !important;
}

.sj-pagination .page-numbers.prev,
.sj-pagination .page-numbers.next {
    width: auto !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sj-cols-3 .sj-audio-grid-inner,
    .sj-cols-4 .sj-audio-grid-inner {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .stjohn-audio-category-grid .sj-audio-grid-inner {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .sj-play {
        width: 54px;
        height: 54px;
        flex: 0 0 54px;
        margin-right: 15px;
    }
    
    .sj-title {
        font-size: 15px;
        white-space: normal !important;
    }
    
    .sj-audio-card {
        padding: 15px;
        align-items: flex-start;
    }

    .sj-audio-content {
        padding-top: 2px;
    }
}

/* AJAX Loading state */
.stjohn-audio-category-grid.sj-loading {
    position: relative;
    pointer-events: none;
}

.stjohn-audio-category-grid.sj-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 3px solid rgba(199, 155, 63, 0.2);
    border-top-color: #c79b3f;
    border-radius: 50%;
    animation: sj-spin 0.8s linear infinite;
    z-index: 10;
}

.stjohn-audio-category-grid.sj-loading .sj-audio-grid-inner {
    opacity: 0.5;
    filter: blur(2px);
    transition: all 0.3s ease;
}

@keyframes sj-spin {
    to { transform: rotate(360deg); }
}