/**
 * Imagic Directory - Account Edit Styles
 *
 * Shared styles for [imagic_edit_business] and [imagic_edit_account] shortcodes.
 *
 * @package ImagicDirectory
 * @since   1.3.0
 */

/* ─── Reset ─────────────────────────────────────────────────── */
.ae-wrap *,
.ae-wrap *::before,
.ae-wrap *::after {
    box-sizing: border-box;
}

/* ─── Wrapper ───────────────────────────────────────────────── */
.ae-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #222;
}

/* ─── Notices ───────────────────────────────────────────────── */
.ae-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.ae-notice--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ae-notice--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.ae-notice--info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Business Header ───────────────────────────────────────── */
.ae-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

.ae-header__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    padding: 4px;
    flex-shrink: 0;
}

.ae-header__info {
    flex: 1;
}

.ae-header__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.2;
}

.ae-header__subtitle {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.ae-header__view-btn {
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.ae-header__view-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #111;
}

/* ─── Account Header ────────────────────────────────────────── */
.ae-account-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

.ae-account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.ae-account-header__name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 2px;
}

.ae-account-header__type {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* ─── Tabs ──────────────────────────────────────────────────── */
.ae-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 0;
}

.ae-tab {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    bottom: -2px;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.ae-tab:hover {
    color: #111;
}

.ae-tab.active {
    color: #111;
    font-weight: 700;
    border-bottom-color: #111;
}

/* ─── Tab Panels ────────────────────────────────────────────── */
.ae-tab-panel {
    display: none;
}

.ae-tab-panel.active {
    display: block;
}

/* ─── Sections ──────────────────────────────────────────────── */
.ae-section {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.ae-section__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 18px;
    color: #111;
}

/* ─── Fields ────────────────────────────────────────────────── */
.ae-field {
    margin-bottom: 16px;
}

.ae-field:last-child {
    margin-bottom: 0;
}

.ae-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--imd-text-label);
    margin-bottom: 6px;
}

.ae-field input[type="text"],
.ae-field input[type="email"],
.ae-field input[type="tel"],
.ae-field input[type="url"],
.ae-field input[type="password"],
.ae-field textarea,
.ae-field select {
    width: 100%;
    padding: var(--imd-field-pad);
    border: var(--imd-field-border-w) solid var(--imd-border);
    border-radius: var(--imd-field-radius);
    font-size: var(--imd-field-font);
    color: var(--imd-text);
    background: var(--imd-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    font-family: inherit;
}

.ae-field input:focus,
.ae-field textarea:focus,
.ae-field select:focus {
    border-color: var(--imd-primary);
    box-shadow: 0 0 0 3px var(--imd-primary-ring);
}

.ae-field textarea {
    resize: vertical;
    min-height: 90px;
}

.ae-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.ae-field-row .ae-field {
    margin-bottom: 0;
}

.ae-field-help {
    font-size: 12px;
    color: #888;
    margin: 4px 0 0;
}

/* Inline field */
.ae-field--inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ae-field--inline label {
    margin-bottom: 0;
    white-space: nowrap;
    min-width: 140px;
}

.ae-field--inline select {
    width: auto;
}

/* Social icons */
.ae-field--icon {
    position: relative;
}

.ae-field--instagram label::before { content: '📸 '; }
.ae-field--facebook label::before  { content: '👥 '; }
.ae-field--tiktok label::before    { content: '🎵 '; }

/* Password toggle */
.ae-pass-wrap {
    position: relative;
}

.ae-pass-wrap input {
    padding-right: 44px;
}

.ae-pass-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #888;
    display: flex;
    align-items: center;
}

.ae-pass-toggle:hover { color: #333; }

.ae-pass-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ─── Chips (interests / yoga styles) ──────────────────────── */
.ae-chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ae-chip {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ae-chip input[type="checkbox"] {
    display: none;
}

.ae-chip span {
    display: inline-block;
    padding: 8px 18px;
    border: var(--imd-field-border-w) solid var(--imd-border);
    border-radius: 99px;
    font-size: 14px;
    font-weight: 500;
    color: var(--imd-text-label);
    background: var(--imd-bg-light);
    transition: all 0.18s;
    user-select: none;
}

.ae-chip input:checked + span {
    background: var(--imd-primary);
    border-color: var(--imd-primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--imd-primary-ring);
}

.ae-chip:hover span {
    border-color: var(--imd-primary);
    color: var(--imd-primary);
}

/* ─── Amenity Checkboxes ────────────────────────────────────── */
.ae-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.ae-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.ae-checkbox-label:hover {
    border-color: #888;
    background: #f5f5f5;
}

.ae-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #111;
    flex-shrink: 0;
    margin: 0;
}

.ae-checkbox-label:has(input:checked) {
    border-color: #111;
    background: #f5f5f5;
    font-weight: 600;
}

/* ─── Hours ─────────────────────────────────────────────────── */
.ae-hours-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ae-hours-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: var(--imd-field-border-w) solid var(--imd-border);
    border-radius: var(--imd-field-radius);
    background: var(--imd-bg-light);
    transition: border-color 0.2s, background 0.2s;
}

