/**
 * Campaign Page Styles - Masajid Style
 * Modern grid layout with quantity system and gift modal
 * 
 * @since 4.0.0
 */

/* ========================================
   CSS Variables - Current Color Scheme
   ======================================== */
:root {
    --primary-color: #6c2a5a;
    --secondary-color: #27ae60;
    --accent-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --background: #ffffff;
    --card-bg: #f8f9fa;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Main Container
   ======================================== */
.campaign-page-container.masajid-style {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    direction: rtl;
}

/* ========================================
   Main Grid Layout (Image Sidebar Right in RTL)
   ======================================== */
.campaign-main-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

@media (max-width: 1024px) {
    .campaign-main-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ========================================
   Image Sidebar (Right Column)
   ======================================== */
.campaign-image-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.featured-image-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.campaign-featured-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-image-container:hover .campaign-featured-image {
    transform: scale(1.02);
}

/* Share Icons Overlay on Image */
.share-icons-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.share-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.share-icon-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-icon-btn.facebook:hover {
    background: #1877f2;
    color: #fff;
}

.share-icon-btn.twitter:hover {
    background: #000;
    color: #fff;
}

.share-icon-btn.whatsapp:hover {
    background: #25d366;
    color: #fff;
}

/* Description Under Image */
.description-under-image {
    margin-top: 20px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.description-under-image .description-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.description-under-image .description-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-dark);
}

.description-under-image .description-content p {
    margin-bottom: 10px;
}

.description-under-image .description-content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1024px) {
    .campaign-image-sidebar {
        position: static;
        order: -1;
    }
}

/* ========================================
   Main Content Area
   ======================================== */
.campaign-main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ========================================
   Section Headings
   ======================================== */
.section-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
}

/* ========================================
   Donation Amounts Section
   ======================================== */
.donation-amounts-section {
    background: var(--background);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

/* Campaign Title in Donation Section */
.campaign-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 15px 0;
    text-align: center;
}

.amount-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

@media (max-width: 768px) {
    .amount-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .amount-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.amount-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 5px 10px !important;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amount-btn:hover {
    border-color: var(--primary-color);
    background: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.amount-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.amount-value {
    font-size: 16px;
    font-weight: 700;
    color: inherit;
}

.amount-desc {
    font-size: 11px;
    color: inherit;
    opacity: 0.85;
    text-align: center;
    line-height: 1.3;
}

.amount-btn.selected .amount-desc {
    opacity: 1;
}

.custom-amount-btn {
    background: linear-gradient(135deg, var(--primary-color), #8b3d75);
    border-color: var(--primary-color);
    color: #fff;
}

.custom-amount-btn:hover {
    background: linear-gradient(135deg, #5a2249, var(--primary-color));
}

/* ========================================
   Amount & Quantity Section
   ======================================== */
.amount-quantity-section {
    background: var(--background);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.amount-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.amount-input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.currency-prefix {
    padding: 12px 15px;
    background: rgba(108, 42, 90, 0.1);
    font-weight: 700;
    color: var(--primary-color);
    border-left: 1px solid var(--border-color);
}

.amount-input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
    background: transparent;
    outline: none;
    color: var(--text-dark);
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.qty-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: rgba(108, 42, 90, 0.1);
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.qty-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    background: transparent;
    color: var(--text-dark);
    outline: none;
}

/* Total Display */
.total-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(108, 42, 90, 0.05), rgba(108, 42, 90, 0.1));
    border-radius: 12px;
    border: 2px solid rgba(108, 42, 90, 0.2);
}

.total-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.total-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
}

/* ========================================
   Progress Section
   ======================================== */
.progress-section {
    background: var(--background);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.goal-progress-bar {
    width: 100%;
    height: 16px;
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), #2ecc71);
    border-radius: 20px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 10px;
}

.progress-percentage {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 0 8px;
}

.goal-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-value.raised {
    color: var(--secondary-color);
}

.stat-value.goal {
    color: var(--primary-color);
}

.stat-divider {
    width: 2px;
    height: 50px;
    background: var(--border-color);
    align-self: center;
}

/* ========================================
   Action Buttons
   ======================================== */
.action-buttons-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

@media (max-width: 640px) {
    .action-buttons-section {
        grid-template-columns: 1fr;
    }
}

.campaign-donate-btn,
.campaign-gift-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.campaign-donate-btn.primary-action {
    background: linear-gradient(135deg, var(--primary-color), #8b3d75);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.campaign-donate-btn.primary-action:hover {
    background: linear-gradient(135deg, #5a2249, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.campaign-gift-btn.secondary-action {
    background: var(--background);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.campaign-gift-btn.secondary-action:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    font-size: 22px;
}

/* ========================================
   Sidebar Details Card
   ======================================== */
.campaign-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.details-card {
    background: var(--background);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.detail-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-item:first-of-type {
    padding-top: 0;
}

.detail-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 42, 90, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
}

.detail-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.cost-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

.description-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 400;
}

.description-text p {
    margin-bottom: 10px;
}

.description-text p:last-child {
    margin-bottom: 0;
}

.description-item {
    flex-direction: column;
    gap: 10px;
}

.description-item .detail-icon {
    align-self: flex-start;
}

/* ========================================
   Campaign Info Section (New Layout)
   ======================================== */
.campaign-info-section {
    margin-bottom: 60px;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.campaign-info-section .section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-card {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--background);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.info-card .info-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(108, 42, 90, 0.1), rgba(108, 42, 90, 0.2));
    border-radius: 12px;
    flex-shrink: 0;
}

.info-card .info-content {
    flex: 1;
}

.info-card .info-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-card .info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.info-card .cost-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

.description-card {
    flex-direction: column;
    gap: 15px;
}

.description-card .info-icon {
    align-self: flex-start;
}

.description-card .description-text {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-dark);
}

.info-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .campaign-info-section {
        padding: 25px;
        margin-bottom: 40px;
    }

    .info-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-card {
        padding: 20px;
    }

    .info-card .info-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .info-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Gift Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-container {
    background: var(--background);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--card-bg);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-description {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 25px 0;
    line-height: 1.6;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: var(--card-bg);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 30px;
    border-top: 2px solid var(--border-color);
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #5a2249;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* ========================================
   Wide Image Section
   ======================================== */
.campaign-wide-image {
    margin: 60px 0;
}

.wide-image-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.wide-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Statistics Section
   ======================================== */
.campaign-statistics {
    margin: 60px 0;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 30px 0;
    text-align: center;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: var(--background);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 42, 90, 0.1);
    border-radius: 50%;
}

.stat-card .stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
}

/* ========================================
   Share Section
   ======================================== */
.campaign-share {
    margin: 60px 0;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 16px;
}

.share-container {
    text-align: center;
}

.share-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 25px 0;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.share-btn.facebook {
    background: #1877f2;
    color: #fff;
}

.share-btn.twitter {
    background: #000;
    color: #fff;
}

.share-btn.whatsapp {
    background: #25d366;
    color: #fff;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .campaign-page-container.masajid-style {
        padding: 20px 15px;
    }

    .section-heading {
        font-size: 20px;
    }

    .donation-amounts-section,
    .amount-quantity-section,
    .progress-section {
        padding: 20px;
    }

    .details-card {
        padding: 20px;
    }

    .campaign-sidebar {
        position: static;
    }

    .stat-card {
        padding: 20px;
    }

    .campaign-share {
        padding: 25px 20px;
    }
}