/* ==========================================================================
   1. FONTS & BASE TYPOGRAPHY
   ========================================================================== */

/* GLOBAL RESET - CRITICAL FOR LAYOUT */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Primary Font: Poppins (Headings, Buttons, Numbers) */
h1, h2, h3, h4, h5, h6,
.heading-font, .section-title, .featured-title, .campaign-title,
.btn, button, .raised, .campaign-count, .featured-badge, .pagination-number {
    font-family: "Poppins", sans-serif;
    letter-spacing: -0.01em;
}

/* Secondary Font: Lato (Body text, inputs, small UI) */
body, p, a, li, span, input, select, textarea, label,
.body-font, .section-desc, .featured-desc, .filters-label, .goal, .pagination-info {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Weight Tweaks */
.section-title, .campaign-title, .featured-title {
    font-weight: 700;
    color: #1e293b;
}

p {
    line-height: 1.7;
    color: #4b5563;
}

.btn { font-weight: 600; }

input::placeholder {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    color: #9ca3af;
}

/* ==========================================================================
   2. CAMPAIGN VIEW STYLES (CPV)
   ========================================================================== */

.cpv-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 40px;
    padding-bottom: 40px;
}

.cpv-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.cpv-back-button:hover {
    color: #4f46e5;
    transform: translateX(-4px);
}

.cpv-back-button i { font-size: 20px; }

h1.cpv-campaign-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 32px;
    color: #0f172a;
    line-height: 1.2;
}

.cpv-campaign-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 40px;
    grid-template-areas:
        "image details"
        "comments details";
}

.cpv-image-wrapper { grid-area: image; }
.cpv-comments-wrapper { grid-area: comments; }
.cpv-details-wrapper { grid-area: details; }

