/**
 * Donation Page Styles
 * Extracted from darowizna.php for maintainability
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

.donation-hero {
    background: var(--fos-gradient-beige);
    color: var(--fos-black);
    padding: 60px 0;
}

/* ==========================================================================
   Donation Form Card
   ========================================================================== */

.donation-form-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    z-index: 90;
    position: relative;
}

.donation-form-card .card-body {
    padding: 20px;
}

.donation-form-card .card-header {
    background-color: var(--fos-beige) !important;
    border-bottom: 2px solid var(--fos-cherry) !important;
}

.donation-form-card .card-header h5 {
    color: var(--fos-cherry) !important;
}

/* ==========================================================================
   Form Sections - Progressive Disclosure
   ========================================================================== */

.form-section {
    background: var(--fos-beige);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.form-section.hidden-section {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-15px);
    pointer-events: none;
}

.form-section.visible-section {
    max-height: 2000px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fos-gray);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Gradients - Warm beige tones */
.form-section.amount-section {
    background: linear-gradient(135deg, var(--fos-cream) 0%, var(--fos-beige-dark) 100%);
}

.form-section.personal-section {
    background: linear-gradient(135deg, var(--fos-beige-light) 0%, var(--fos-beige-dark) 100%);
}

.form-section.payment-type-section {
    background: linear-gradient(135deg, var(--fos-beige-light) 0%, var(--fos-beige-dark) 100%);
}

.form-section.public-section {
    background: linear-gradient(135deg, var(--fos-beige-light) 0%, var(--fos-beige-dark) 100%);
}

.form-section.foundation-section {
    background: linear-gradient(135deg, var(--fos-beige-light) 0%, var(--fos-beige-dark) 100%);
}

.form-section.terms-section {
    background: var(--fos-beige-light);
}

/* ==========================================================================
   Amount Display & Slider
   ========================================================================== */

.amount-display {
    font-size: 2em;
    font-weight: 700;
    color: var(--fos-cherry);
    text-align: center;
    margin: 12px 0;
}

.amount-slider {
    margin: 16px 0;
}

/* Cherry slider styling */
.form-range::-webkit-slider-thumb {
    background: var(--fos-cherry) !important;
}

.form-range::-moz-range-thumb {
    background: var(--fos-cherry) !important;
}

.form-range::-webkit-slider-track {
    background: linear-gradient(to right, var(--fos-cherry) 0%, var(--fos-cherry) var(--value), var(--fos-beige-dark) var(--value), var(--fos-beige-dark) 100%) !important;
}

/* ==========================================================================
   Quick Amount Buttons
   ========================================================================== */

.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    justify-content: center;
}

.quick-amounts .quick-amount-btn {
    flex: 0 0 calc(33.333% - 6px);
    max-width: calc(33.333% - 6px);
}

.quick-amounts .quick-amount-btn:nth-child(4),
.quick-amounts .quick-amount-btn:nth-child(5) {
    flex: 0 0 calc(33.333% - 6px);
    max-width: calc(33.333% - 6px);
}

.quick-amount-btn {
    border: 1.5px solid var(--fos-cherry);
    background: var(--fos-white);
    color: var(--fos-cherry);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px !important;
}

.quick-amount-btn:hover,
.quick-amount-btn.active {
    background: var(--fos-cherry);
    color: var(--fos-white);
    transform: translateY(-1px);
}

/* ==========================================================================
   Foundation Amount Buttons
   ========================================================================== */

.foundation-amount-btn {
    border: 1.5px solid var(--fos-amber);
    background: var(--fos-white);
    color: var(--fos-amber);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.foundation-amount-btn:hover,
.foundation-amount-btn.active {
    background: var(--fos-amber);
    color: var(--fos-white);
    transform: translateY(-1px);
}

/* ==========================================================================
   Material Design Floating Labels
   ========================================================================== */

.material-input-group {
    position: relative;
    margin-bottom: 20px;
}

.material-input-group input,
.material-input-group textarea {
    width: 100%;
    padding: 16px 12px 8px 12px;
    border: 1.5px solid var(--fos-border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--fos-white);
    transition: all 0.2s ease;
    outline: none;
}

.material-input-group label {
    position: absolute;
    left: 12px;
    top: 16px;
    color: var(--fos-gray);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 4px;
}

/* Floated label when input has value */
.material-input-group input:focus + label,
.material-input-group input:not(:placeholder-shown) + label,
.material-input-group input.has-value + label,
.material-input-group textarea:focus + label,
.material-input-group textarea:not(:placeholder-shown) + label,
.material-input-group textarea.has-value + label {
    top: -10px;
    left: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--fos-white);
    line-height: 25px;
}