.ae-hours-row.is-open {
    background: var(--imd-primary-bg);
    border-color: #ebe1db;
}

.ae-hours-day {
    font-size: 14px;
    font-weight: 600;
    min-width: 90px;
    color: var(--imd-text-label);
}

.ae-hours-times {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ae-time-input {
    border: var(--imd-field-border-w) solid var(--imd-border);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 14px;
    color: var(--imd-text);
    background: var(--imd-bg);
    outline: none;
    width: 110px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.ae-time-input:focus {
    border-color: var(--imd-primary);
    box-shadow: 0 0 0 3px var(--imd-primary-ring);
}

.ae-hours-sep {
    color: #aaa;
    font-size: 14px;
}

.ae-hours-closed {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
}

/* Toggle switch */
.ae-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ae-toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    position: absolute;
}

.ae-toggle-thumb {
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    transition: background 0.2s;
}

.ae-toggle-thumb::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.ae-toggle-switch input:checked + .ae-toggle-thumb {
    background: var(--imd-primary);
}

.ae-toggle-switch input:checked + .ae-toggle-thumb::after {
    transform: translateX(16px);
}

/* ─── Drop zone (logo / cover) ──────────────────────────────── */
.ae-drop-zone {
    position: relative;
    border: var(--imd-field-border-w) dashed var(--imd-border);
    border-radius: var(--imd-field-radius);
    background: var(--imd-bg-light);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ae-drop-zone:hover:not(.ae-drop-zone--has-image),
.ae-drop-zone--drag {
    border-color: var(--imd-primary);
    background: var(--imd-primary-bg);
}

.ae-drop-zone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.ae-drop-zone--has-image .ae-drop-zone__input {
    display: none;
}

.ae-drop-zone__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 36px 24px;
    text-align: center;
    pointer-events: none;
}

.ae-drop-zone__icon {
    font-size: 36px;
    line-height: 1;
}

.ae-drop-zone__empty p {
    margin: 0;
    font-size: var(--imd-field-font);
    font-weight: 600;
    color: var(--imd-text-label);
}

.ae-drop-zone__empty small {
    font-size: 12px;
    color: var(--imd-text-muted);
}

/* Preview row (logo) */
.ae-drop-zone__preview {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
}

.ae-drop-zone__preview img {
    width: 80px;
    height: 80px;
    border-radius: var(--imd-field-radius);
    object-fit: cover;
    border: var(--imd-field-border-w) solid var(--imd-border);
    flex-shrink: 0;
}

/* Wide cover preview */
.ae-drop-zone--wide {
    cursor: pointer;
}

.ae-drop-zone__preview--cover {
    display: block;
    padding: 0;
}

.ae-drop-zone__preview--cover img {
    width: 100%;
    height: 180px;
    border-radius: 0;
    border: none;
    display: block;
    object-fit: cover;
}

.ae-drop-zone__preview--cover .ae-drop-zone__preview-info {
    padding: 12px 18px;
}

.ae-drop-zone__preview-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ae-drop-zone__preview-info span {
    font-size: 13px;
    font-weight: 600;
    color: var(--imd-text-label);
}

.ae-drop-zone__remove {
    background: none;
    border: 1px solid var(--imd-border);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--imd-text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.ae-drop-zone__remove:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Upload progress bar */
.ae-drop-zone__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--imd-border);
    z-index: 5;
}

.ae-drop-zone__progress-bar {
    height: 100%;
    background: var(--imd-primary);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ─── Gallery drop zone ──────────────────────────────────────── */
.ae-gallery-drop {
    position: relative;
    border: var(--imd-field-border-w) dashed var(--imd-border);
    border-radius: var(--imd-field-radius);
    background: var(--imd-bg-light);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
    cursor: default;
}

.ae-gallery-drop--drag,
.ae-gallery-drop:has(#ae-gallery-input:focus) {
    border-color: var(--imd-primary);
    background: var(--imd-primary-bg);
}

#ae-gallery-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.ae-gallery-drop__icon {
    font-size: 32px;
    line-height: 1;
}

