/**
 * Professional Donations Styling
 *
 * @package Beit_Knesset_Manager
 */

/* ===========================
   VARIABLES
   =========================== */
:root {
    --bkm-primary: #0d2a4b;
    --bkm-accent: #d4af37;
    --bkm-success: #28a745;
    --bkm-text: #333;
    --bkm-text-light: #666;
    --bkm-border: #e5e7eb;
    --bkm-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --bkm-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
    --bkm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   CONTAINER
   =========================== */
.bkm-donations-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===========================
   HEADER
   =========================== */
.bkm-donations-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.6s ease-out;
}

.bkm-donations-header h1,
.bkm-donations-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--bkm-primary), var(--bkm-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.bkm-donations-header p {
    font-size: 1.1rem;
    color: var(--bkm-text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===========================
   FILTERS & SEARCH
   =========================== */
.bkm-donations-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.bkm-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bkm-filter-btn {
    padding: 10px 20px;
    background: white;
    color: var(--bkm-primary);
    border: 2px solid var(--bkm-border);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--bkm-transition);
    position: relative;
    overflow: hidden;
}

.bkm-filter-btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--bkm-accent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.bkm-filter-btn:hover:before,
.bkm-filter-btn.active:before {
    width: 300px;
    height: 300px;
}

.bkm-filter-btn:hover,
.bkm-filter-btn.active {
    color: white;
    border-color: var(--bkm-accent);
}

.bkm-filter-btn span {
    position: relative;
    z-index: 1;
}

.bkm-search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.bkm-search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid var(--bkm-border);
    border-radius: 25px;
    font-size: 1rem;
    transition: var(--bkm-transition);
}

.bkm-search-input:focus {
    outline: none;
    border-color: var(--bkm-accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.bkm-search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bkm-text-light);
    pointer-events: none;
}

/* ===========================
   GRID LAYOUT
   =========================== */
.bkm-donations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* ===========================
   DONATION CARDS
   =========================== */
.bkm-donation-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--bkm-shadow);
    transition: var(--bkm-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out backwards;
}

.bkm-donation-card:nth-child(1) { animation-delay: 0.1s; }
.bkm-donation-card:nth-child(2) { animation-delay: 0.2s; }
.bkm-donation-card:nth-child(3) { animation-delay: 0.3s; }
.bkm-donation-card:nth-child(4) { animation-delay: 0.4s; }
.bkm-donation-card:nth-child(5) { animation-delay: 0.5s; }
.bkm-donation-card:nth-child(6) { animation-delay: 0.6s; }

.bkm-donation-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--bkm-shadow-hover);
}

/* Card Image */
.bkm-donation-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bkm-donation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bkm-donation-card:hover .bkm-donation-image img {
    transform: scale(1.1) rotate(2deg);
}

.bkm-donation-image:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.bkm-donation-card:hover .bkm-donation-image:after {
    opacity: 1;
}

/* Category Badge */
.bkm-donation-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    animation: slideInRight 0.5s ease-out;
}

.bkm-donation-badge-icon {
    width: 16px;
    height: 16px;
}

/* Favorite Button */
.bkm-favorite-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--bkm-transition);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.bkm-favorite-btn:hover {
    transform: scale(1.1);
    background: var(--bkm-accent);
}

.bkm-favorite-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--bkm-primary);
    stroke-width: 2;
    transition: var(--bkm-transition);
}

.bkm-favorite-btn:hover svg,
.bkm-favorite-btn.active svg {
    fill: white;
    stroke: white;
}

/* Card Content */
.bkm-donation-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bkm-donation-content h3 {
    font-size: 1.4rem;
    margin: 0 0 12px 0;
    color: var(--bkm-primary);
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bkm-purpose-tag {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--bkm-primary), var(--bkm-accent));
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(13, 42, 75, 0.2);
}

.bkm-donation-description {
    color: var(--bkm-text-light);
    line-height: 1.6;
    margin: 15px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price Display */
.bkm-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.bkm-donation-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--bkm-accent);
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.bkm-price-label {
    font-size: 0.7em;
    color: var(--bkm-text-light);
    font-weight: 500;
}

