/*
 * Volunteer CMS — Frontend Styles
 * ALL rules scoped under .vcms and use !important to beat Impreza / WPBakery specificity.
 */

/* ==========================================================================
   BASE RESET
   ========================================================================== */

.vcms *,
.vcms *::before,
.vcms *::after {
    box-sizing: border-box !important;
}

.vcms {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif !important;
    color: #333333 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   MAIN WRAPPER
   ========================================================================== */

.vcms .vcms-programs-wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

/* ==========================================================================
   OVERRIDE IMPREZA / WPBAKERY CONFLICTING CLASSES
   ========================================================================== */

.vcms .vc_column-inner {
    padding: 0 !important;
    margin: 0 !important;
}

.vcms .wpb_wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

.vcms .vc_row {
    margin: 0 !important;
    padding: 0 !important;
}

.vcms .wpb_content_element {
    margin-bottom: 0 !important;
}

/* ==========================================================================
   FILTER BAR
   ========================================================================== */

.vcms .vcms-filter-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 12px !important;
    padding: 16px !important;
    background: #f8f9fa !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    margin-bottom: 24px !important;
}

.vcms .vcms-filter-bar .vcms-filter-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 1 1 180px !important;
    min-width: 140px !important;
}

.vcms .vcms-filter-bar .vcms-filter-field label {
    font-size: 0.8em !important;
    font-weight: 600 !important;
    color: #555 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    margin: 0 !important;
}

.vcms .vcms-filter-bar select,
.vcms .vcms-filter-bar input[type="text"],
.vcms .vcms-filter-bar input[type="date"],
.vcms .vcms-filter-bar input[type="search"] {
    width: 100% !important;
    padding: 8px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 0.9em !important;
    color: #333 !important;
    background: #fff !important;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    height: 40px !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease !important;
    margin: 0 !important;
}

.vcms .vcms-filter-bar select:focus,
.vcms .vcms-filter-bar input:focus {
    outline: none !important;
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15) !important;
}

.vcms .vcms-filter-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: flex-end !important;
    flex-shrink: 0 !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.vcms .vcms-btn {
    display: inline-block !important;
    padding: 9px 18px !important;
    border-radius: 6px !important;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border: none !important;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.1s ease !important;
    line-height: 1.4 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.vcms .vcms-btn-primary {
    background: #2271b1 !important;
    color: #fff !important;
}

.vcms .vcms-btn-primary:hover {
    background: #1a5c94 !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}

.vcms .vcms-btn-secondary {
    background: #f0f0f0 !important;
    color: #555 !important;
    border: 1px solid #d1d5db !important;
}

.vcms .vcms-btn-secondary:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
    text-decoration: none !important;
}

.vcms .vcms-btn-reset {
    background: transparent !important;
    color: #888 !important;
    border: 1px solid #d1d5db !important;
}

.vcms .vcms-btn-reset:hover {
    background: #f0f0f0 !important;
    color: #555 !important;
}

/* ==========================================================================
   VIEW TOGGLE
   ========================================================================== */

.vcms .vcms-view-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-bottom: 16px !important;
    justify-content: flex-end !important;
}

.vcms .vcms-view-toggle-label {
    font-size: 0.85em !important;
    color: #666 !important;
    margin-right: 8px !important;
}

.vcms .vcms-view-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #666 !important;
    cursor: pointer !important;
    font-size: 1em !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s !important;
}

.vcms .vcms-view-btn:hover {
    background: #f0f4ff !important;
    border-color: #2271b1 !important;
    color: #2271b1 !important;
}

.vcms .vcms-view-btn.active {
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
}

/* ==========================================================================
   PROGRAMS GRID — BASE
   ========================================================================== */

.vcms .vcms-programs-grid {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   CARDS VIEW
   ========================================================================== */

.vcms .vcms-programs-grid.vcms-view-cards {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
}

.vcms .vcms-program-card.vcms-view-cards {
    background: #fff !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: box-shadow 0.25s ease, transform 0.2s ease !important;
}

.vcms .vcms-program-card.vcms-view-cards:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14) !important;
    transform: translateY(-3px) !important;
}

.vcms .vcms-view-cards .vcms-card-image {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    background: #e8ecf0 !important;
    flex-shrink: 0 !important;
}

