/**
 * BuddyPress Billing & Invoices Styles
 *
 * @package CustomMembersAccess
 */

/* Container */
.cma-billing-invoices {
    max-width: 800px;
}

/* Section Styling */
.cma-billing-section,
.cma-invoices-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px 25px;
    margin-bottom: 25px;
}

.cma-billing-section h3,
.cma-invoices-section h3 {
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2em;
    color: #333;
}

.cma-section-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

/* Form Styling */
.cma-billing-form {
    max-width: 500px;
}

.cma-form-field {
    margin-bottom: 15px;
}

.cma-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.cma-form-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.cma-form-field input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.cma-form-field input[type="text"]::placeholder {
    color: #999;
}

/* Form Row (for postal + city) */
.cma-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.cma-form-row .cma-form-field {
    margin-bottom: 0;
}

.cma-form-field-small {
    flex: 0 0 120px;
}

.cma-form-field-large {
    flex: 1;
}

/* Submit Button */
.cma-form-submit {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.cma-form-submit .button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cma-form-submit .button:hover {
    background: #005a87;
}

/* Invoice Table */
.cma-invoices-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.cma-invoices-table th,
.cma-invoices-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cma-invoices-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cma-invoices-table tbody tr:hover {
    background: #f9f9f9;
}

.cma-amount-col {
    text-align: right !important;
    font-weight: 600;
}

.cma-action-col {
    text-align: center !important;
    width: 100px;
}

/* Download Button */
.cma-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #0073aa;
    color: #fff !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none;
    transition: background-color 0.2s;
}

.cma-download-btn:hover {
    background: #005a87;
    color: #fff !important;
}

.cma-download-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* No Invoices Message */
.cma-no-invoices {
    color: #666;
    font-style: italic;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 600px) {
    .cma-billing-section,
    .cma-invoices-section {
        padding: 15px;
    }

    .cma-form-row {
        flex-direction: column;
        gap: 0;
    }

    .cma-form-row .cma-form-field {
        margin-bottom: 15px;
    }

    .cma-form-field-small {
        flex: 1;
    }

    /* Responsive table */
    .cma-invoices-table thead {
        display: none;
    }

    .cma-invoices-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 10px;
    }

    .cma-invoices-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .cma-invoices-table tbody td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 15px;
    }

    .cma-invoices-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #333;
    }

    .cma-amount-col,
    .cma-action-col {
        text-align: left !important;
    }
}
