/**
 * Mohabbat Campaigns Public CSS
 */

.mohabbat-campaigns-list-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.mohabbat-campaign-card {
    background-color: #fff5e6; 
    border: 1px solid #ff9900; 
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mohabbat-campaign-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.campaign-card-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.campaign-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.campaign-card-title {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
}

.campaign-card-title a {
    text-decoration: none;
    color: #333;
}

.campaign-card-title a:hover {
    color: #ff9900;
}

.campaign-card-excerpt {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1; 
}

.campaign-card-progress,
.single-campaign .campaign-sidebar-details .campaign-card-progress {
    margin-bottom: 15px;
}

.progress-bar-wrapper {
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    height: 25px; 
    margin-bottom: 5px;
}

.progress-bar-track {
    height: 100%;
    background-color: #f0f0f0; 
    border-radius: 5px;
}

.progress-bar-fill {
    background-color: #ff9900; 
    height: 100%;
    text-align: center;
    color: #fff;
    font-weight: bold;
    line-height: 25px;
    white-space: nowrap;
    transition: width 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bar-fill span {
    padding: 0 5px;
}

.progress-bar-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
}

.progress-bar-text .collected {
    font-weight: bold;
    color: #4CAF50; 
}
.progress-bar-text .target {
    color: #E91E63; 
}


.campaign-card-actions {
    margin-top: auto; 
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.campaign-card-actions .button,
.campaign-card-actions a.button,
.single-campaign .campaign-actions-single .button.campaign-participate-button,
.mohabbat-popup-form .form-submit input[type="submit"] {
    background-color: #4c9b58; /* New primary green color */
    background-image: linear-gradient(to bottom, #5cb860, #448a49); /* Green gradient */
    color: #ffffff !important; 
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    border: 1px solid #3e8048; /* Darker green border */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Slightly stronger shadow */
    flex-grow: 1; 
    font-size: 0.95em;
}

.campaign-card-actions .button.campaign-details-button {
    background-color: #6c757d; /* Grey for details button for contrast */
    background-image: linear-gradient(to bottom, #7a828a, #6c757d);
    border-color: #5a6268;
}


.campaign-card-actions .button:hover,
.campaign-card-actions a.button:hover,
.single-campaign .campaign-actions-single .button.campaign-participate-button:hover,
.mohabbat-popup-form .form-submit input[type="submit"]:hover {
    background-color: #3e8048; /* Darker green on hover */
    background-image: linear-gradient(to bottom, #4c9b58, #3a7041);
    border-color: #306737;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25); /* Stronger shadow on hover */
    transform: translateY(-1px);
}
.campaign-card-actions .button.campaign-details-button:hover {
    background-color: #5a6268; 
    background-image: linear-gradient(to bottom, #6c757d, #545b62);
    border-color: #4e555b;
}


/* Single Campaign Page Specific Styles */
.single-campaign .entry-title {
    text-align: center; /* وسط چین کردن تیتر */
    margin-bottom: 30px; /* فاصله بیشتر از پایین */
    font-size: 2.2em; /* اندازه فونت پایه برای تیتر */
}

.single-campaign .campaign-featured-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 8px;
}

.single-campaign .campaign-content {
}

.single-campaign .campaign-sidebar-details {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 30px;
}

.single-campaign .campaign-sidebar-details h3.widget-title {
    margin-top: 0;
    color: #343a40;
    font-size: 1.4em;
    margin-bottom: 20px;
    border-bottom: 2px solid #4c9b58;
    padding-bottom: 10px;
}

.single-campaign .campaign-sidebar-details .progress-bar-wrapper {
    height: 30px;
    margin-bottom: 8px;
}

.single-campaign .campaign-sidebar-details .progress-bar-fill {
    line-height: 30px;
    font-size: 1.1em;
}
.single-campaign .campaign-sidebar-details .progress-bar-text {
    font-size: 0.95em;
    margin-bottom: 20px;
}
.single-campaign .campaign-sidebar-details .progress-bar-text .collected,
.single-campaign .campaign-sidebar-details .progress-bar-text .target {
    display: block; 
    margin-bottom: 5px;
}

.single-campaign .campaign-actions-single {
    margin-top: 20px;
    text-align: center;
}

.single-campaign .campaign-actions-single .button.campaign-participate-button {
    padding: 12px 25px;
    font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mohabbat-campaigns-list-wrapper {
        grid-template-columns: 1fr; 
    }
    .campaign-card-actions {
        flex-direction: column; 
    }
    .single-campaign .site-content { 
        flex-direction: column;
    }
    .single-campaign .content-area {
        margin-right: 0;
        margin-bottom: 30px;
    }
    .single-campaign .entry-title {
        font-size: 1.8em; /* کوچکتر کردن تیتر در موبایل */
    }
}

/* Popup Styles */
.mohabbat-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.75);
    display: none; 
    align-items: center;
    justify-content: center; 
    z-index: 10000;
    padding: 15px;
    box-sizing: border-box;
}

.mohabbat-popup-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    margin-left: auto; 
    margin-right: auto; 
}

.mohabbat-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}
.mohabbat-popup-close:hover {
    color: #333;
}

.mohabbat-popup-content h3 {
    margin-top: 0;
    color: #4c9b58; /* New primary color */
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.mohabbat-popup-form .form-row {
    margin-bottom: 12px; 
}

.mohabbat-popup-form label {
    display: block;
    margin-bottom: 4px; 
    font-weight: bold;
    color: #444;
    font-size: 0.9em; 
}

.mohabbat-popup-form input[type="text"],
.mohabbat-popup-form input[type="tel"],
.mohabbat-popup-form input[type="number"],
.mohabbat-popup-form textarea {
    width: 100%;
    padding: 10px; 
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 0.9em; 
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mohabbat-popup-form input[type="text"]:focus,
.mohabbat-popup-form input[type="tel"]:focus,
.mohabbat-popup-form input[type="number"]:focus,
.mohabbat-popup-form textarea:focus {
    border-color: #4c9b58; 
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 155, 88, 0.25); 
}

.mohabbat-popup-form small {
    font-size: 0.75em; 
}

.mohabbat-popup-form textarea {
    min-height: 80px;
    resize: vertical;
}

.mohabbat-popup-form .anonymous-row label {
    display: inline-block;
    margin-left: 8px;
    font-weight: normal;
    color: #555;
}
.mohabbat-popup-form .anonymous-row input[type="checkbox"] {
    margin-right: 5px;
    vertical-align: middle;
    width: auto;
    transform: scale(1.1);
}


.mohabbat-popup-form input:disabled,
.mohabbat-popup-form textarea:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

#mohabbat-payment-processing-message {
    text-align: center;
    font-weight: bold;
    color: #4c9b58; 
    margin-top: 15px;
    display: none; 
}
#mohabbat-payment-processing-message .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(76, 155, 88, 0.3); 
    border-radius: 50%;
    border-top-color: #4c9b58; 
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mohabbat-thank-you-message {
    padding: 20px;
    background-color: #e6ffed; 
    border: 1px solid #a3d9b1; 
    color: #2d6a3d; 
    border-radius: 5px;
    text-align: center;
    margin-top: 20px;
}

.mohabbat-error-message {
    padding: 15px;
    background-color: #ffebee; 
    border: 1px solid #f44336; 
    color: #c62828; 
    border-radius: 5px;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* Thank You Popup Styles */
.mohabbat-thank-you-popup-overlay { 
}

.mohabbat-thank-you-popup-content {
    max-width: 450px; 
    text-align: center;
}

.mohabbat-thank-you-popup-content h3 { 
    color: #4CAF50; 
    font-size: 1.7em; 
    margin-bottom: 15px;
}

#mohabbat-thank-you-popup-message { 
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #333;
}

#mohabbat-thank-you-popup-message .ref-id {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: #555;
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 4px;
    font-size: 1em;
    border: 1px dashed #ccc;
}

