/**
 * Marthoma Church Theme - Downloads Widget Styles
 * Layout similar to Publications widget
 *
 * @package MarthomaChurch
 */

/* Main Container */
.marthoma-downloads-widget {
    width: 100%;
}

/* Layout - Sidebar + Content */
.downloads-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 80px;
}

/* Sidebar */
.downloads-sidebar {
    width: 30%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header Section */
.downloads-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Heading */
.downloads-heading {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 35px;
    font-weight: 700;
    color: var(--marthoma-dark-navy-alt, #04141E);
    margin: 0;
    line-height: normal;
}

/* Description */
.downloads-description {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    color: var(--marthoma-dark-navy-alt, #04141E);
    margin: 0;
    line-height: 1.5;
}

/* Category Tabs Container */
.downloads-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Category Tab Button */
.downloads-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 12px;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--marthoma-dark-navy-alt, #04141E);
    background-color: transparent;
    border: 1px solid #B8B8B8;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.downloads-tab:hover {
    border-color: var(--marthoma-dark-navy, #072538);
}

.downloads-tab.active {
    background-color: var(--marthoma-dark-navy, #072538);
    color: #FFFFFF;
    border-color: var(--marthoma-dark-navy, #072538);
}

/* Content Area */
.downloads-content {
    flex: 1;
    position: relative;
}

/* Downloads List */
.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Download Card */
.download-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    background-color: #FFFFFF;
    border: 1.5px solid #B8B8B8;
    border-radius: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
    border-color: var(--marthoma-dark-navy, #072538);
}

/* File Icon */
.download-card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--marthoma-dark-navy, #072538);
    border-radius: 8px;
    flex-shrink: 0;
}

.download-card-ext {
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content */
.download-card-content {
    flex: 1;
    min-width: 0;
}

.download-card-title {
    font-family: var(--marthoma-font-heading, 'Montserrat', sans-serif);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--marthoma-dark-navy-alt, #04141E);
    margin: 0;
}

.download-card-size {
    display: block;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 13px;
    color: #707070;
    margin-top: 4px;
}

/* Action Area with Line */
.download-card-action {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.download-card-line {
    width: 60px;
    height: 1px;
    background-color: #D0D5DD;
}

/* Download Button */
.download-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: var(--marthoma-dark-navy, #072538);
    color: #ffffff;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.download-card-button:hover {
    background-color: var(--marthoma-dark-navy-alt, #04141E);
}

.download-card-button svg {
    width: 14px;
    height: 14px;
}

/* No Results Message */
.downloads-no-results,
.downloads-no-categories {
    padding: 40px;
    text-align: center;
    color: #707070;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
}

/* Loading Spinner */
.downloads-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.downloads-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E0E0E0;
    border-top-color: var(--marthoma-dark-navy, #072538);
    border-radius: 50%;
    animation: downloadsSpinner 0.8s linear infinite;
}

@keyframes downloadsSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* Fade Animation */
.downloads-list.loading {
    opacity: 0.5;
    pointer-events: none;
}

.download-card {
    animation: downloadFadeIn 0.4s ease-out forwards;
}

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

/* ==========================================
   LOAD MORE
   ========================================== */

.downloads-load-more-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.downloads-load-more-line {
    flex: 1;
    height: 1px;
    background-color: #D0D5DD;
}

.downloads-load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background-color: transparent;
    border: none;
    font-family: var(--marthoma-font-body, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--marthoma-dark-navy-alt, #04141E);
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.downloads-load-more:hover {
    color: var(--marthoma-dark-navy, #072538);
}

.downloads-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.downloads-load-more-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.downloads-load-more:hover .downloads-load-more-icon {
    transform: translateY(3px);
}

.downloads-spinner-btn {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid #D0D5DD;
    border-top-color: var(--marthoma-dark-navy, #072538);
    border-radius: 50%;
    animation: downloadsSpinner 0.8s linear infinite;
}

.downloads-load-more.loading .downloads-load-more-text,
.downloads-load-more.loading .downloads-load-more-icon {
    opacity: 0;
}

.downloads-load-more.loading .downloads-spinner-btn {
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* New items animation */
.download-card.download-item-new {
    animation: downloadFadeIn 0.5s ease forwards;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .downloads-layout {
        flex-direction: column;
        gap: 31px;
    }

    .downloads-sidebar {
        width: 100%;
    }

    .downloads-heading {
        font-size: 23px;
    }

    .downloads-description {
        font-size: 15px;
        line-height: 1.42;
    }

    .downloads-tab {
        font-size: 15px;
        line-height: 1.42;
    }

    .downloads-list {
        gap: 12px;
    }

    .download-card {
        padding: 15px 20px;
        gap: 15px;
    }

    .download-card-icon {
        width: 45px;
        height: 45px;
    }

    .download-card-title {
        font-size: 15px;
    }

    .download-card-line {
        width: 40px;
    }

    .download-card-button {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .downloads-layout {
        gap: 25px;
    }

    .downloads-header {
        gap: 14px;
    }

    .downloads-heading {
        font-size: 21px;
    }

    .downloads-description {
        font-size: 14px;
        line-height: 1.32;
    }

    .downloads-tabs {
        gap: 8px;
    }

    .downloads-tab {
        font-size: 14px;
        line-height: 1.32;
    }

    .downloads-list {
        gap: 10px;
    }

    .download-card {
        flex-wrap: wrap;
        padding: 15px;
        gap: 12px;
    }

    .download-card-icon {
        width: 42px;
        height: 42px;
    }

    .download-card-ext {
        font-size: 10px;
    }

    .download-card-content {
        flex: 1;
        min-width: calc(100% - 70px);
    }

    .download-card-title {
        font-size: 14px;
    }

    .download-card-size {
        font-size: 12px;
    }

    .download-card-action {
        width: 100%;
        justify-content: flex-end;
    }

    .download-card-line {
        flex: 1;
    }

    .download-card-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .downloads-load-more-wrapper {
        margin-top: 25px;
        gap: 15px;
    }

    .downloads-load-more {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .downloads-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .downloads-tab {
        flex-shrink: 0;
    }

    .download-card-content {
        min-width: 0;
        flex: 1 1 calc(100% - 60px);
    }

    .download-card-action {
        width: 100%;
    }
}

/* ==========================================
   REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .downloads-tab,
    .download-card,
    .download-card-button,
    .downloads-load-more,
    .downloads-load-more-icon {
        transition: none;
    }

    .download-card,
    .download-card.download-item-new {
        animation: none;
    }

    .downloads-spinner,
    .downloads-spinner-btn {
        animation: none;
    }
}

/* ==========================================
   ELEMENTOR EDITOR
   ========================================== */

.elementor-editor-active .marthoma-downloads-widget {
    min-height: 300px;
}
