/**
 * Frontend CSS for HOA Financial Manager
 */

/* Portal Container */
.hoa-fm-portal {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Member Information */
.hoa-fm-member-info {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.hoa-fm-member-info h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

.hoa-fm-member-info p {
    margin: 10px 0;
    line-height: 1.6;
}

/* Dues by year */
.hoa-fm-dues-by-year {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 30px;
}

.hoa-fm-dues-by-year h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

.hoa-fm-dues-by-year .description {
    margin: 0 0 15px 0;
    color: #646970;
}

.hoa-fm-dues-table .hoa-fm-row-paid {
    background: #f0f9f0;
}

.hoa-fm-dues-table .hoa-fm-row-pending {
    background: #fff;
}

.hoa-fm-select-year {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
}

.hoa-fm-select-year input {
    margin: 0;
}

#hoa-fm-pay-section .hoa-fm-selected-total {
    font-size: 18px;
}

#hoa-fm-total-amount {
    color: #2271b1;
}

/* Payment Status */
.hoa-fm-payment-status {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.hoa-fm-payment-status h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
}

.hoa-fm-status-paid {
    font-size: 18px;
    color: #46b450;
    font-weight: bold;
    padding: 15px;
    background: #e7f7e9;
    border-radius: 4px;
    margin: 15px 0;
}

.hoa-fm-status-paid .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

.hoa-fm-status-pending {
    font-size: 18px;
    color: #d63638;
    font-weight: bold;
    padding: 15px;
    background: #fcf0f1;
    border-radius: 4px;
    margin: 15px 0;
}

.hoa-fm-status-pending .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

/* PayPal Button Container */
#paypal-button-container {
    max-width: 400px;
    margin: 20px auto;
}

#payment-message {
    text-align: center;
    font-weight: bold;
}

/* Payment History */
.hoa-fm-payment-history {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 25px;
}

.hoa-fm-payment-history h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

/* History Table */
.hoa-fm-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.hoa-fm-history-table thead {
    background: #f9f9f9;
}

.hoa-fm-history-table th {
    text-align: left;
    padding: 12px 10px;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.hoa-fm-history-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

.hoa-fm-history-table tbody tr:hover {
    background: #f6f7f7;
}

.hoa-fm-history-table .button-small {
    padding: 5px 12px;
    font-size: 13px;
    text-decoration: none;
}

/* Buttons */
.hoa-fm-portal .button {
    display: inline-block;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.hoa-fm-portal .button:hover {
    background: #135e96;
    color: #fff;
}

.hoa-fm-portal .button-small {
    padding: 5px 12px;
    font-size: 13px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .hoa-fm-portal {
        padding: 10px;
    }
    
    .hoa-fm-history-table {
        font-size: 14px;
    }
    
    .hoa-fm-history-table th,
    .hoa-fm-history-table td {
        padding: 8px 5px;
    }
    
    /* Make table scrollable on mobile */
    .hoa-fm-payment-history {
        overflow-x: auto;
    }
    
    .hoa-fm-history-table {
        min-width: 600px;
    }
}

@media screen and (max-width: 480px) {
    .hoa-fm-payment-status h2,
    .hoa-fm-payment-history h2 {
        font-size: 18px;
    }
    
    .hoa-fm-status-paid,
    .hoa-fm-status-pending {
        font-size: 16px;
        padding: 12px;
    }
}

/* Loading State */
.hoa-fm-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.hoa-fm-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* HOA Expenses public block / shortcode */
.hoa-fm-expenses-public {
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 20px;
}

.hoa-fm-expenses-public-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

.hoa-fm-expenses-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.hoa-fm-expenses-filter-label {
    margin: 0;
    font-weight: 600;
}

.hoa-fm-expenses-year-select {
    padding: 6px 10px;
    min-width: 100px;
}

.hoa-fm-expenses-filter-btn {
    padding: 6px 14px;
    cursor: pointer;
}

.hoa-fm-expenses-year-heading {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #50575e;
}

.hoa-fm-expenses-content {
    transition: opacity 0.2s ease;
}

.hoa-fm-expenses-loading {
    margin: 20px 0;
    color: #646970;
}

.hoa-fm-expenses-error {
    margin: 20px 0;
    color: #d63638;
}

.hoa-fm-expenses-public-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.hoa-fm-expenses-public-table thead {
    background: #f9f9f9;
}

.hoa-fm-expenses-public-table th {
    text-align: left;
    padding: 12px 10px;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.hoa-fm-expenses-public-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

.hoa-fm-expenses-public-table tbody tr:hover {
    background: #f6f7f7;
}

.hoa-fm-expenses-public-table tfoot td {
    border-top: 2px solid #ddd;
    padding-top: 14px;
}

@media screen and (max-width: 768px) {
    .hoa-fm-expenses-public {
        padding: 10px;
        overflow-x: auto;
    }

    .hoa-fm-expenses-public-table {
        min-width: 500px;
    }
}
