/* GiveWP Donation Filter Styles */

.givewp-donation-filter-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.givewp-donation-filter-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.givewp-filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.givewp-filter-field label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
}

.givewp-filter-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    background-color: #ffffff;
    color: #333;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.givewp-filter-field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.givewp-filter-field select:hover {
    border-color: #007cba;
}

.givewp-filter-field select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.givewp-form-description {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007cba;
    margin-top: 10px;
}

.givewp-form-description p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.givewp-filter-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.givewp-donate-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.givewp-donate-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.givewp-donate-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.2);
}

.givewp-donate-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.givewp-donate-button.loading {
    background: #6c757d;
    cursor: not-allowed;
}

.givewp-donate-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message styles */
.givewp-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.givewp-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.givewp-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.givewp-message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .givewp-donation-filter-container {
        padding: 15px;
        margin: 10px;
    }
    
    .givewp-donation-filter-form {
        gap: 15px;
    }
    
    .givewp-filter-field select {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .givewp-donate-button {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 140px;
    }
    
    .givewp-form-description {
        padding: 12px;
    }
    
    .givewp-form-description p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .givewp-donation-filter-container {
        padding: 10px;
        margin: 5px;
    }
    
    .givewp-filter-field label {
        font-size: 14px;
    }
    
    .givewp-filter-field select {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .givewp-donate-button {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 120px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .givewp-donation-filter-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .givewp-filter-field label {
        color: #e2e8f0;
    }
    
    .givewp-filter-field select {
        background-color: #4a5568;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .givewp-filter-field select:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
    }
    
    .givewp-form-description {
        background-color: #4a5568;
        border-left-color: #63b3ed;
    }
    
    .givewp-form-description p {
        color: #cbd5e0;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .givewp-donate-button {
        border: 2px solid #000000;
    }
    
    .givewp-filter-field select {
        border-width: 3px;
    }
    
    .givewp-donate-button:focus {
        outline: 3px solid #000000;
        outline-offset: 2px;
    }
}

/* Print styles */
@media print {
    .givewp-donation-filter-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .givewp-donate-button {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }
}

/* Animation for form appearance */
.givewp-donation-filter-container {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.givewp-donate-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.givewp-filter-field select:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Loading state improvements */
.givewp-donate-button.loading .button-text {
    opacity: 0;
}

/* Custom scrollbar for select dropdown (WebKit browsers) */
.givewp-filter-field select::-webkit-scrollbar {
    width: 8px;
}

.givewp-filter-field select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.givewp-filter-field select::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.givewp-filter-field select::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Popup Modal Styles */
.givewp-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    animation: fadeIn 0.3s ease;
}

.givewp-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.givewp-popup-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
    z-index: 1000000;
}

.givewp-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8f9fa;
}

.givewp-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.givewp-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.givewp-popup-close:hover {
    background: #e9ecef;
    color: #495057;
}

.givewp-popup-body {
    padding: 0;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.givewp-popup-form-container {
    padding: 25px;
    min-height: 200px;
}

/* Loading state in popup */
.givewp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.givewp-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.givewp-loading p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

/* Body scroll prevention when popup is open */
body.givewp-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Popup animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Responsive popup */
@media (max-width: 768px) {
    .givewp-popup-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 20px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .givewp-popup-header {
        padding: 15px 20px;
    }
    
    .givewp-popup-header h3 {
        font-size: 18px;
    }
    
    .givewp-popup-close {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
    
    .givewp-popup-form-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .givewp-popup-content {
        max-width: 100vw;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .givewp-popup-header {
        padding: 12px 15px;
    }
    
    .givewp-popup-header h3 {
        font-size: 16px;
    }
    
    .givewp-popup-form-container {
        padding: 15px;
    }
}

/* Dark mode popup support */
@media (prefers-color-scheme: dark) {
    .givewp-popup-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .givewp-popup-header {
        background: #4a5568;
        border-bottom-color: #4a5568;
    }
    
    .givewp-popup-header h3 {
        color: #e2e8f0;
    }
    
    .givewp-popup-close {
        color: #a0aec0;
    }
    
    .givewp-popup-close:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .givewp-loading p {
        color: #a0aec0;
    }
}

/* High contrast mode popup */
@media (prefers-contrast: high) {
    .givewp-popup-content {
        border: 2px solid #000000;
    }
    
    .givewp-popup-close {
        border: 1px solid #000000;
    }
    
    .givewp-popup-close:focus {
        outline: 2px solid #000000;
        outline-offset: 2px;
    }
}

/* Print styles for popup */
@media print {
    .givewp-popup-modal {
        display: none !important;
    }
}

/* GiveWP form styling within popup */
.givewp-popup-form-container .give-form {
    margin: 0;
    padding: 0;
}

.givewp-popup-form-container .give-form .give-form-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.givewp-popup-form-container .give-form .give-form-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #1d2327;
}

.givewp-popup-form-container .give-form .give-form-description {
    margin-bottom: 25px;
    color: #6c757d;
    line-height: 1.6;
}

/* Ensure form elements are properly styled */
.givewp-popup-form-container input[type="text"],
.givewp-popup-form-container input[type="email"],
.givewp-popup-form-container input[type="number"],
.givewp-popup-form-container input[type="tel"],
.givewp-popup-form-container select,
.givewp-popup-form-container textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.givewp-popup-form-container input:focus,
.givewp-popup-form-container select:focus,
.givewp-popup-form-container textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.givewp-popup-form-container .give-btn {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.givewp-popup-form-container .give-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

/* Custom scrollbar for popup content */
.givewp-popup-body::-webkit-scrollbar {
    width: 8px;
}

.givewp-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.givewp-popup-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.givewp-popup-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