.material-input-group input.has-value,
.material-input-group textarea.has-value,
.material-input-group input:focus,
.material-input-group textarea:focus {
    padding-top: 20px;
    padding-bottom: 8px;
}

.material-input-group .input-hint {
    font-size: 0.75rem;
    color: var(--fos-gray);
    margin-top: 4px;
    padding-left: 12px;
}

.material-input-group textarea {
    min-height: 60px;
    resize: vertical;
}

/* Section-specific focus colors - Amount (Cherry) */
.amount-section .material-input-group input:focus,
.amount-section .material-input-group textarea:focus {
    border-color: var(--fos-cherry);
    box-shadow: 0 0 0 3px rgba(var(--fos-cherry-rgb), 0.1);
}

.amount-section .material-input-group input:focus + label,
.amount-section .material-input-group input:not(:placeholder-shown) + label,
.amount-section .material-input-group input.has-value + label,
.amount-section .material-input-group textarea:focus + label,
.amount-section .material-input-group textarea:not(:placeholder-shown) + label,
.amount-section .material-input-group textarea.has-value + label {
    color: var(--fos-cherry);
}

/* Section-specific focus colors - Personal (Cherry light) */
.personal-section .material-input-group input:focus,
.personal-section .material-input-group textarea:focus {
    border-color: var(--fos-cherry-light);
    box-shadow: 0 0 0 3px rgba(var(--fos-cherry-rgb), 0.1);
}

.personal-section .material-input-group input:focus + label,
.personal-section .material-input-group input:not(:placeholder-shown) + label,
.personal-section .material-input-group input.has-value + label,
.personal-section .material-input-group textarea:focus + label,
.personal-section .material-input-group textarea:not(:placeholder-shown) + label,
.personal-section .material-input-group textarea.has-value + label {
    color: var(--fos-cherry-light);
}

/* Section-specific focus colors - Payment Type (Cherry light) */
.payment-type-section .material-input-group input:focus,
.payment-type-section .material-input-group textarea:focus {
    border-color: var(--fos-cherry-light);
    box-shadow: 0 0 0 3px rgba(var(--fos-cherry-rgb), 0.1);
}

.payment-type-section .material-input-group input:focus + label,
.payment-type-section .material-input-group input:not(:placeholder-shown) + label,
.payment-type-section .material-input-group input.has-value + label,
.payment-type-section .material-input-group textarea:focus + label,
.payment-type-section .material-input-group textarea:not(:placeholder-shown) + label,
.payment-type-section .material-input-group textarea.has-value + label {
    color: var(--fos-cherry-light);
}

/* Section-specific focus colors - Public (Green) */
.public-section .material-input-group input:focus,
.public-section .material-input-group textarea:focus {
    border-color: var(--fos-green);
    box-shadow: 0 0 0 3px rgba(var(--fos-green-rgb), 0.1);
}

.public-section .material-input-group input:focus + label,
.public-section .material-input-group input:not(:placeholder-shown) + label,
.public-section .material-input-group input.has-value + label,
.public-section .material-input-group textarea:focus + label,
.public-section .material-input-group textarea:not(:placeholder-shown) + label,
.public-section .material-input-group textarea.has-value + label {
    color: var(--fos-green);
}

/* Section-specific focus colors - Foundation (Amber) */
.foundation-section .material-input-group input:focus,
.foundation-section .material-input-group textarea:focus {
    border-color: var(--fos-amber);
    box-shadow: 0 0 0 3px rgba(var(--fos-amber-rgb, 200, 127, 65), 0.1);
}

.foundation-section .material-input-group input:focus + label,
.foundation-section .material-input-group input:not(:placeholder-shown) + label,
.foundation-section .material-input-group input.has-value + label,
.foundation-section .material-input-group textarea:focus + label,
.foundation-section .material-input-group textarea:not(:placeholder-shown) + label,
.foundation-section .material-input-group textarea.has-value + label {
    color: var(--fos-amber);
}

/* ==========================================================================
   Payment Type Toggle
   ========================================================================== */

.payment-type-toggle {
    margin-bottom: 0;
}

.payment-type-toggle .btn-group {
    display: flex;
    width: 100%;
}

.payment-type-toggle .btn-group .btn {
    flex: 1;
    border-radius: 0;
    margin-bottom: 0 !important;
    white-space: normal;
    line-height: 1.3;
}

.payment-type-toggle .btn-group .btn:first-of-type {
    border-radius: 6px 0 0 6px;
}

.payment-type-toggle .btn-group .btn:last-of-type {
    border-radius: 0 6px 6px 0;
}