.bkm-price-suffix {
    font-size: 0.6em;
    color: var(--bkm-text-light);
}

/* Progress Bar (if goal is set) */
.bkm-progress-wrapper {
    margin: 15px 0;
}

.bkm-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bkm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bkm-accent) 0%, var(--bkm-primary) 100%);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bkm-progress-fill:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.bkm-progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--bkm-text-light);
}

/* Tax Deductible Badge */
.bkm-tax-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(40, 167, 69, 0.1);
    color: var(--bkm-success);
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    margin: 10px 0;
}

.bkm-tax-badge svg {
    width: 18px;
    height: 18px;
}

/* Features List */
.bkm-features-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.bkm-features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--bkm-text-light);
    font-size: 0.95em;
}

.bkm-features-list li:before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--bkm-accent);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8em;
    flex-shrink: 0;
}

/* Donate Button */
.bkm-donate-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--bkm-primary) 0%, var(--bkm-accent) 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: auto;
    transition: var(--bkm-transition);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 42, 75, 0.3);
}

.bkm-donate-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;
}

.bkm-donate-btn:hover:before {
    left: 100%;
}

.bkm-donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 42, 75, 0.4);
}

.bkm-donate-btn:active {
    transform: translateY(0);
}

.bkm-donate-btn span {
    position: relative;
    z-index: 1;
}

/* Quick View Button */
.bkm-quick-view {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--bkm-accent);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0);
    transition: var(--bkm-transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

.bkm-donation-card:hover .bkm-quick-view {
    opacity: 1;
    transform: scale(1);
}

.bkm-quick-view:hover {
    transform: scale(1.1);
}

/* ===========================
   LOADING STATE
   =========================== */
.bkm-skeleton-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--bkm-shadow);
}

.bkm-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.bkm-skeleton-image {
    width: 100%;
    height: 220px;
}

.bkm-skeleton-content {
    padding: 25px;
}

.bkm-skeleton-title {
    height: 24px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.bkm-skeleton-text {
    height: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.bkm-skeleton-button {
    height: 50px;
    margin-top: 20px;
    border-radius: 12px;
}

/* ===========================
   PAGINATION
   =========================== */
.bkm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}

.bkm-page-btn {
    padding: 10px 18px;
    background: white;
    color: var(--bkm-primary);
    border: 2px solid var(--bkm-border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--bkm-transition);
}

.bkm-page-btn:hover,
.bkm-page-btn.active {
    background: var(--bkm-accent);
    color: white;
    border-color: var(--bkm-accent);
}

.bkm-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1200px) {
    .bkm-donations-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .bkm-donations-container {
        padding: 30px 15px;
    }

    .bkm-donations-header h1,
    .bkm-donations-header h2 {
        font-size: 2rem;
    }

    .bkm-donations-filters {
        flex-direction: column;
        padding: 20px 15px;
    }

    .bkm-filter-group {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .bkm-search-box {
        width: 100%;
        max-width: none;
    }

    .bkm-donations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bkm-donation-price {
        font-size: 1.6rem;
    }

    .bkm-donate-btn {
        font-size: 1rem;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .bkm-donation-content {
        padding: 20px;
    }

    .bkm-donation-content h3 {
        font-size: 1.2rem;
    }

    .bkm-price-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */
.bkm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.bkm-donation-card:focus-within {
    outline: 3px solid var(--bkm-accent);
    outline-offset: 4px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--bkm-accent);
    outline-offset: 2px;
}

/* ===========================
   DARK MODE SUPPORT
   =========================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bkm-text: #e0e0e0;
        --bkm-text-light: #b0b0b0;
        --bkm-border: #404040;
    }

    .bkm-donation-card {
        background: #2a2a2a;
    }

    .bkm-donations-filters {
        background: #1a1a1a;
    }

    .bkm-filter-btn {
        background: #2a2a2a;
        color: var(--bkm-text);
    }

    .bkm-search-input {
        background: #2a2a2a;
        color: var(--bkm-text);
    }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    .bkm-donations-filters,
    .bkm-favorite-btn,
    .bkm-quick-view,
    .bkm-pagination {
        display: none !important;
    }

    .bkm-donation-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
