/* ===========================================
   Custom My Account - Styles
   =========================================== */

/* --- Form Container --- */
.cma-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.cma-form-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}

.cma-form-container p {
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

/* --- Messages --- */
.cma-message {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
}

.cma-message.cma-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cma-message.cma-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Form Elements --- */
.cma-form .cma-form-group {
    margin-bottom: 20px;
}

.cma-form .cma-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

.cma-form .cma-form-group label .required,
.cma-form-container .required {
    color: #dc3545;
}

.cma-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.cma-form-input:focus {
    outline: none;
    border-color: #007cba;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.cma-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.cma-form small {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 13px;
}

.cma-form select.cma-form-input {
    appearance: auto;
    -webkit-appearance: auto;
}

/* --- Form Row Layout --- */
.cma-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.cma-form-half {
    flex: 1;
}

.cma-form-third {
    flex: 1;
}

@media (max-width: 768px) {
    .cma-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* --- Checkbox --- */
.cma-checkbox-group label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.cma-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007cba;
}

/* --- Buttons --- */
.cma-button {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}

.cma-button-primary {
    background: #007cba;
    color: #fff;
}

.cma-button-primary:hover {
    background: #005f8a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,124,186,0.3);
}

.cma-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.cma-button-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.cma-button-small {
    padding: 8px 18px;
    font-size: 14px;
}

.cma-button-active {
    background: #007cba;
    color: #fff;
}

.cma-button-logout {
    background: #dc3545;
    color: #fff;
}

.cma-button-logout:hover {
    background: #c82333;
    color: #fff;
    transform: translateY(-1px);
}

.cma-form-group .cma-button {
    width: 100%;
    margin-bottom: 8px;
}

/* --- Form Links --- */
.cma-form-links {
    text-align: center;
    margin-top: 20px;
    font-size: 15px;
    color: #666;
}

.cma-form-links a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.cma-form-links a:hover {
    text-decoration: underline;
}

.cma-separator {
    margin: 0 10px;
    color: #ccc;
}

/* ===========================================
   Dashboard
   =========================================== */
.cma-dashboard {
    max-width: 900px;
    margin: 30px auto;
}

.cma-dashboard-header {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.cma-user-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.cma-user-info h2 {
    margin: 0 0 5px;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.cma-user-email {
    color: #666;
    margin: 0 0 3px;
    font-size: 15px;
}

.cma-member-since {
    color: #999;
    margin: 0;
    font-size: 14px;
}

/* --- Dashboard Grid --- */
.cma-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.cma-dashboard-card {
    display: block;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cma-dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.1);
    border-color: #007cba;
}

.cma-card-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.cma-dashboard-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cma-dashboard-card p {
    margin: 0;
    font-size: 14px;
    color: #888;
    line-height: 1.5;
}

.cma-dashboard-footer {
    text-align: center;
    margin-top: 20px;
}

/* ===========================================
   Tables
   =========================================== */
.cma-section {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.cma-section h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.cma-table-wrapper {
    overflow-x: auto;
}

.cma-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.cma-table th {
    text-align: left;
    padding: 12px 16px;
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.cma-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

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

.cma-table a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.cma-table a:hover {
    text-decoration: underline;
}

/* --- Status Badges --- */
.cma-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: capitalize;
}

.cma-status-pending {
    background: #fff3cd;
    color: #856404;
}

.cma-status-processing {
    background: #cce5ff;
    color: #004085;
}

.cma-status-completed {
    background: #d4edda;
    color: #155724;
}

.cma-status-on-hold {
    background: #f8d7da;
    color: #721c24;
}

.cma-status-cancelled {
    background: #f0f0f0;
    color: #666;
}

.cma-status-refunded {
    background: #e2e3e5;
    color: #383d41;
}

.cma-status-failed {
    background: #f8d7da;
    color: #721c24;
}

.cma-status-approved {
    background: #d4edda;
    color: #155724;
}

.cma-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* --- Order Details --- */
.cma-order-details {
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}

.cma-order-info {
    display: flex;
    gap: 40px;
    margin-bottom: 25px;
}

.cma-order-info-col {
    flex: 1;
}

.cma-order-info-col h4 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.cma-order-info-col p {
    margin: 0 0 6px;
    font-size: 14px;
    color: #555;
}

.cma-order-info-col address {
    font-style: normal;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cma-order-items-table {
    margin-top: 15px;
}

.cma-order-total-row th,
.cma-order-total-row td {
    font-weight: 700;
    font-size: 16px;
    color: #1a1a1a;
}

.cma-order-total-row td {
    color: #007cba;
}

/* --- Empty State --- */
.cma-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.cma-empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* --- Pagination --- */
.cma-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.cma-pagination .cma-button {
    min-width: 40px;
}

/* --- Recent Orders on Dashboard --- */
.cma-recent-orders {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
}

.cma-recent-orders h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.cma-recent-orders .cma-button {
    margin-top: 15px;
}

/* --- Refund Order Selection --- */
.cma-refund-order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cma-refund-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: border-color 0.3s ease;
}

.cma-refund-order-item:hover {
    border-color: #007cba;
}

.cma-refund-order-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 15px;
}

.cma-refund-order-info strong {
    min-width: 80px;
}

.cma-order-date {
    color: #888;
}

.cma-order-total {
    font-weight: 600;
    color: #333;
}

/* --- Refund Order Summary --- */
.cma-refund-order-summary {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 25px;
}

.cma-refund-order-summary h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.cma-refund-order-summary p {
    margin: 0 0 5px;
    font-size: 14px;
    color: #555;
}

/* --- Admin bar menu --- */
#wpadminbar #wp-admin-bar-cma-my-account .ab-item:before {
    content: "\f110";
    top: 2px;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 768px) {
    .cma-form-container {
        padding: 25px 20px;
        margin: 20px auto;
    }
    
    .cma-dashboard-header {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .cma-dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .cma-section {
        padding: 20px;
        margin: 20px auto;
    }
    
    .cma-order-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .cma-refund-order-info {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .cma-refund-order-item {
        flex-direction: column;
        gap: 10px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .cma-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .cma-table {
        font-size: 14px;
    }
    
    .cma-table th,
    .cma-table td {
        padding: 10px 12px;
    }
}