.payment-type-toggle .btn-check:checked + .btn-outline-primary {
    background-color: var(--fos-cherry);
    border-color: var(--fos-cherry);
    color: var(--fos-white);
}

.payment-type-toggle .btn-outline-primary {
    border-color: var(--fos-cherry);
    color: var(--fos-cherry);
}

.payment-type-toggle .btn-outline-primary:hover {
    background-color: var(--fos-cherry);
    border-color: var(--fos-cherry);
    color: var(--fos-white);
}

.payment-type-toggle .btn i {
    margin-right: 4px;
}

.recurring-info {
    background: rgba(var(--fos-green-rgb), 0.1);
    border: 1px solid var(--fos-green);
    border-radius: 6px;
}

.recurring-info i {
    color: var(--fos-green);
}

/* ==========================================================================
   Terms Checkbox
   ========================================================================== */

.terms-acceptance {
    transition: all 0.2s ease;
}

.terms-acceptance:hover {
    opacity: 0.9;
}

.terms-checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
    margin: 0;
}

.terms-checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--fos-white);
    border: 2px solid var(--fos-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.custom-checkbox i {
    color: var(--fos-white);
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.terms-checkbox-container input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--fos-gradient-cherry);
    border-color: var(--fos-cherry);
}

.terms-checkbox-container input[type="checkbox"]:checked + .custom-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.terms-checkbox-container:hover .custom-checkbox {
    border-color: var(--fos-cherry);
}

.terms-checkbox-container input[type="checkbox"]:focus + .custom-checkbox {
    box-shadow: 0 0 0 3px rgba(var(--fos-cherry-rgb), 0.25);
}

.terms-text {
    color: var(--fos-gray);
    line-height: 1.4;
}

.terms-text a {
    color: var(--fos-cherry);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--fos-cherry);
    transition: all 0.2s ease;
}

.terms-text a:hover {
    color: var(--fos-cherry-dark);
    border-bottom-style: solid;
}

/* ==========================================================================
   Donate Buttons
   ========================================================================== */

.donate-btn {
    background: var(--fos-gradient-cherry);
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 15px !important;
}

.donate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--fos-cherry-rgb), 0.3);
}

.donate-btn.recurring-mode {
    background: linear-gradient(45deg, var(--fos-green) 0%, var(--fos-green-light) 100%) !important;
    font-size: 1rem;
}

.donate-btn.recurring-mode:hover {
    box-shadow: 0 5px 15px rgba(var(--fos-green-rgb), 0.4) !important;
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.progress-info {
    background: var(--fos-beige);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
}

.progress-info h4 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.progress-info small {
    font-size: 0.9rem;
    color: var(--fos-gray);
}

.progress-info .progress {
    background-color: #e9e4dc;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-custom {
    background: var(--fos-cherry);
    border-radius: 10px;
}

/* ==========================================================================
   Cause Image & Description
   ========================================================================== */

.cause-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 15px;
    background: var(--fos-beige);
}

.description-content {
    line-height: 1.6;
}

.description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.description-content p {
    margin-bottom: 15px;
}

.description-content ul,
.description-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

/* ==========================================================================
   Past Donations Section
   ========================================================================== */

.past-donations-section {
    background: var(--fos-white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.past-donations-section h4 {
    color: var(--fos-black);
    font-weight: 600;
}

.past-donations-section h4 i {
    margin-right: 8px;
}

.donation-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.donation-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(var(--fos-cherry-rgb), 0.15);
}

.donor-name {
    color: var(--fos-black);
    font-size: 1rem;
}

.donation-amount .badge {
    font-weight: 600;
    padding: 8px 12px;
}

.donor-message {
    font-size: 0.9rem;
    line-height: 1.5;
}

.donor-message .fa-quote-left,
.donor-message .fa-quote-right {
    opacity: 0.4;
    font-size: 0.7rem;
}

.sort-buttons .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
}

.sort-buttons .btn i {
    margin-right: 4px;
}

