/**
 * VIG1 Profile Popup Styles
 * Modernized sidebar-nav + content layout
 */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
#vig1-profile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10200;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
#vig1-profile-overlay.vig1-profile-open {
    display: flex;
}

/* ── Modal wrapper ───────────────────────────────────────────────────────── */
#vig1-profile-popup {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    width: 780px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1f2937;
    margin: auto;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
#vig1-profile-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}
#vig1-profile-popup-email {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#vig1-profile-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
#vig1-profile-popup-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Body: sidebar + content ─────────────────────────────────────────────── */
#vig1-profile-popup-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ── Sidebar nav ─────────────────────────────────────────────────────────── */
#vig1-profile-popup-nav {
    width: 190px;
    flex-shrink: 0;
    background: #f3f4f6;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 12px 0 0 0;
    overflow-y: auto;
    transition: width 0.18s ease;
    overflow-x: hidden;
}

/* ── Nav toggle button (collapse/expand arrow at bottom) ─────────────────── */
#vig1-profile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-top: 1px solid #e5e7eb;
    cursor: pointer;
    width: 100%;
    padding: 9px 0;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    margin-top: auto;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
#vig1-profile-nav-toggle:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ── Collapsed nav ───────────────────────────────────────────────────────── */
#vig1-profile-popup-nav.collapsed {
    width: 34px;
    min-width: 34px;
}
#vig1-profile-popup-nav.collapsed .vig1-profile-nav-item {
    display: none;
}
.vig1-profile-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: #374151;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    user-select: none;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.vig1-profile-nav-item:hover {
    background: #e5e7eb;
    color: #111827;
}
.vig1-profile-nav-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #2563eb;
}

/* ── Content area ────────────────────────────────────────────────────────── */
#vig1-profile-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-width: 0;
}

/* ── Section heading ──────────────────────────────────────────────────────── */
.vig1-profile-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 18px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* ── Placeholder page ─────────────────────────────────────────────────────── */
.vig1-profile-placeholder {
    color: #9ca3af;
    font-style: italic;
    padding: 24px 0;
    text-align: center;
}

/* ── Form groups ──────────────────────────────────────────────────────────── */
.vig1-profile-form-group {
    margin-bottom: 14px;
}
.vig1-profile-form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.vig1-profile-input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: 13.5px;
    color: #1f2937;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.vig1-profile-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.vig1-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, opacity 0.15s;
    outline: none;
}
.vig1-profile-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.vig1-profile-btn-primary {
    background: #2563eb;
    color: #fff;
}
.vig1-profile-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}
.vig1-profile-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}
.vig1-profile-btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}
.vig1-profile-btn-danger {
    background: #dc2626;
    color: #fff;
}
.vig1-profile-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}
.vig1-profile-btn-ghost {
    background: transparent;
    color: #2563eb;
    border: 1.5px solid #2563eb;
}
.vig1-profile-btn-ghost:hover:not(:disabled) {
    background: #eff6ff;
}
.vig1-profile-btn-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* ── Alert / feedback strip ───────────────────────────────────────────────── */
.vig1-profile-alert {
    padding: 8px 13px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}
.vig1-profile-alert.show {
    display: block;
}
.vig1-profile-alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.vig1-profile-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ── Billing addresses list ───────────────────────────────────────────────── */
.vig1-profile-address-card {
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 13px 16px;
    margin-bottom: 12px;
    background: #f9fafb;
    position: relative;
    transition: border-color 0.15s;
}
.vig1-profile-address-card.is-default {
    border-color: #2563eb;
    background: #eff6ff;
}
.vig1-profile-address-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.vig1-profile-address-card-name {
    font-weight: 700;
    font-size: 14px;
    color: #111827;
}
.vig1-profile-address-default-badge {
    font-size: 11px;
    background: #2563eb;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.vig1-profile-address-card-details {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 8px;
}
.vig1-profile-address-card-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.vig1-profile-address-card-actions .vig1-profile-btn {
    font-size: 12px;
    padding: 5px 11px;
}

/* ── Billing address form (add/edit) ──────────────────────────────────────── */
#vig1-profile-billing-form-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 18px;
    margin-bottom: 18px;
}
.vig1-profile-billing-form-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px 0;
}

/* ── Bookings table ───────────────────────────────────────────────────────── */
.vig1-profile-bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.vig1-profile-bookings-table th {
    text-align: left;
    padding: 7px 10px;
    font-weight: 700;
    background: #f3f4f6;
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
    white-space: nowrap;
}
.vig1-profile-bookings-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}
.vig1-profile-bookings-table tr:last-child td {
    border-bottom: none;
}
.vig1-profile-bookings-table tr:hover td {
    background: #f9fafb;
}
.vig1-profile-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 10px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
    white-space: nowrap;
}
.vig1-profile-status-ok {
    background: #dcfce7;
    color: #15803d;
}
.vig1-profile-status-pending {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ── Credits section ──────────────────────────────────────────────────────── */
.vig1-profile-credits-list {
    margin: 0 0 18px 0;
}
.vig1-profile-credit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13.5px;
}
.vig1-profile-credit-row:last-child {
    border-bottom: none;
}
.vig1-profile-credit-name {
    color: #374151;
    font-weight: 500;
}
.vig1-profile-credit-balance {
    font-weight: 700;
    color: #059669;
    font-size: 15px;
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.vig1-profile-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
    padding: 16px 0;
}
.vig1-profile-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: vig1-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes vig1-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #vig1-profile-popup {
        width: 100%;
        max-height: 92vh;
        border-radius: 10px;
    }
    #vig1-profile-popup-nav {
        width: 150px;
    }
    .vig1-profile-nav-item {
        font-size: 12px;
        padding: 9px 12px;
    }
    #vig1-profile-popup-content {
        padding: 16px;
    }
    .vig1-profile-bookings-table th:nth-child(2),
    .vig1-profile-bookings-table td:nth-child(2) {
        display: none;
    }
}
