/* Endorsements Section */
.endorsements-section {
    max-width: 1400px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(66, 125, 192, 0.15);
}

.endorsements-container {
    width: 100%;
}

/* Grid Layout */
.endorsements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Endorsement Card */
.endorsement-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(66, 125, 192, 0.1);
    border: 1px solid rgba(66, 125, 192, 0.1);
    transition: all 0.4s ease;
    position: relative;
    animation: slideInUp 0.6s ease forwards;
    opacity: 0;
    height: 100%; /* برای یکنواختی ارتفاع کارت‌ها */
    display: flex;
    flex-direction: column;
}

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

.endorsement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(66, 125, 192, 0.1), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.endorsement-card:hover::before {
    left: 100%;
}

.endorsement-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(66, 125, 192, 0.25);
    border-color: #427dc0;
}

/* Image Wrapper - اندازه ثابت و کنترل شده */
.endorsement-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px; /* ارتفاع ثابت کوچکتر */
    overflow: hidden;
    background: linear-gradient(135deg, rgba(66, 125, 192, 0.05) 0%, rgba(31, 48, 121, 0.05) 100%);
    flex-shrink: 0; /* جلوگیری از تغییر اندازه */
}

.endorsement-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* نمایش کامل تصویر بدون برش */
    object-position: center; /* مرکز کردن تصویر */
    transition: transform 0.5s ease;
    padding: 10px; /* فاصله از لبه‌ها */
    background: white; /* پس‌زمینه سفید */
}

.endorsement-card:hover .endorsement-image {
    transform: scale(1.05); /* زوم کمتر */
}

/* Overlay */
.endorsement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(31, 48, 121, 0.2) 50%,
        rgba(31, 48, 121, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.endorsement-card:hover .endorsement-overlay {
    opacity: 1;
}

/* View Fullscreen Button */
.view-fullscreen {
    background: linear-gradient(135deg, #203F78 0%, #427dc0 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(66, 125, 192, 0.4);
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.endorsement-card:hover .view-fullscreen {
    transform: translateY(0);
}

.view-fullscreen:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(66, 125, 192, 0.5);
}

.view-fullscreen i {
    font-size: 1rem;
}

/* Endorsement Info */
.endorsement-info {
    padding: 1.2rem 1.5rem;
    background: white;
    flex-grow: 1; /* پر کردن فضای باقیمانده */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.endorsement-title {
    font-size: 1.1rem;
    color: #1f3079;
    font-weight: 700;
    margin-bottom: 0.4rem;
    text-align: center;
}

.endorsement-description {
    font-size: 0.95rem;
    color: #4a5868;
    line-height: 1.5;
    text-align: center;
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 30px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.fullscreen-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain; /* نمایش کامل بدون برش */
    animation: zoomIn 0.4s ease;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.fullscreen-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #fff;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 15px;
}

.close-modal {
    position: fixed;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 45px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 10000;
}

.close-modal:hover,
.close-modal:focus {
    color: #427dc0;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .endorsements-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .endorsement-image-wrapper {
        height: 260px;
    }
}

@media (max-width: 968px) {
    .endorsements-section {
        margin: 2rem auto;
        padding: 2rem 1.5rem;
    }

    .endorsements-grid {
        grid-template-columns: repeat(2, 1fr); /* دو ستونی در تبلت */
    }

    .endorsement-image-wrapper {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .endorsements-section {
        margin: 2rem 1rem;
        padding: 2rem 1rem;
        border-radius: 20px;
    }

    .endorsements-grid {
        grid-template-columns: 1fr; /* تک ستونی در موبایل */
        gap: 1.5rem;
    }

    .endorsement-image-wrapper {
        height: 220px;
    }

    .view-fullscreen {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .fullscreen-content {
        max-width: 98%;
        max-height: 85vh;
        padding: 10px;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 35px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .endorsement-image-wrapper {
        height: 200px;
    }

    .endorsement-info {
        padding: 1rem;
    }

    .endorsement-title {
        font-size: 1rem;
    }

    .endorsement-description {
        font-size: 0.9rem;
    }

    .fullscreen-modal {
        padding: 15px;
    }
}