/* --- IMAGE ZOOM FIX: MAIN CAMPAIGN IMAGE --- */
.cpv-campaign-image img {
    width: 100%;
    /* Replaced fixed aspect-ratio 1/1 with auto height/width logic */
    height: auto;
    aspect-ratio: 16 / 9; /* Standard cinematic ratio prevents zooming/cropping */
    object-fit: cover;
    object-position: center; /* Centered is usually better than top */
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Right Side Details Box */
.cpv-campaign-details {
    background-color: white;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.cpv-campaign-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.cpv-raised-amount {
    font-size: 1.75rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: -0.02em;
}

.cpv-goal-info {
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
}

.cpv-action-buttons button {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cpv-btn-share {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.cpv-btn-share:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    transform: translateY(-2px);
}

.cpv-btn-donate {
    background-color: #4f46e5;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.cpv-btn-donate:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

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

/* Progress Bar */
.cpv-progress-bar-wrapper { margin-bottom: 32px; }

.cpv-progress-bar-bg {
    background-color: #f1f5f9;
    border-radius: 9999px;
    height: 12px;
    overflow: hidden;
}

.cpv-progress-bar-fill {
    background-color: #4f46e5;
    height: 12px;
    width: 42.7%;
    border-radius: 9999px;
    transition: width 1s ease-in-out;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

/* About Section */
.cpv-about-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #111827;
}

.cpv-about-section p {
    color: #4b5563;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

/* Organizer Box */
.cpv-organizer-box {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    border: 1px solid #e2e8f0;
}

.cpv-organizer-header {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: #334155;
}

.cpv-organizer-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.cpv-organizer-info img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cpv-organizer-info p { margin: 0; }

.cpv-organizer-info .cpv-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
}

.cpv-organizer-info .cpv-role {
    color: #64748b;
    font-size: 0.9rem;
}

.cpv-organizer-contact-btn {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: white;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.cpv-organizer-contact-btn:hover {
    background-color: white;
    border-color: #4f46e5;
    color: #4f46e5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Recent Donations (In Sidebar) */
.cpv-recent-donations { margin-top: 40px; }

.cpv-recent-donations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4f46e5;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.cpv-donation-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 12px;
    border-radius: 10px;
    cursor: default;
    transition: background-color 0.2s ease;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.cpv-donation-item:hover { background-color: #f8fafc; }
.cpv-donation-item:last-child { border-bottom: none; }

.cpv-donation-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cpv-donation-profile img {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    object-fit: cover;
    border: 1px solid #f1f5f9;
}

.cpv-donor-name {
    font-weight: 600;
    color: #334155;
}

.cpv-donation-label {
    font-size: 0.85rem;
    color: #94a3b8;
}

.cpv-donation-amount {
    font-weight: 700;
    color: #4f46e5;
}

/* Comments Section */
.cpv-comments-section {
    background-color: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.cpv-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}

.cpv-comments-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

/* Shared Report Button Style */
.cpv-report-button {
    background: none;
    border: none;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.cpv-report-button:hover {
    color: #b91c1c;
    background-color: #fef2f2;
}

.cpv-report-button i { font-size: 18px; }

.cpv-comment-form textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    color: #334155;
    margin-bottom: 16px;
    padding: 16px;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.cpv-comment-form textarea:focus {
    border-color: #4f46e5;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.cpv-comment-form textarea:hover { border-color: #cbd5e1; }

.cpv-comment-form button {
    background-color: #4f46e5;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.cpv-comment-form button:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

.cpv-comment-list .cpv-comment {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.cpv-comment-list .cpv-comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cpv-comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.cpv-comment-author img {
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cpv-comment-author-info {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.05rem;
}

.cpv-comment-author-date {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 400;
}

.cpv-comment-text {
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
    margin-left: 56px;
}

.cpv-show-more-comments {
    background: none;
    border: 1px solid transparent;
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 0;
    width: 100%;
    border-radius: 8px;
    transition: all 0.2s;
}

.cpv-show-more-comments:hover {
    background-color: #eff6ff;
    text-decoration: none;
}

.donor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.donor-avatar i {
    font-size: 18px;
    color: #4f46e5;
}

/* Updates Section Styles */
.cpv-updates-wrapper { grid-area: comments; }

.cpv-updates-section {
    background-color: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    margin-bottom: 32px;
}

.cpv-updates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 16px;
}

.cpv-updates-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
}

.cpv-update-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 28px;
    margin-bottom: 28px;
}

.cpv-update-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cpv-update-header { margin-bottom: 18px; }

.cpv-update-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cpv-update-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cpv-update-author-info {
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpv-update-organizer-badge {
    background-color: #e0e7ff;
    color: #4338ca;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cpv-update-date {
    font-size: 0.85rem;
    color: #64748b;
    margin: 4px 0 0 0;
}

.cpv-update-text {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.cpv-update-image { margin-bottom: 20px; }

/* --- IMAGE ZOOM FIX: UPDATE IMAGES --- */
.cpv-update-image img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* REMOVED FIXED HEIGHTS THAT CAUSED ZOOMING */
    height: auto;
    aspect-ratio: 16 / 9; /* Standard landscape prevents cropping strips */
}

.cpv-see-more-updates {
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    padding: 14px 0;
    border-radius: 10px;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.cpv-see-more-updates:hover {
    background-color: #f8fafc;
    border-color: #4f46e5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   3. DONATION & MODAL STYLES (COMPACT / NO SCROLL)
   ========================================================================== */

/* Overlay background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

/* Modal box - FLEXIBLE HEIGHT */
.modal-content {
    background: #ffffff;
    padding: 2rem; 
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 450px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.8);
    max-height: 70%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Webkit Scrollbar Styling for Modal */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    background: #f8fafc;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #ef4444;
    background: #fee2e2;
    transform: rotate(90deg);
}

/* Title - Reduced Margins */
.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    text-align: center;
    flex-shrink: 0;
}

/* QR Wrapper - RESPONSIVE SIZE */
.qr-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    flex-shrink: 1; 
    min-height: 0;
}

.qr-image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 25vh; 
    object-fit: contain;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* GCash Number - Compact */
.gcash-number-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.gcash-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: 0.5px;
}

.copy-icon {
    padding: 6px;
    font-size: 1rem;
    border-radius: 6px;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    color: #4f46e5;
    transition: all 0.2s ease-in-out;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.copy-icon:hover {
    border-color: #4f46e5;
    background-color: #e0e7ff;
}

.copy-icon.copied {
    color: #10b981;
    border-color: #10b981;
    background-color: #ecfdf5;
}

/* Donation Note */
.donation-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    text-align: center;
    font-style: italic;
    background: #f1f5f9;
    padding: 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Inputs - Compact */
.modal-content label {
    margin-bottom: 4px;
    font-size: 0.9rem;
    display: block;
    font-weight: 600;
    color: #334155;
}

.modal-content input[type="number"],
.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: #fcfcfc;
}

.modal-content input:focus {
    border-color: #4f46e5;
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.modal-content input[type="file"] {
    padding: 16px;
    font-size: 0.9rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    cursor: pointer;
    text-align: center;
    color: #64748b;
}

.modal-content input[type="file"]:hover {
    border-color: #4f46e5;
    background-color: #e0e7ff;
}

/* Buttons */
.donation-next-btn {
    display: block;
    background-color: #4f46e5;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin: 0 auto;
    width: 100%;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
    transition: all 0.2s ease;
}

.donation-next-btn:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.5);
}

.donation-submit-btn {
    width: 100%;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 4px;
    background: #4f46e5;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

.donation-submit-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.donation-submit-btn:disabled {
    background-color: #cbd5e1 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

.back-to-qr-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.back-to-qr-btn:hover {
    color: #4f46e5;
    background: #e0e7ff;
}

/* Reference Error Position */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.reference-input-container {
    position: relative;
    margin-bottom: 12px;
}

.reference-error {
    color: #ef4444;
    display: none;
    font-size: 0.75rem;
    position: absolute;
    top: -20px;
    right: 0;
    padding: 2px 8px;
    background: #fee2e2;
    border-radius: 4px;
    z-index: 1;
    white-space: nowrap;
    font-weight: 600;
}

/* All Donations Modal (The List View) */
.all-donations-modal {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.donations-list-container {
    flex: 1;
    overflow-y: auto;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    background-color: #fcfcfc;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.donation-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.donation-modal-item:hover { background-color: #fff; }
.donation-modal-item:last-child { border-bottom: none; }

.donation-modal-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.donation-modal-info {
    display: flex;
    flex-direction: column;
}

.donation-modal-name {
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    font-size: 0.95rem;
}

.donation-modal-date {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 4px 0 0 0;
}

.donation-modal-amount {
    font-weight: 700;
    color: #4f46e5;
    font-size: 1rem;
}

.no-donations-message {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.no-donations-message i {
    font-size: 56px;
    margin-bottom: 20px;
    color: #e2e8f0;
}

.no-donations-message p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.donations-summary {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background-color: #f1f5f9;
    border-radius: 12px;
    margin-top: auto;
    border: 1px solid #e2e8f0;
}

.donations-summary p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.donations-summary strong {
    color: #1e293b;
    font-size: 1.05rem;
}


/* ==========================================================================
   4. MEDIA QUERIES
   ========================================================================== */

/* --- MODAL SPECIFIC QUERIES (NO SCROLL LOGIC) --- */

/* Mobile Phones (Portrait) */
@media (max-width: 480px) {
    .modal-content {
        width: 80%;
        padding: 1.25rem;
        max-height: 100%;
    }

    .modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
        margin-top: 0.5rem;
    }

    .qr-image {
        max-height: 20vh; 
        max-width: 180px;
    }

    .gcash-number-container {
        padding: 8px 12px;
        margin-bottom: 0.75rem;
    }

    .donation-note {
        font-size: 0.75rem;
        margin-bottom: 1rem;
        padding: 6px;
    }

    .donation-next-btn { padding: 0.75rem 1rem; }
    .modal-close { top: 10px; right: 10px; }
}

/* Mobile (Landscape) - Very short vertical height */
@media (max-height: 500px) {
    .modal-content {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 500px;
        align-items: flex-start;
        padding: 1rem;
        overflow-y: auto;
    }
    
    .qr-wrapper {
        width: 40%;
        margin-right: 10px;
    }
    
    .donation-next-btn { width: 100%; }
}


/* --- CAMPAIGN VIEW (CPV) RESPONSIVENESS --- */

/* Tablet (Small Desktop/Large Tablet) */
@media only screen and (min-width: 1024px) and (max-width: 1235px) {
    .cpv-container {
        max-width: 96vw;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Tablet (Standard) */
@media only screen and (min-width: 768px) and (max-width: 1023px) {
    .cpv-container {
        max-width: 96vw;
        padding-left: 24px;
        padding-right: 24px;
        padding-top: 20px;
    }

    main { padding: 32px 0; }

    h1.cpv-campaign-title {
        font-size: 2rem;
        margin-bottom: 32px;
        text-align: left;
    }

    .cpv-campaign-grid {
        display: grid;
        grid-template-columns: 1.1fr 1.7fr;
        gap: 32px;
    }

    .cpv-image-wrapper,
    .cpv-details-wrapper,
    .cpv-comments-wrapper {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* --- IMAGE ZOOM FIX: TABLET --- */
    .cpv-campaign-image img {
        /* Removed conflicting min/max heights */
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: 12px;
        margin-bottom: 24px;
    }

    .cpv-campaign-details,
    .cpv-comments-section {
        padding: 24px;
        border-radius: 12px;
        margin-bottom: 24px;
    }

    .cpv-campaign-stats {
        flex-direction: row;
        align-items: center;
        gap: 20px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .cpv-action-buttons { gap: 12px; }

    .cpv-action-buttons button {
        min-width: 110px;
        padding: 12px 0;
        font-size: 1rem;
    }

    .cpv-progress-bar-wrapper { margin-bottom: 28px; }
    .cpv-about-section h2 { font-size: 1.25rem; }

    .cpv-organizer-box {
        padding: 20px;
        border-radius: 10px;
        margin-top: 24px;
    }

    .cpv-organizer-info { gap: 14px; }
    .cpv-organizer-info img { width: 48px; height: 48px; }
    .cpv-organizer-contact-btn { font-size: 1rem; padding: 10px; }
    .cpv-recent-donations { margin-top: 36px; }
    .cpv-donation-item { padding: 12px; border-radius: 8px; }
    .cpv-donation-profile img { width: 38px; height: 38px; }
    .cpv-comments-wrapper { margin-top: 0; max-width: 100%; }
    .cpv-comments-header h2 { font-size: 1.2rem; }
    .cpv-report-button i { font-size: 20px; }
    .cpv-comment-form textarea { font-size: 1rem; border-radius: 10px; padding: 12px; }

    .cpv-comment-form button {
        width: 100%;
        font-size: 1rem;
        padding: 12px 0;
        margin-top: 8px;
    }

    .cpv-comment-list .cpv-comment { padding-bottom: 16px; margin-bottom: 16px; }
    .cpv-comment-author img { width: 36px; height: 36px; }
    .cpv-show-more-comments { width: 100%; font-size: 1rem; padding: 12px 0; }
}

/* ================== MOBILE (Consolidated) ================== */
@media only screen and (max-width: 767px) {

    .cpv-updates-section { padding: 20px; }

    .cpv-updates-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cpv-update-author img { width: 42px; height: 42px; }

    .cpv-container {
        padding-top: 100px;
        padding-left: 20px;
        padding-right: 20px;
        max-width: 100%;
    }

    main { padding: 20px 0; }

    h1.cpv-campaign-title {
        font-size: 1.5rem;
        margin-bottom: 24px;
        margin-top: 10px;
        text-align: left;
        word-break: break-word;
        line-height: 1.3;
    }

    .cpv-campaign-grid {
        display: block;
        grid-template-columns: none;
        gap: 0;
    }

    .cpv-image-wrapper,
    .cpv-details-wrapper,
    .cpv-comments-wrapper {
        width: 100%;
        margin: 0 auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* --- IMAGE ZOOM FIX: MOBILE --- */
    .cpv-campaign-image img {
        aspect-ratio: 16/9;
        /* Removed strict pixel heights that forced zooming */
        height: auto; 
        width: 100%;
        margin-bottom: 24px;
        border-radius: 12px;
        box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.1);
    }

    .cpv-campaign-details,
    .cpv-comments-section {
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        margin-bottom: 24px;
        border: 1px solid #f3f4f6;
    }

    .cpv-campaign-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 24px;
    }

    .cpv-action-buttons {
        width: 100%;
        display: flex;
        gap: 12px;
    }

    .cpv-action-buttons button {
        width: 100%;
        padding: 12px 0;
        font-size: 1rem;
    }

    .cpv-progress-bar-wrapper { margin-bottom: 24px; }
    .cpv-about-section h2 { font-size: 1.2rem; }
    .cpv-organizer-box { padding: 20px; border-radius: 12px; margin-top: 24px; }
    .cpv-organizer-info { gap: 12px; }
    .cpv-organizer-info img { width: 42px; height: 42px; }
    .cpv-organizer-contact-btn { font-size: 1rem; padding: 10px; }
    .cpv-recent-donations { margin-top: 32px; }
    .cpv-donation-item { padding: 10px; border-radius: 8px; }
    .cpv-donation-profile img { width: 36px; height: 36px; }
    .cpv-comments-wrapper { margin-top: 0; max-width: 100%; }
    .cpv-comments-header h2 { font-size: 1.2rem; }
    .cpv-report-button i { font-size: 19px; }
    .cpv-comment-form textarea { font-size: 1rem; border-radius: 10px; padding: 10px; }

    .cpv-comment-form button {
        width: 100%;
        font-size: 1rem;
        padding: 12px 0;
        margin-top: 6px;
    }

    .cpv-comment-list .cpv-comment { padding-bottom: 16px; margin-bottom: 16px; }
    .cpv-comment-author img { width: 36px; height: 36px; }
    .cpv-comment-text { margin-left: 0; margin-top: 8px; }
    .cpv-show-more-comments { width: 100%; font-size: 1rem; padding: 12px 0; }
}

/* Tablet & Landscape Modal Adjustments */
@media only screen and (min-width: 481px) and (max-width: 1023px) {
    .modal-content {
        max-width: 80%;
        max-height: 70vh;
        padding: 2.5rem;
    }
}

/* Very Small Screens & Modal Adjustments */
@media (max-width: 480px) {
    .modal-content {
        max-width: 80%;
        padding: 1.5rem;
        max-height: 70vh;
    }

    .qr-image { width: 200px; height: 200px; }
    
    .gcash-number-container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .modal-close { top: 5px; right: 5px; }
    .modal-close:hover {
        color: #ef4444;
        background: #fee2e2;
        transform: rotate(90deg);
    }
}

/* ==========================================================================
   MODAL OVERLAY Z-INDEX HIERARCHY
   ========================================================================== */

#imageModal.modal-overlay { z-index: 10001; }
#allUpdatesModal.modal-overlay { z-index: 10000; }

/* ==========================================================================
   UPDATE IMAGE CAROUSEL STYLES
   ========================================================================== */

.cpv-update-images {
    position: relative;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.cpv-update-images-carousel {
    display: flex;
    transition: transform 0.3s ease;
}

.cpv-update-image {
    flex: 0 0 100%;
    min-width: 100%;
    cursor: pointer;
}

.cpv-update-image img:hover { transform: scale(1.02); }

/* Carousel Navigation */
.cpv-carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    transform: translateY(-50%);
    pointer-events: none;
}

.cpv-carousel-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    pointer-events: all;
    color: #4b5563;
    font-size: 14px;
}

.cpv-carousel-btn:hover {
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: #4f46e5;
}

.cpv-carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Single image state - no carousel */
.cpv-update-images.single-image .cpv-carousel-nav { display: none; }

/* Fixed "Zooming" in single update images */
.cpv-update-images.single-image .cpv-update-image img {
    height: auto;
    aspect-ratio: 16/9;
}

/* ==========================================================================
   ALL UPDATES MODAL STYLES
   ========================================================================== */

.all-updates-modal {
    max-width: 600px;
    max-height: 70vh;
    width: 85%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.all-updates-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 15px;
}

.all-updates-container .cpv-update-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    background: #fafbfc;
}

.all-updates-container .cpv-update-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.all-updates-container .cpv-update-header { margin-bottom: 12px; }
.all-updates-container .cpv-update-author img { width: 40px; height: 40px; }
.all-updates-container .cpv-update-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.all-updates-container .cpv-update-images { margin-top: 10px; }

/* Make modal images the same as regular images but slightly smaller */
.all-updates-container .cpv-update-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
    /* Removed max-height that caused zoomed strips */
    aspect-ratio: 16/9;
    transition: transform 0.2s ease;
}

/* Carousel buttons in modal - same size as regular */
.all-updates-container .cpv-carousel-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* Scrollbar styling for the updates container */
.all-updates-container::-webkit-scrollbar { width: 4px; }
.all-updates-container::-webkit-scrollbar-track { background: #f8fafc; border-radius: 2px; }
.all-updates-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.all-updates-container::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================================================
   IMAGE MODAL STYLES
   ========================================================================== */

.image-modal {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    background: transparent;
    box-shadow: none;
    border: none;
}

.image-modal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.image-modal-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal .modal-close {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10002;
}

.image-modal .modal-close:hover { background: rgba(0, 0, 0, 0.9); }

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

/* Tablet and Mobile */
@media only screen and (max-width: 767px) {

    /* All Updates Modal Mobile */
    .all-updates-modal {
        max-width: 95%;
        max-height: 80vh;
        width: 95%;
        padding: 1rem;
        margin: 20px;
    }

    .all-updates-container .cpv-update-item {
        padding: 12px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .all-updates-container .cpv-carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Image Modal Mobile */
    .image-modal {
        max-width: 95%;
        max-height: 85vh;
    }

    /* Regular Carousel Mobile */
    .cpv-carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .cpv-carousel-nav { padding: 0 6px; }

    /* Fix Zooming on Mobile Updates */
    .cpv-update-image img {
        height: auto;
        aspect-ratio: 16/9;
    }

    .cpv-update-images.single-image .cpv-update-image img {
        height: auto;
        aspect-ratio: 16/9;
    }
}