.vcms .vcms-view-cards .vcms-card-image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.vcms .vcms-view-cards .vcms-card-image img,
.vcms .vcms-view-cards .vcms-card-image .vcms-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.vcms .vcms-view-cards .vcms-no-image {
    width: 100% !important;
    height: 100% !important;
    background: #dde2e8 !important;
}

/* ==========================================================================
   LIST VIEW
   ========================================================================== */

.vcms .vcms-programs-grid.vcms-view-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

.vcms .vcms-program-card.vcms-view-list {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 16px 0 !important;
    gap: 20px !important;
}

.vcms .vcms-program-card.vcms-view-list:first-child {
    border-top: 1px solid #e2e8f0 !important;
}

.vcms .vcms-view-list .vcms-card-image {
    width: 200px !important;
    min-width: 200px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    background: #e8ecf0 !important;
    align-self: flex-start !important;
}

.vcms .vcms-view-list .vcms-card-image a {
    display: block !important;
    width: 100% !important;
}

.vcms .vcms-view-list .vcms-card-image img,
.vcms .vcms-view-list .vcms-card-image .vcms-card-img {
    width: 100% !important;
    height: 130px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 8px !important;
}

.vcms .vcms-view-list .vcms-no-image {
    width: 100% !important;
    height: 130px !important;
    background: #dde2e8 !important;
    border-radius: 8px !important;
}

/* ==========================================================================
   COMPACT VIEW
   ========================================================================== */

.vcms .vcms-programs-grid.vcms-view-compact {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

.vcms .vcms-program-card.vcms-view-compact {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 10px !important;
    gap: 10px !important;
}

.vcms .vcms-view-compact .vcms-card-image.vcms-card-image-thumb {
    width: 60px !important;
    min-width: 60px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-radius: 4px !important;
    background: #e8ecf0 !important;
}

.vcms .vcms-view-compact .vcms-card-image-thumb a {
    display: block !important;
}

.vcms .vcms-view-compact .vcms-card-image-thumb img,
.vcms .vcms-view-compact .vcms-card-image-thumb .vcms-card-img {
    width: 60px !important;
    height: 45px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 4px !important;
}

.vcms .vcms-view-compact .vcms-no-image {
    width: 60px !important;
    height: 45px !important;
    background: #dde2e8 !important;
    border-radius: 4px !important;
}

/* ==========================================================================
   CARD BODY (shared)
   ========================================================================== */

.vcms .vcms-card-body {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    gap: 8px !important;
}

.vcms .vcms-view-list .vcms-card-body {
    padding: 0 !important;
}

.vcms .vcms-view-compact .vcms-card-body {
    padding: 0 !important;
    gap: 4px !important;
}

/* ==========================================================================
   CARD TITLE
   ========================================================================== */

.vcms .vcms-card-title {
    font-size: 1.15em !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    color: #1a1a2e !important;
}

.vcms .vcms-view-compact .vcms-card-title {
    font-size: 0.9em !important;
    font-weight: 600 !important;
}

.vcms .vcms-card-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.vcms .vcms-card-title a:hover {
    color: #2271b1 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   CARD EXCERPT
   ========================================================================== */

.vcms .vcms-card-excerpt {
    font-size: 0.9em !important;
    color: #555 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    line-clamp: 3 !important;
}

/* ==========================================================================
   CARD META — BADGES
   ========================================================================== */

.vcms .vcms-card-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 0 !important;
}

.vcms .vcms-badge {
    display: inline-block !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 0.75em !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    transition: opacity 0.2s !important;
}

.vcms .vcms-badge:hover {
    opacity: 0.8 !important;
    text-decoration: none !important;
}

.vcms .vcms-badge-country {
    background: #e0f0ff !important;
    color: #1e6fb0 !important;
}

.vcms .vcms-badge-location {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
}

/* ==========================================================================
   CARD DATES
   ========================================================================== */

.vcms .vcms-card-dates {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

.vcms .vcms-card-dates li {
    font-size: 0.78em !important;
    color: #888 !important;
    background: #f5f5f5 !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
}

.vcms .vcms-card-dates .vcms-more-dates {
    color: #aaa !important;
    font-style: italic !important;
}

/* ==========================================================================
   CARD PAYMENT
   ========================================================================== */

.vcms .vcms-card-payment {
    font-size: 0.82em !important;
    color: #666 !important;
    margin: 0 !important;
}

/* ==========================================================================
   CARD LINK / LEARN MORE
   ========================================================================== */

.vcms .vcms-card-link {
    margin-top: auto !important;
    align-self: flex-start !important;
    padding: 8px 16px !important;
    font-size: 0.85em !important;
}

.vcms .vcms-view-compact .vcms-card-link {
    display: none !important;
}

/* ==========================================================================
   NO RESULTS
   ========================================================================== */

.vcms .vcms-no-results {
    text-align: center !important;
    font-style: italic !important;
    color: #999 !important;
    padding: 40px 20px !important;
    width: 100% !important;
    font-size: 1em !important;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.vcms .vcms-loading-overlay {
    position: relative !important;
    min-height: 80px !important;
}

.vcms .vcms-loading-overlay::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: rgba(255, 255, 255, 0.75) !important;
    z-index: 10 !important;
    border-radius: 8px !important;
}

.vcms .vcms-spinner {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 32px !important;
    color: #2271b1 !important;
    font-size: 0.9em !important;
}

.vcms .vcms-spinner::before {
    content: '' !important;
    width: 24px !important;
    height: 24px !important;
    border: 3px solid #e0e0e0 !important;
    border-top-color: #2271b1 !important;
    border-radius: 50% !important;
    animation: vcms-spin 0.7s linear infinite !important;
    margin-right: 10px !important;
    flex-shrink: 0 !important;
}

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

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.vcms .vcms-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 32px !important;
    flex-wrap: wrap !important;
}

.vcms .vcms-page-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 0.9em !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s !important;
}

