/**
 * Donation Modal Styles
 * Mobile-first responsive design
 */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevent body scroll when modal open */
body.modal-open {
    overflow: hidden;
}

/* Modal Container */
.donation-modal {
    background: #FFFFFF;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    margin: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.modal-header {
    background: #14b8a6;
    color: #FFFFFF;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 28px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Body */
.modal-body {
    padding: 25px 20px;
}

/* Quick Amount Buttons */
.quick-amounts {
    margin-bottom: 20px;
}

.quick-amounts label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
}

.quick-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.quick-amount-btn {
    background: #F5F5F5;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.quick-amount-btn:hover {
    background: #E8F8FA;
    border-color: #14b8a6;
}

.quick-amount-btn.active {
    background: #14b8a6;
    border-color: #14b8a6;
    color: #FFFFFF;
}

/* Custom Amount Input */
.custom-amount {
    margin-bottom: 20px;
}

.custom-amount label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
}

.amount-input-wrapper {
    position: relative;
}

.amount-prefix {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 600;
    color: #666666;
}

#donation-amount {
    width: 100%;
    padding: 12px 15px 12px 45px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s;
}

#donation-amount:focus {
    border-color: #14b8a6;
}

.amount-display {
    margin-top: 8px;
    font-size: 12px;
    color: #757575;
    text-align: right;
}

/* Donation Message */
.donation-message {
    margin-bottom: 20px;
}

.donation-message label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
}

#donation-message {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    resize: vertical;
    min-height: 80px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

#donation-message:focus {
    border-color: #14b8a6;
}

/* Group Selection */
.group-selection {
    margin-bottom: 20px;
}

.group-selection > label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    margin-bottom: 12px;
}

.group-options {
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    padding: 15px;
    background: #FAFAFA;
}

.section-label {
    font-weight: 600;
    font-size: 13px;
    color: #14b8a6;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label i {
    font-size: 14px;
}

/* My Groups Section */
.my-groups-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #CCCCCC;
}

.group-radio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.group-radio-item:hover {
    border-color: #14b8a6;
    background: #F0FDFA;
}

.group-radio-item input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #14b8a6;
}

.group-radio-item input[type="radio"]:checked + .group-radio-label {
    color: #14b8a6;
    font-weight: 600;
}

.group-radio-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-name {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

.group-members {
    font-size: 12px;
    color: #999999;
    background: #F5F5F5;
    padding: 3px 8px;
    border-radius: 12px;
}

/* Join Group Section */
.join-group-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #CCCCCC;
}

/* Invite Code Section */
.invite-code-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #CCCCCC;
}

.invite-code-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#invite-code-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.3s;
}

#invite-code-input:focus {
    border-color: #14b8a6;
}

.helper-text {
    display: block;
    font-size: 11px;
    color: #999999;
    font-style: italic;
}

/* Campaign Groups Section */
.campaign-groups-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #CCCCCC;
}

.browseable-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    cursor: default;
    transition: all 0.3s;
}

.browseable-group:hover {
    border-color: #14b8a6;
    background: #F0FDFA;
}

.group-info-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.join-campaign-group-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #F1FF4D;
    color: #333333;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.join-campaign-group-btn:hover {
    background: #E6F542;
    transform: translateY(-1px);
}

.join-campaign-group-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Group Requirement Note */
.group-requirement-note {
    font-size: 12px;
    color: #666666;
    margin: 8px 0 15px;
    padding: 10px;
    background: #FFF4E6;
    border-left: 3px solid #FF9800;
    border-radius: 5px;
}

.group-select-wrapper {
    display: flex;
    gap: 8px;
}

.group-select {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    background: #FFFFFF;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.group-select:focus {
    border-color: #14b8a6;
}

.action-btn {
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.primary-btn {
    background: #14b8a6;
    color: #FFFFFF;
}

.primary-btn:hover {
    background: #138496;
    transform: translateY(-2px);
}

.secondary-btn {
    background: #F1FF4D;
    color: #333333;
}

.secondary-btn:hover {
    background: #E6F542;
    transform: translateY(-2px);
}

/* Create Group Section */
.create-group-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #CCCCCC;
}

.create-group-form {
    display: flex;
    gap: 8px;
}

.create-group-form input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.create-group-form input[type="text"]:focus {
    border-color: #14b8a6;
}

.create-group-form input[type="text"]::placeholder {
    color: #AAAAAA;
}

/* No Group Section */
.no-group-section {
    margin-top: 0;
}

.no-group-section .group-radio-item {
    background: #FFF9E6;
    border-color: #F1FF4D;
}

.no-group-section .group-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.no-group-section .group-name i {
    color: #F1A94E;
}

/* Success/Error Messages */
.group-message {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 10px;
    animation: fadeIn 0.3s;
}

.group-message.success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #10B981;
}

.group-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #EF4444;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Minimum Donation Note */
.donation-note {
    background: #FFF9E6;
    border-left: 4px solid #F1FF4D;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.donation-note p {
    margin: 0;
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
}

/* Donate Button */
.modal-footer {
    padding: 0 20px 25px;
}

#process-donation-btn {
    width: 100%;
    background: #14b8a6;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

#process-donation-btn:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

#process-donation-btn:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
}

/* No Groups Message */
.no-groups-message {
    background: #f0fdfa;
    border: 2px dashed #14b8a6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.no-groups-message i {
    color: #14b8a6;
    margin-right: 5px;
}

.no-groups-message p {
    margin: 8px 0;
    color: #475569;
    font-size: 14px;
}

.no-groups-message a {
    color: #14b8a6;
    text-decoration: underline;
    font-weight: 600;
}

.no-groups-message a:hover {
    color: #0d9488;
}

/* Communities Link Section */
.communities-link-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
    border-radius: 12px;
    text-align: center;
}

.communities-link-section .section-label {
    margin-bottom: 12px;
    font-size: 14px;
    color: #475569;
}

.btn-communities-link {
    display: inline-block;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-communities-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.4);
    color: white;
}

/* Responsive Design */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .donation-modal {
        margin: 0;
    }
    
    .quick-amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
}

@media (min-width: 768px) {
    .donation-modal {
        max-width: 500px;
    }
    
    .modal-body {
        padding: 30px 25px;
    }
    
    .modal-footer {
        padding: 0 25px 30px;
    }
}