/* More Responsive adjustments for popups and forms */
@media (max-width: 600px) { 
    .mohabbat-popup-overlay {
        justify-content: flex-start; 
        padding-left: 10px; 
        padding-right: 10px;
    }
    .mohabbat-popup-content {
        padding: 20px; 
        max-height: 95vh;
        margin-left: 0; 
        margin-right: auto; 
        max-width: 90%; 
    }
    .mohabbat-popup-content h3 {
        font-size: 1.3em; 
    }
     #mohabbat-thank-you-popup-content h3 {
        font-size: 1.4em; 
    }
    .mohabbat-popup-form label {
        font-size: 0.85em; 
        margin-bottom: 4px;
    }
    .mohabbat-popup-form input[type="text"],
    .mohabbat-popup-form input[type="tel"],
    .mohabbat-popup-form input[type="number"],
    .mohabbat-popup-form textarea,
    .mohabbat-popup-form .form-submit input[type="submit"] {
        font-size: 0.9em; 
        padding: 10px;
    }
    .mohabbat-popup-form small {
        font-size: 0.7em; 
    }
    #mohabbat-thank-you-popup-message {
        font-size: 0.95em;
    }
     #mohabbat-thank-you-popup-message .ref-id {
        font-size: 0.85em;
        padding: 8px;
    }
}