.vcms .vcms-page-btn:hover {
    background: #f0f4ff !important;
    border-color: #2271b1 !important;
    color: #2271b1 !important;
    text-decoration: none !important;
}

.vcms .vcms-page-btn.active {
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
    cursor: default !important;
}

.vcms .vcms-page-btn:disabled,
.vcms .vcms-page-btn[disabled] {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.vcms .vcms-pagination-info {
    font-size: 0.85em !important;
    color: #888 !important;
    text-align: center !important;
    margin-top: 8px !important;
}

/* ==========================================================================
   COPY FEEDBACK
   ========================================================================== */

.vcms .vcms-copied-feedback {
    font-size: 0.8em !important;
    color: #2e7d32 !important;
    margin-left: 6px !important;
    animation: vcms-fade-out 2s forwards !important;
}

@keyframes vcms-fade-out {
    0%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ==========================================================================
   RESPONSIVE — TABLET (601px – 1024px)
   ========================================================================== */

@media (max-width: 1024px) and (min-width: 601px) {

    .vcms .vcms-programs-grid.vcms-view-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .vcms .vcms-programs-grid.vcms-view-compact {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .vcms .vcms-view-list .vcms-card-image {
        width: 160px !important;
        min-width: 160px !important;
    }

    .vcms .vcms-filter-bar .vcms-filter-field {
        flex: 1 1 150px !important;
    }
}

/* ==========================================================================
   RESPONSIVE — MOBILE (<= 600px)
   ========================================================================== */

@media (max-width: 600px) {

    .vcms .vcms-programs-grid.vcms-view-cards {
        grid-template-columns: 1fr !important;
    }

    .vcms .vcms-programs-grid.vcms-view-compact {
        grid-template-columns: 1fr !important;
    }

    .vcms .vcms-program-card.vcms-view-list {
        flex-direction: column !important;
    }

    .vcms .vcms-view-list .vcms-card-image {
        width: 100% !important;
        min-width: unset !important;
    }

    .vcms .vcms-view-list .vcms-card-image img,
    .vcms .vcms-view-list .vcms-card-image .vcms-card-img {
        width: 100% !important;
        height: 180px !important;
    }

    .vcms .vcms-view-list .vcms-card-body {
        padding: 12px 0 0 !important;
    }

    .vcms .vcms-filter-bar {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .vcms .vcms-filter-bar .vcms-filter-field {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    .vcms .vcms-filter-actions {
        width: 100% !important;
        justify-content: stretch !important;
    }

    .vcms .vcms-filter-actions .vcms-btn {
        flex: 1 !important;
        text-align: center !important;
    }

    .vcms .vcms-view-toggle {
        justify-content: flex-start !important;
    }
}
