/* donation-form.css - Refined for a modern, professional look (Two-Column Layout) */

/* Google Fonts - If you want to use 'Inter' (ensure it's enqueued in functions.php) */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); */

/* General Form Styling */
form#donationForm {
    background: #ffffff;
    padding: 40px; /* More padding for spacious feel */
    max-width: 800px; /* Slightly wider to accommodate two columns comfortably */
    margin: 50px auto; /* More margin top/bottom */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Deeper, softer shadow */
    border-radius: 16px; /* Even more rounded corners for modern softness */
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; /* Professional font stack */
    color: #34495e; /* Darker, softer text color for better readability */
    font-size: 16px;
    line-height: 1.6;
    transition: all 0.3s ease-in-out;
    border: 1px solid #f0f0f0; /* Very subtle light border */
}

/* Heading Style */
form#donationForm h3 {
    margin-bottom: 35px; /* More space below heading */
    font-size: 28px; /* Larger, more prominent heading */
    color: #2c3e50; /* A strong, professional dark blue/grey */
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1.2;
}

/* Section Headings/Strong tags - now more like sub-headings */
form#donationForm strong {
    display: block;
    margin-top: 35px; /* More space before new sections */
    margin-bottom: 20px; /* More space after sub-heading */
    font-size: 20px; /* Larger sub-heading */
    color: #4a6781; /* A slightly lighter, professional blue/grey */
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0; /* Subtle separator */
    padding-bottom: 10px;
}

/* New: Amount Options Grid */
.amount-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Responsive grid for amounts */
    gap: 15px; /* Space between amount options */
    margin-top: 20px;
    margin-bottom: 30px; /* Space after amount selection */
}

.amount-options-grid label {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the text for amount buttons */
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background-color: #fcfcfc;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #555;
    white-space: nowrap; /* Prevent amounts from wrapping */
}

.amount-options-grid label:hover {
    border-color: #a0a0a0;
    background-color: #f0f0f0;
}

.amount-options-grid input[type="radio"] {
    display: none; /* Hide default radio button */
}

.amount-options-grid input[type="radio"]:checked + span {
    /* We'll use a span next to the radio for custom checkmark if needed */
    /* For now, just style the label based on checked state */
}

.amount-options-grid input[type="radio"]:checked ~ span + label { /* This selector is tricky, will try simpler */ }

/* Re-style the label based on its contained radio button's checked state */
.amount-options-grid label input[type="radio"]:checked {
    /* The actual radio input itself is hidden, so we style the parent label */
    background-color: #007bff; /* Accent color for selected amount */
    border-color: #007bff;
    color: white; /* White text for selected amount */
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}

.amount-options-grid label input[type="radio"]:checked {
    /* Ensure the actual radio button remains hidden */
    display: none;
}
.amount-options-grid label.active { /* You might add this class with JS on click if the above is problematic */
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
}


/* Custom amount input within the grid */
.amount-options-grid #otherAmountInput {
    grid-column: span 2; /* Make it span two columns if it's placed in the grid */
    margin-top: 0; /* Remove specific margin from old logic */
    margin-bottom: 0;
    max-width: 100%; /* Ensure it fits its grid cell */
    padding: 12px 15px; /* Adjust padding to match label buttons */
    font-size: 16px;
    text-align: center; /* Center placeholder text */
}

/* Main Form Fields - Two Column Layout */
.form-row {
    display: flex; /* Use flexbox for horizontal arrangement */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 20px; /* Space between columns */
    margin-bottom: 5px; /* Reduce vertical space between rows slightly */
}

.form-field {
    flex: 1; /* Each field takes equal space */
    min-width: calc(50% - 10px); /* Roughly 50% width minus half the gap */
    margin-bottom: 15px; /* Space below each field within the row */
}

.form-field.full-width {
    flex: none; /* Override flex-grow */
    width: 100%; /* Force full width */
    min-width: 100%;
}


/* Label Styling (applies to standard labels, not amount grid) */
form#donationForm label {
    display: block; /* Ensure labels are on their own line */
    margin-bottom: 8px; /* Space between label and input */
    font-weight: 600; /* Bolder labels */
    color: #555; /* Slightly darker label text */
    font-size: 15px;
    line-height: 1.4;
}

/* Input Field Styling (reapply for consistency) */
form#donationForm input[type="text"],
form#donationForm input[type="email"],
form#donationForm input[type="number"],
form#donationForm input[type="date"],
form#donationForm select {
    padding: 14px 18px;
    width: 100%; /* Crucial for flexbox fields */
    box-sizing: border-box;
    margin-bottom: 0; /* Removed margin-bottom here as form-field handles it */
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    color: #333;
    background-color: #fcfcfc;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

form#donationForm input::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

form#donationForm input[type="text"]:focus,
form#donationForm input[type="email"]:focus,
form#donationForm input[type="number"]:focus,
form#donationForm input[type="date"]:focus,
form#donationForm select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
    background-color: #ffffff;
    outline: none;
}

form#donationForm select {
    background-color: #fcfcfc;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20512%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M252.8%20160c-12.5-12.5-32.8-12.5-45.3%200L128%20239.5l-79.5-79.5c-12.5-12.5-32.8-12.5-45.3%200s-12.5%2032.8%200%2045.3L105.4%20320c12.5%2012.5%2032.8%2012.5%2045.3%200l102.1-102.1c12.5-12.5%2012.5-32.8%200-45.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 0.8em;
    padding-right: 40px;
}

