/* DevMailbox module styles.
 *
 * Plain CSS, framework-free. The module ships with this file so the
 * panel renders the same way in any host regardless of whether the
 * host uses Tailwind, Bootstrap, or no CSS framework at all.
 *
 * Loaded by `resources/js/alpine/dev-mailbox.js` via `import './...'`
 * so Vite emits it as part of the dev-mailbox bundle. Scope: every
 * rule is namespaced under `.dev-mailbox-root` so the styles never
 * leak into the host page.
 */

.dev-mailbox-root,
.dev-mailbox-root * {
    box-sizing: border-box;
}

.dev-mailbox-root {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
}

/* Floating launcher button (bottom-right). */
.dev-mailbox-launcher {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 61;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #be185d;
    border-radius: 9999px;
    background: #db2777;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.dev-mailbox-launcher:hover {
    background: #ec4899;
}
.dev-mailbox-launcher svg {
    width: 16px;
    height: 16px;
}
.dev-mailbox-launcher-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    background: #fff;
    color: #be185d;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
}

/* Backdrop behind the slide-out panel. */
.dev-mailbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgb(0 0 0 / 0.4);
    cursor: pointer;
}

/* Slide-out panel itself. */
.dev-mailbox-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 62;
    width: 480px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1f2937;
    box-shadow: -10px 0 30px rgb(0 0 0 / 0.25);
}

/* Header strip inside the panel. */
.dev-mailbox-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #db2777;
    color: #fff;
    border-bottom: 1px solid #e5e7eb;
}
.dev-mailbox-panel-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dev-mailbox-panel-header-title svg {
    width: 18px;
    height: 18px;
}
.dev-mailbox-panel-header-title h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: inherit;
}
.dev-mailbox-panel-header-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    background: rgb(255 255 255 / 0.2);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.02em;
}
.dev-mailbox-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}
.dev-mailbox-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.dev-mailbox-icon-button:hover {
    background: rgb(255 255 255 / 0.2);
}
.dev-mailbox-icon-button svg {
    width: 16px;
    height: 16px;
}

/* Empty state inside the list. */
.dev-mailbox-empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* List of captured emails. */
.dev-mailbox-list {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dev-mailbox-list-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
}
.dev-mailbox-list-item:last-child {
    border-bottom: 0;
}
.dev-mailbox-list-item:hover {
    background: #f9fafb;
}
.dev-mailbox-list-item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.dev-mailbox-list-item-subject {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.dev-mailbox-list-item-to {
    margin: 0.125rem 0 0;
    font-size: 12px;
    color: #6b7280;
}
.dev-mailbox-list-item-to-label {
    font-weight: 500;
}
.dev-mailbox-list-item-time {
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
}

/* Detail (single-email) view. */
.dev-mailbox-detail {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.dev-mailbox-detail-meta {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.dev-mailbox-detail-back {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 12px;
    color: #db2777;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.dev-mailbox-detail-back:hover {
    text-decoration: underline;
}
.dev-mailbox-detail-subject {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}
.dev-mailbox-detail-fields {
    margin-top: 0.5rem;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
}
.dev-mailbox-detail-fields p {
    margin: 0;
}
.dev-mailbox-detail-fields strong {
    font-weight: 500;
    color: #374151;
}
.dev-mailbox-detail-body {
    flex: 1;
    overflow: hidden;
    background: #f9fafb;
}
.dev-mailbox-detail-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}
.dev-mailbox-detail-body pre {
    margin: 0;
    padding: 1rem;
    font-size: 12px;
    color: #111827;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
        "Courier New", monospace;
}
.dev-mailbox-detail-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    border-top: 1px solid #e5e7eb;
}
.dev-mailbox-delete-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #dc2626;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}
.dev-mailbox-delete-button:hover {
    background: #ef4444;
}
.dev-mailbox-delete-button svg {
    width: 14px;
    height: 14px;
}

/* Dark-mode flip when the host page declares `dark` on <html> or
 * `data-theme="dark"` on <body>. Keeps the panel readable on dark
 * backgrounds without depending on a CSS framework's dark variant.
 */
:where(html.dark, [data-theme="dark"]) .dev-mailbox-root {
    color: #e5e7eb;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-panel {
    background: #111827;
    color: #e5e7eb;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-panel-header {
    border-bottom-color: #374151;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-list-item {
    border-bottom-color: #1f2937;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-list-item:hover {
    background: rgb(31 41 55 / 0.6);
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-list-item-subject {
    color: #f3f4f6;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-list-item-to {
    color: #9ca3af;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-meta {
    border-bottom-color: #374151;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-subject {
    color: #f3f4f6;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-fields {
    color: #9ca3af;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-fields strong {
    color: #d1d5db;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-body {
    background: #030712;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-body pre {
    color: #e5e7eb;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-detail-footer {
    border-top-color: #374151;
}
:where(html.dark, [data-theme="dark"]) .dev-mailbox-empty {
    color: #9ca3af;
}