@media (max-width: 480px) { 
    .single-campaign .entry-title {
        font-size: 1.5em; 
    }
    .single-campaign .campaign-sidebar-details h3.widget-title {
        font-size: 1.2em;
    }
}

@media (max-width: 400px) {
    .mohabbat-popup-content {
        padding: 15px; 
        margin: 10px; 
        max-width: calc(100% - 20px);
    }
    .mohabbat-popup-content h3 {
        font-size: 1.2em; 
    }
    #mohabbat-thank-you-popup-content h3 { 
        font-size: 1.3em;
    }
     .mohabbat-popup-form input[type="text"],
    .mohabbat-popup-form input[type="tel"],
    .mohabbat-popup-form input[type="number"],
    .mohabbat-popup-form textarea,
    .mohabbat-popup-form .form-submit input[type="submit"] {
        font-size: 0.8em; 
    }
     .mohabbat-popup-form label {
        font-size: 0.8em; 
    }
}

.mohabbat-popup-content .required {
    color: red;
    font-weight: bold;
    margin-left: 2px;
}

/* Styles for Finished Campaigns */
.mohabbat-campaign-card.status-finished {
    position: relative;
    overflow: hidden; /* Ensures the overlay fits within the card boundaries */
}

.mohabbat-campaign-card.status-finished .campaign-card-image,
.mohabbat-campaign-card.status-finished .campaign-card-content {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.mohabbat-campaign-card.status-finished::after {
    content: 'پویش تمام شد';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    z-index: 10;
    text-align: center;
    pointer-events: none; /* Allows clicks to pass through if needed, though buttons will be disabled */
}

.mohabbat-campaign-card.status-finished .campaign-card-actions .button {
    background-color: #cccccc;
    background-image: none;
    border-color: #bbbbbb;
    color: #888888 !important;
    cursor: not-allowed;
    pointer-events: none; /* Disables all click events */
    box-shadow: none;
    transform: none;
}

.mohabbat-campaign-card.status-finished .campaign-card-actions .button:hover {
    background-color: #cccccc;
    border-color: #bbbbbb;
    box-shadow: none;
    transform: none;
}

/* Styles for Finished Single Campaign Page */
.single-campaign-article.status-finished {
    position: relative;
    opacity: 0.8;
}

.single-campaign-article.status-finished .campaign-main-content-wrapper {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.single-campaign-article.status-finished::after {
    content: 'این پویش تمام شده است';
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.5em;
    font-weight: bold;
    z-index: 10;
    text-align: center;
    pointer-events: none;
    width: 90%;
}

.single-campaign-article.status-finished .entry-title a,
.single-campaign-article.status-finished .campaign-actions-single .button {
    cursor: not-allowed;
    pointer-events: none;
}

.single-campaign-article.status-finished .campaign-actions-single .button {
    background-color: #cccccc;
    background-image: none;
    border-color: #bbbbbb;
    color: #888888 !important;
    box-shadow: none;
    transform: none;
}

.single-campaign-article.status-finished .campaign-actions-single .button:hover {
    background-color: #cccccc;
    border-color: #bbbbbb;
}

.single-campaign-article.status-finished .entry-title a:hover {
    color: inherit;
}
