/* Catalog Cards Page */

/* Override old files__wrapper styles */
.files__wrapper {
    display: none !important;
}

.catalog-cards-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px)) !important;
    gap: 30px !important;
    margin-top: 60px !important;
    padding: 0 15px !important;
    width: 100% !important;
    max-width: 1400px !important;
    list-style: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}

.catalog-card {
    background: #fff !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    border: 1px solid #f0f0f0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.catalog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(230, 59, 14, 0.15);
    border-color: #f58220;
}

.catalog-card-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    max-height: 400px;
}

.catalog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.catalog-card:hover .catalog-card-image {
    transform: scale(1.1);
}

.catalog-card-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    transition: background 0.3s ease;
}

.catalog-card:hover .catalog-card-cover {
    background: #d8d8d8;
}

.catalog-pdf-icon {
    color: #999;
    transition: all 0.3s ease;
}

.catalog-card:hover .catalog-pdf-icon {
    color: #f58220;
    transform: scale(1.1);
}

.catalog-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.catalog-card:hover .catalog-card-overlay {
    opacity: 1;
}

.catalog-card-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.catalog-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.catalog-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.catalog-btn:hover::before {
    left: 100%;
}

.catalog-btn-view {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.catalog-btn-view:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.catalog-btn-download {
    background: rgba(245, 130, 32, 0.9);
    border-color: #f58220;
}

.catalog-btn-download:hover {
    background: #f58220;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(245, 130, 32, 0.4);
}

.catalog-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.catalog-btn:hover svg {
    transform: scale(1.1);
}

.catalog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.catalog-card-title {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-secondary);
    color: #2D2E30;
    margin: 0;
    line-height: 1.4;
    text-transform: uppercase;
}

.catalog-card-description {
    font-size: 14px;
    font-weight: 400;
    font-family: var(--font-primary);
    color: #8D9096;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure container doesn't interfere */
body.catalog-page .container,
body.page-template-catalog .container {
    max-width: 100% !important;
}

body.catalog-page .wrap-content-text,
body.page-template-catalog .wrap-content-text {
    margin-bottom: 0 !important;
}

/* Generate Thumbnails Button */
.catalog-generate-thumbnails-wrapper {
    margin: 40px auto;
    max-width: 600px;
    padding: 0 15px;
    text-align: center;
}

.catalog-generate-thumbnails-btn {
    background: linear-gradient(135deg, #f58220 0%, #e0751a 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 130, 32, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-primary);
}

.catalog-generate-thumbnails-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 130, 32, 0.4);
}

.catalog-generate-thumbnails-btn:active {
    transform: translateY(0);
}

.catalog-generate-thumbnails-btn.processing {
    opacity: 0.7;
    cursor: not-allowed;
}

.catalog-generate-thumbnails-btn .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.thumbnail-progress {
    margin-top: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f58220 0%, #e0751a 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-family: var(--font-primary);
}

.thumbnail-result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.thumbnail-result-success {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

.thumbnail-result-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.thumbnail-result h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.thumbnail-stats {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.thumbnail-stats li {
    padding: 8px 0;
    font-size: 14px;
}

.thumbnail-stats li.error {
    color: #dc2626;
}

.thumbnail-details {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.thumbnail-details h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.thumbnail-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thumbnail-details li {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.5);
}

.thumbnail-details li.success {
    background: #dcfce7;
    color: #166534;
}

.thumbnail-details li.failed {
    background: #fee2e2;
    color: #991b1b;
}

.thumbnail-details li.skipped {
    background: #fef3c7;
    color: #92400e;
}

.refresh-note {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-style: italic;
}

/* Override container styles for catalog page */
body.catalog-page .container .catalog-cards-wrapper,
body.page-template-catalog .container .catalog-cards-wrapper,
body.catalog-page .wrap-content-text + .catalog-cards-wrapper,
body.page-template-catalog .wrap-content-text + .catalog-cards-wrapper,
body.catalog-page .catalog-cards-wrapper,
body.page-template-catalog .catalog-cards-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px)) !important;
    gap: 30px !important;
    margin-top: 60px !important;
    padding: 0 15px !important;
    width: 100% !important;
    max-width: 1400px !important;
    list-style: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}

/* Responsive Design */
@media screen and (max-width: 1400px) {
    .catalog-cards-wrapper,
    body.catalog-page .catalog-cards-wrapper,
    body.page-template-catalog .catalog-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(260px, 300px)) !important;
        gap: 25px !important;
        max-width: 1200px !important;
    }
}

@media screen and (max-width: 992px) {
    .catalog-cards-wrapper,
    body.catalog-page .catalog-cards-wrapper,
    body.page-template-catalog .catalog-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(240px, 280px)) !important;
        gap: 20px !important;
        max-width: 900px !important;
    }
    
    .catalog-card-content {
        padding: 20px;
    }
    
    .catalog-card-title {
        font-size: 16px;
    }
    
    .catalog-card-description {
        font-size: 13px;
    }
}

@media screen and (max-width: 768px) {
    .catalog-cards-wrapper,
    body.catalog-page .catalog-cards-wrapper,
    body.page-template-catalog .catalog-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 15px !important;
        margin-top: 40px !important;
        padding: 0 10px !important;
        max-width: 600px !important;
    }
    
    .catalog-card {
        border-radius: 15px;
    }
    
    .catalog-card-content {
        padding: 15px;
    }
    
    .catalog-card-title {
        font-size: 15px;
    }
    
    .catalog-card-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .catalog-btn {
        padding: 10px 16px;
        font-size: 12px;
        gap: 6px;
    }
    
    .catalog-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media screen and (max-width: 576px) {
    .catalog-cards-wrapper,
    body.catalog-page .catalog-cards-wrapper,
    body.page-template-catalog .catalog-cards-wrapper {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        max-width: 400px !important;
    }
    
    .catalog-card-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .catalog-btn {
        width: 100%;
        justify-content: center;
    }
}