.ae-gallery-drop p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--imd-text-label);
}

.ae-gallery-drop small {
    font-size: 12px;
    color: var(--imd-text-muted);
}

.ae-gallery-drop__btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--imd-primary);
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

.ae-gallery-drop__btn:hover {
    color: var(--imd-primary-dark);
}

/* ─── Gallery grid ──────────────────────────────────────────── */
.ae-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.ae-gallery-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: var(--imd-field-border-w) solid var(--imd-border);
    cursor: grab;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}

.ae-gallery-item:active { cursor: grabbing; }

.ae-gallery-item--dragging {
    opacity: 0.4;
    transform: scale(0.96);
}

.ae-gallery-item--over {
    box-shadow: 0 0 0 3px var(--imd-primary);
}

.ae-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.ae-gallery-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.15s;
    z-index: 2;
}

.ae-gallery-remove:hover { background: #dc2626; }

/* Loading placeholder while uploading */
.ae-gallery-item--loading {
    background: var(--imd-bg-light);
    border-style: dashed;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes ae-spin {
    to { transform: rotate(360deg); }
}

.ae-gallery-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--imd-border);
    border-top-color: var(--imd-primary);
    border-radius: 50%;
    animation: ae-spin 0.7s linear infinite;
}

/* Legacy — kept so old rule below doesn't break */
.ae-gallery-add .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

/* ─── Save bar ──────────────────────────────────────────────── */
.ae-save-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid #e8e8e8;
    padding: 14px 0;
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 100;
}

.ae-save-hint {
    font-size: 12px;
    color: #aaa;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.ae-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
    font-family: inherit;
    text-decoration: none;
}

.ae-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.ae-btn--primary {
    background: #111;
    color: #fff;
}

.ae-btn--primary:hover:not(:disabled) {
    background: #000;
    transform: translateY(-1px);
}

.ae-btn--ghost {
    background: transparent;
    color: #555;
    border: 1.5px solid #ddd;
}

.ae-btn--ghost:hover {
    border-color: #888;
    color: #111;
}

.ae-btn--danger {
    background: #dc2626;
    color: #fff;
}

.ae-btn--danger:hover:not(:disabled) {
    background: #b91c1c;
}

.ae-btn--danger-outline {
    background: transparent;
    color: #dc2626;
    border: 1.5px solid #dc2626;
}

.ae-btn--danger-outline:hover {
    background: #fef2f2;
}

.ae-btn__loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ─── Spinner ───────────────────────────────────────────────── */
.ae-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ae-spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

/* ─── Danger Zone ───────────────────────────────────────────── */
.ae-danger-zone {
    margin-top: 40px;
    padding: 24px;
    border: 1.5px solid #fca5a5;
    border-radius: 12px;
    background: #fff5f5;
}

.ae-danger-zone__title {
    font-size: 16px;
    font-weight: 700;
    color: #991b1b;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ae-danger-zone__title .dashicons {
    color: #dc2626;
}

.ae-danger-zone > p {
    font-size: 13px;
    color: #555;
    margin: 0 0 16px;
}

/* Delete confirmation box */
.ae-delete-confirm {
    margin-top: 20px;
}

.ae-delete-confirm__box {
    background: #fff;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 20px;
}

.ae-delete-confirm__box h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #991b1b;
}

.ae-delete-confirm__box p {
    font-size: 13px;
    color: #555;
    margin: 0 0 12px;
    line-height: 1.6;
}

.ae-delete-confirm__box code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #c00;
}

.ae-delete-confirm__box input[type="text"] {
    width: 100%;
    padding: var(--imd-field-pad);
    border: var(--imd-field-border-w) solid var(--imd-border);
    border-radius: var(--imd-field-radius);
    font-size: var(--imd-field-font);
    outline: none;
    margin-bottom: 14px;
    font-family: inherit;
}

.ae-delete-confirm__box input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.ae-delete-confirm__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ae-wrap {
        padding: 20px 16px 48px;
    }

    .ae-tabs {
        gap: 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ae-tabs::-webkit-scrollbar {
        display: none;
    }

    .ae-tab {
        font-size: 13px;
        padding: 8px 12px;
    }

    .ae-field-row {
        grid-template-columns: 1fr;
    }

    .ae-hours-row {
        flex-wrap: wrap;
    }

    .ae-hours-day {
        min-width: 80px;
    }

    .ae-checkboxes {
        grid-template-columns: 1fr 1fr;
    }

    .ae-save-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ae-btn {
        width: 100%;
        justify-content: center;
    }

    .ae-delete-confirm__actions {
        flex-direction: column;
    }
}
