/**
 * Dog Walking Business — My Account Portal
 */

/* Scoped reset — prevent theme overrides on headings, paragraphs, etc. */
.dwb-my-account-wrap h1,
.dwb-my-account-wrap h2,
.dwb-my-account-wrap h3,
.dwb-my-account-wrap h4,
.dwb-my-account-wrap h5,
.dwb-my-account-wrap h6,
.dwb-my-account-wrap p,
.dwb-my-account-wrap dl,
.dwb-my-account-wrap dt,
.dwb-my-account-wrap dd,
.dwb-my-account-wrap ul,
.dwb-my-account-wrap ol,
.dwb-my-account-wrap li,
.dwb-my-account-wrap figure,
.dwb-my-account-wrap blockquote {
    margin: 0 !important;
    padding: 0 !important;
}

.dwb-my-account-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Notices */
.dwb-my-account-wrap .dwb-notice {
    padding: 10px 16px !important;
    border-radius: 8px;
    margin-bottom: 16px !important;
    font-size: 14px;
}
.dwb-my-account-wrap .dwb-notice-success {
    background: #edf8ee;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.dwb-my-account-wrap .dwb-notice-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
}

.dwb-my-account-wrap .dwb-my-account-title {
    margin-bottom: 1.5rem !important;
    text-align: center;
}

/* Login form */
.dwb-my-account-login {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 0 auto;
}

.dwb-my-account-login p {
    margin-bottom: 1rem;
    color: #555;
}