/* Radio and Checkbox Styling (used for citizenship, donation type, 80G) */
form#donationForm label input[type="radio"],
form#donationForm label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    top: 2px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

form#donationForm label input[type="checkbox"] {
    border-radius: 6px;
}

form#donationForm label input[type="radio"]:checked,
form#donationForm label input[type="checkbox"]:checked {
    border-color: #007bff;
    background-color: #007bff;
}

form#donationForm label input[type="radio"]:focus,
form#donationForm label input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

form#donationForm label input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

form#donationForm label input[type="checkbox"]:checked::before {
    content: '✔';
    display: block;
    color: white;
    font-size: 16px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Custom monthly donation dropdown */
#donationMonths {
    margin-left: 0; /* Remove old margin */
    margin-top: 15px; /* Add some space above it */
    max-width: 250px; /* Constrain width */
    display: block; /* Ensure it takes its own line when visible */
}

/* Button Styling */
form#donationForm button[type="submit"] {
    padding: 15px 35px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    margin: 40px auto 0;
    display: block;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-size: 19px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
}

form#donationForm button[type="submit"]:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

form#donationForm button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
}

/* Message for Foreign Nationals */
#foreignMessage {
    background-color: #e6f7ff;
    padding: 20px;
    border-left: 6px solid #007bff;
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#foreignMessage p {
    margin: 0;
    font-size: 17px;
    color: #333;
    flex-grow: 1;
}

#foreignMessage a {
    color: #007bff;
    text-decoration: none;
    font-weight: 700;
    margin-left: 20px;
    white-space: nowrap;
    transition: text-decoration 0.2s ease;
}
#foreignMessage a:hover {
    text-decoration: underline;
}

/* Privacy/Terms Checkbox */
form#donationForm label.privacy-terms {
    margin-top: 25px;
    margin-bottom: 0;
    font-size: 15px;
    align-items: flex-start;
}

form#donationForm label.privacy-terms input[type="checkbox"] {
    margin-top: 2px;
}

form#donationForm label.privacy-terms a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: text-decoration 0.2s ease;
}

form#donationForm label.privacy-terms a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 820px) { /* Adjust breakpoint for larger tablets/smaller desktops */
    form#donationForm {
        padding: 30px;
        margin: 30px 15px;
        max-width: 95%; /* Make it slightly more fluid on smaller screens */
    }

    form#donationForm h3 {
        font-size: 24px;
        margin-bottom: 25px;
    }

    form#donationForm strong {
        font-size: 18px;
        margin-top: 25px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .amount-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjust grid for smaller screens */
        gap: 10px;
    }

    .form-field {
        min-width: calc(50% - 10px); /* Maintain 2 columns where possible */
    }

    form#donationForm input[type="text"],
    form#donationForm input[type="email"],
    form#donationForm input[type="number"],
    form#donationForm input[type="date"],
    form#donationForm select {
        padding: 12px 15px;
        font-size: 15px;
        border-radius: 8px;
    }

    form#donationForm input[type="radio"],
    form#donationForm input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    form#donationForm input[type="checkbox"]:checked::before {
        font-size: 14px;
    }

    #otherAmountInput {
        /* Keep it as is, grid-column: span 2 will handle it */
    }

    form#donationForm button[type="submit"] {
        padding: 14px 25px;
        font-size: 17px;
        max-width: 100%;
        margin: 30px auto 0;
        border-radius: 8px;
    }

    #foreignMessage {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: 10px;
    }

    #foreignMessage p {
        font-size: 15px;
    }

    #foreignMessage a {
        margin-left: 0;
        margin-top: 10px;
    }
    form#donationForm label.privacy-terms {
        font-size: 14px;
    }
}

@media (max-width: 580px) { /* Transition to single column on smaller phones */
    .form-field {
        min-width: 100%; /* Force single column */
    }

    .form-row {
        gap: 0; /* Remove gap when single column */
    }

    .amount-options-grid {
        grid-template-columns: 1fr; /* Single column for amounts */
        gap: 10px;
    }
    .amount-options-grid #otherAmountInput {
        grid-column: span 1; /* Reset span for single column */
    }
}

/* Very small screens adjustments */
@media (max-width: 480px) {
    form#donationForm {
        padding: 20px;
        margin: 20px 10px;
        border-radius: 10px;
    }

    form#donationForm h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    form#donationForm strong {
        font-size: 16px;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    form#donationForm input[type="text"],
    form#donationForm input[type="email"],
    form#donationForm input[type="number"],
    form#donationForm input[type="date"],
    form#donationForm select {
        padding: 10px 12px;
        font-size: 14px;
        margin-bottom: 12px;
        border-radius: 6px;
    }

    form#donationForm input[type="radio"],
    form#donationForm input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-right: 8px;
    }

    form#donationForm input[type="checkbox"]:checked::before {
        font-size: 12px;
    }

    #otherAmountInput {
        margin-left: 0; /* Remove specific margin on very small screens */
    }

    form#donationForm button[type="submit"] {
        padding: 12px 20px;
        font-size: 15px;
        margin: 25px auto 0;
        border-radius: 6px;
        letter-spacing: 0.5px;
    }

    #foreignMessage {
        padding: 12px;
    }
    #foreignMessage p {
        font-size: 14px;
    }
    form#donationForm label.privacy-terms {
        font-size: 13px;
    }
}