.past-donors-list {
    padding: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.past-donors-list::-webkit-scrollbar {
    width: 6px;
}

.past-donors-list::-webkit-scrollbar-track {
    background: var(--fos-beige-light);
    border-radius: 3px;
}

.past-donors-list::-webkit-scrollbar-thumb {
    background: var(--fos-cherry);
    border-radius: 3px;
}

.past-donors-list::-webkit-scrollbar-thumb:hover {
    background: var(--fos-cherry-dark);
}

/* ==========================================================================
   Utility Overrides
   ========================================================================== */

.sticky-top {
    z-index: 90 !important;
}

.card-header h5 {
    color: var(--fos-cherry) !important;
}

.btn {
    margin-bottom: 15px !important;
}

.btn-primary,
.btn-outline-primary {
    margin-bottom: 15px !important;
}

.btn i,
h5 i {
    margin-right: 8px;
}

.fa-shield-alt {
    margin-right: 4px;
}

/* ==========================================================================
   Browser Autofill Detection
   ========================================================================== */

/* Chrome/Safari autofill detection animation */
@keyframes onAutoFillStart {
    from { /* empty */ }
    to { /* empty */ }
}

@keyframes onAutoFillCancel {
    from { /* empty */ }
    to { /* empty */ }
}

/* Apply animation to inputs so we can detect autofill via JS */
.material-input-group input:-webkit-autofill {
    animation-name: onAutoFillStart;
    animation-duration: 0.001s;
}

.material-input-group input:not(:-webkit-autofill) {
    animation-name: onAutoFillCancel;
    animation-duration: 0.001s;
}

/* ==========================================================================
   Custom Color Utility Classes (replacing Bootstrap color utilities)
   ========================================================================== */

/* Text colors */
.fos-text-cherry { color: var(--fos-cherry) !important; }
.fos-text-cherry-dark { color: var(--fos-cherry-dark) !important; }
.fos-text-white { color: var(--fos-white) !important; }
.fos-text-black { color: var(--fos-black) !important; }
.fos-text-gray { color: var(--fos-gray) !important; }
.fos-text-muted { color: var(--fos-gray-light) !important; }
.fos-text-success { color: var(--fos-green) !important; }
.fos-text-warning { color: var(--fos-gold) !important; }
.fos-text-amber { color: var(--fos-amber) !important; }
.fos-text-primary { color: var(--fos-cherry) !important; }
.fos-text-danger { color: var(--fos-cherry) !important; }

/* Background colors */
.fos-bg-cherry { background-color: var(--fos-cherry) !important; }
.fos-bg-cherry-dark { background-color: var(--fos-cherry-dark) !important; }
.fos-bg-beige { background-color: var(--fos-beige) !important; }
.fos-bg-beige-light { background-color: var(--fos-beige-light) !important; }
.fos-bg-beige-dark { background-color: var(--fos-beige-dark) !important; }
.fos-bg-white { background-color: var(--fos-white) !important; }
.fos-bg-success { background-color: var(--fos-green) !important; }
.fos-bg-warning { background-color: var(--fos-gold) !important; }

/* Badge variants */
.badge.fos-badge-cherry {
    background: var(--fos-gradient-cherry) !important;
    color: var(--fos-white) !important;
}
.badge.fos-badge-success {
    background: linear-gradient(135deg, var(--fos-green), var(--fos-green-light)) !important;
    color: var(--fos-white) !important;
}
.badge.fos-badge-warning {
    background: linear-gradient(135deg, var(--fos-gold), var(--fos-amber)) !important;
    color: var(--fos-black) !important;
}

/* Button variants */
.btn-cherry {
    background: var(--fos-gradient-cherry) !important;
    border: none !important;
    color: var(--fos-white) !important;
}
.btn-cherry:hover {
    background: var(--fos-cherry-dark) !important;
    color: var(--fos-white) !important;
}
.btn-outline-cherry {
    background: transparent !important;
    border: 1.5px solid var(--fos-cherry) !important;
    color: var(--fos-cherry) !important;
}
.btn-outline-cherry:hover {
    background: var(--fos-cherry) !important;
    color: var(--fos-white) !important;
}

/* Status badges for payment system */
.fos-badge-success,
.badge.fos-bg-success {
    background: linear-gradient(135deg, var(--fos-green), var(--fos-green-light)) !important;
    color: var(--fos-white) !important;
}
.fos-badge-warning,
.badge.fos-bg-warning {
    background: linear-gradient(135deg, var(--fos-gold), var(--fos-amber)) !important;
    color: var(--fos-black) !important;
}
.fos-badge-secondary,
.badge.fos-bg-gray {
    background: var(--fos-gray) !important;
    color: var(--fos-white) !important;
}

/* ==========================================================================
   Footer Text Logo
   ========================================================================== */

.footer-logo-text {
    display: block;
    font-family: var(--oxpins-font-two, 'Nunito', sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fos-cherry) !important;
    text-decoration: none !important;
    line-height: 1.3;
    margin-bottom: 15px;
}

.footer-logo-text span {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--fos-gray) !important;
    margin-top: 2px;
}

.footer-logo-text:hover {
    color: var(--fos-cherry-dark) !important;
}

.footer-logo-text:hover span {
    color: var(--fos-black) !important;
}