.dwb-my-account-login label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.dwb-my-account-login input[type="text"],
.dwb-my-account-login input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.dwb-my-account-login input[type="submit"] {
    background: var(--dwb-primary, #0073aa);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.dwb-my-account-login input[type="submit"]:hover {
    background: var(--dwb-secondary, #005a87);
}

.dwb-my-account-login .dwb-login-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.dwb-my-account-login .dwb-login-links a {
    color: var(--dwb-primary, #0073aa);
    text-decoration: none;
}

.dwb-my-account-login .dwb-login-links a:hover {
    text-decoration: underline;
}

/* Tab navigation */
.dwb-ma-tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
    padding-top: 1px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.dwb-ma-tab-nav::-webkit-scrollbar {
    display: none;
}

.dwb-ma-tab-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.dwb-ma-tab-btn:hover {
    color: var(--dwb-primary, #0073aa);
    background: rgba(0, 115, 170, 0.06);
    border-radius: 6px 6px 0 0;
}

.dwb-ma-tab-btn.active {
    color: var(--dwb-primary, #0073aa);
    border-color: var(--dwb-primary, #0073aa);
    border-bottom-color: var(--dwb-primary, #0073aa);
    font-weight: 600;
    background: transparent;
}

/* Logout link in tab nav */
.dwb-ma-tab-nav .dwb-ma-logout {
    margin-left: auto;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.75rem 0.75rem;
    align-self: center;
    white-space: nowrap;
    transition: color 0.2s;
    border-bottom: none;
}

.dwb-ma-tab-nav .dwb-ma-logout:hover {
    color: #dc2626;
}

/* Tab panes */
.dwb-ma-tab-pane {
    display: none;
}

.dwb-ma-tab-pane.active {
    display: block;
}

/* Cards */
.dwb-ma-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

/* ---- Profile card ---- */
.dwb-ma-profile-card {
    padding: 0;
    overflow: hidden;
}

.dwb-ma-profile-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 1.75rem 1.25rem;
}

.dwb-ma-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dwb-primary, #0073aa), var(--dwb-secondary, #005a87));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dwb-ma-profile-identity {
    flex: 1;
    min-width: 0;
}

.dwb-ma-profile-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.dwb-ma-profile-email {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
}

.dwb-ma-profile-since {
    display: block;
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.dwb-ma-profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    border-top: 1px solid #f1f5f9;
}

.dwb-ma-info-item {
    padding: 1rem 1.75rem;
    border-right: 1px solid #f1f5f9;
}

.dwb-ma-info-item:last-child {
    border-right: none;
}

.dwb-ma-info-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.dwb-ma-info-value {
    display: block;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Summary grid */
.dwb-ma-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dwb-ma-summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.dwb-ma-summary-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.dwb-ma-summary-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dwb-primary, #0073aa);
    line-height: 1.2;
}

.dwb-ma-summary-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* ---- Pet grid & cards ---- */
.dwb-ma-pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.dwb-ma-pet-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.dwb-ma-pet-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dwb-ma-pet-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 0.75rem;
}

.dwb-ma-pet-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--dwb-primary, #0073aa), var(--dwb-secondary, #005a87));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dwb-ma-pet-identity {
    flex: 1;
    min-width: 0;
}

.dwb-ma-pet-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.dwb-ma-pet-breed {
    display: block;
    color: #64748b;
    font-size: 0.85rem;
}

.dwb-ma-pet-stats {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.dwb-ma-pet-stat {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
}

.dwb-ma-pet-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dwb-primary, #0073aa);
}

.dwb-ma-pet-stat-label {
    font-size: 0.75rem;
    color: #64748b;
}

.dwb-ma-pet-notes {
    border-top: 1px solid #f1f5f9;
    padding: 0.75rem 1.25rem 1rem;
}

.dwb-ma-pet-note {
    margin-bottom: 0.6rem;
}

.dwb-ma-pet-note:last-child {
    margin-bottom: 0;
}

.dwb-ma-pet-note-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.1rem;
}

.dwb-ma-pet-note p {
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

/* Pet edit form inside card */
.dwb-ma-pet-card .dwb-ma-pet-form {
    padding: 1.25rem;
}

.dwb-ma-pet-form .dwb-ma-form-field label {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Tables */
.dwb-ma-table-wrap {
    overflow-x: auto;
}

.dwb-ma-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dwb-ma-table thead th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.dwb-ma-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.dwb-ma-table tbody tr:last-child td {
    border-bottom: none;
}

.dwb-ma-table tbody tr:hover {
    background: #f8fafc;
}

/* Status badges */
.dwb-ma-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.dwb-ma-status-scheduled,
.dwb-ma-status-sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.dwb-ma-status-completed,
.dwb-ma-status-paid {
    background: #dcfce7;
    color: #16a34a;
}

.dwb-ma-status-cancelled,
.dwb-ma-status-void {
    background: #fef2f2;
    color: #dc2626;
}

.dwb-ma-status-pending,
.dwb-ma-status-draft {
    background: #fef9c3;
    color: #a16207;
}

.dwb-ma-status-approved {
    background: #dcfce7;
    color: #16a34a;
}

.dwb-ma-status-rejected {
    background: #fef2f2;
    color: #dc2626;
}

.dwb-ma-status-overdue {
    background: #fff1f2;
    color: #be123c;
}

/* ----------------------------------------
   Appointment Status Filter Bar
   ---------------------------------------- */
.dwb-ma-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.dwb-ma-filter-btn {
    padding: 5px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dwb-ma-filter-btn:hover {
    border-color: var(--dwb-primary, #0073aa);
    color: var(--dwb-primary, #0073aa);
}

.dwb-ma-filter-btn.active {
    background: var(--dwb-primary, #0073aa);
    border-color: var(--dwb-primary, #0073aa);
    color: #fff;
}

/* Pay button */
.dwb-ma-pay-btn {
    display: inline-block;
    background: var(--dwb-accent, #46b450);
    color: #fff;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.dwb-ma-pay-btn:hover {
    opacity: 0.85;
    color: #fff;
}

/* Card header with edit button (fallback for non-redesigned cards) */
.dwb-ma-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dwb-ma-card-header h3,
.dwb-ma-card-header h4 {
    margin: 0;
}

/* Profile edit form inside profile card */
.dwb-ma-profile-card .dwb-ma-profile-form {
    padding: 1.75rem;
}

.dwb-ma-edit-btn {
    background: none;
    border: 1px solid var(--dwb-primary, #0073aa);
    color: var(--dwb-primary, #0073aa);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.dwb-ma-edit-btn:hover {
    background: var(--dwb-primary, #0073aa);
    color: #fff;
}

/* Edit forms */
.dwb-ma-profile-form,
.dwb-ma-pet-form {
    margin-top: 0.5rem;
}

.dwb-ma-form-field {
    margin-bottom: 1rem;
}

.dwb-ma-form-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0.3rem;
}

.dwb-ma-form-field input[type="text"],
.dwb-ma-form-field input[type="email"],
.dwb-ma-form-field input[type="tel"],
.dwb-ma-form-field input[type="number"],
.dwb-ma-form-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.dwb-ma-form-field input:focus,
.dwb-ma-form-field textarea:focus {
    outline: none;
    border-color: var(--dwb-primary, #0073aa);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.dwb-ma-form-field input:disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.dwb-ma-field-hint {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.dwb-ma-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.dwb-ma-form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.dwb-ma-save-btn {
    background: var(--dwb-primary, #0073aa);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.dwb-ma-save-btn:hover {
    background: var(--dwb-secondary, #005a87);
}

.dwb-ma-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dwb-ma-cancel-btn {
    background: none;
    border: 1px solid #d1d5db;
    color: #475569;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.dwb-ma-cancel-btn:hover {
    background: #f3f4f6;
}

.dwb-ma-form-message {
    margin-top: 0.75rem;
}

.dwb-ma-msg-success {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.9rem;
}

.dwb-ma-msg-error {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Empty state */
.dwb-ma-empty {
    text-align: center;
    color: #94a3b8;
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 600px) {
    .dwb-ma-summary-grid {
        grid-template-columns: 1fr;
    }

    .dwb-ma-tab-nav {
        flex-wrap: nowrap;
    }

    .dwb-ma-tab-btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }

    .dwb-ma-profile-top {
        flex-wrap: wrap;
        padding: 1.25rem;
    }

    .dwb-ma-profile-info {
        grid-template-columns: 1fr;
    }

    .dwb-ma-info-item {
        padding: 0.75rem 1.25rem;
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
    }

    .dwb-ma-info-item:last-child {
        border-bottom: none;
    }

    .dwb-ma-pet-grid {
        grid-template-columns: 1fr;
    }

    .dwb-ma-pet-stats {
        flex-wrap: wrap;
    }

    .dwb-ma-form-row {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------
   Invoice View Link
   ---------------------------------------- */
a.dwb-ma-view-invoice {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
a.dwb-ma-view-invoice:hover {
    color: #005177;
    text-decoration: underline;
}

/* ----------------------------------------
   Frontend Invoice Modal
   ---------------------------------------- */
.dwb-ma-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.dwb-ma-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.dwb-ma-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    max-width: 820px;
    width: 90%;
    margin: 40px auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
}

.dwb-ma-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.dwb-ma-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.dwb-ma-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.dwb-ma-modal-close:hover {
    color: #333;
}

.dwb-ma-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.dwb-ma-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: right;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 600px) {
    .dwb-ma-modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
    }
}

/* ----------------------------------------
   Payment Methods — Stacked Buttons
   ---------------------------------------- */
.dwb-payment-methods-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dwb-payment-stack-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 14px 20px;
    background: var(--dwb-primary, #0073aa);
    color: #fff !important;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    transition: opacity 0.15s, transform 0.1s;
    box-sizing: border-box;
}

.dwb-payment-stack-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.dwb-payment-stack-btn:active {
    transform: translateY(0);
}

.dwb-payment-stack-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

.dwb-payment-stack-info strong {
    color: #1e293b;
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.dwb-payment-stack-info p {
    margin: 0 0 6px !important;
}

.dwb-payment-stack-info p:last-child {
    margin-bottom: 0 !important;
}

.dwb-payment-sent-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--dwb-primary, #0073aa);
    text-decoration: none;
    font-weight: 600;
}

.dwb-payment-sent-link:hover {
    text-decoration: underline;
}

.dwb-preferred-badge {
    font-size: 0.8rem;
    color: var(--dwb-primary, #0073aa);
    font-weight: 600;
    margin-left: 4px;
}

.dwb-payment-stack-btn .dwb-preferred-badge {
    color: rgba(255, 255, 255, 0.75);
}

/* Pay Now button as actual button */
button.dwb-ma-pay-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Booking confirmation payment info */
.dwb-payment-info-section {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.dwb-payment-info-section h4 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.dwb-payment-info-method {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #334155;
}

.dwb-payment-info-method:last-child {
    margin-bottom: 0;
}

.dwb-payment-info-method a {
    color: var(--dwb-primary, #0073aa);
}

.dwb-payment-info-instructions {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.85rem;
}
