/* ============================
   OTP EMAIL FAKE - BULK READER
   Light theme - sync with global
============================ */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --ef-primary: #2563eb;
    --ef-primary-dark: #1d4ed8;
    --ef-primary-light: #eff6ff;
    --ef-green: #16a34a;
    --ef-green-light: #ecfdf3;
    --ef-red: #dc2626;
    --ef-red-light: #fef2f2;
    --ef-yellow: #ca8a04;
    --ef-yellow-light: #fefce8;
    --ef-ink: #0f172a;
    --ef-muted: #64748b;
    --ef-border: #e2e8f0;
    --ef-surface: #ffffff;
    --ef-bg: #f8fafc;
    --ef-table-head: #f1f5f9;
    --ef-table-hover: #f0f4ff;
}

.ef-wrapper {
    width: 100%;
    padding: 24px 14px;
}

.ef-wrapper * {
    box-sizing: border-box;
    font-family: "Manrope", "Segoe UI", sans-serif;
}

.ef-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--ef-surface);
    border-radius: 18px;
    padding: 24px;
    border: 1px solid var(--ef-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.ef-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--ef-ink);
    margin: 0 0 20px 0;
}

/* ===== TEXTAREA ===== */
.ef-textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #cbd5f5;
    background: var(--ef-surface);
    color: var(--ef-ink);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: 0.2s ease;
}

.ef-textarea:focus {
    border-color: var(--ef-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ef-textarea::placeholder {
    color: var(--ef-muted);
}

/* ===== BUTTONS ===== */
.ef-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ef-btn {
    padding: 11px 22px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ef-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ef-btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.ef-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.ef-btn-outline {
    background: var(--ef-surface);
    color: var(--ef-muted);
    border: 1px solid var(--ef-border);
}

.ef-btn-outline:hover:not(:disabled) {
    background: var(--ef-bg);
    color: var(--ef-red);
    border-color: #fecaca;
}

.ef-btn-export {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.ef-btn-export:hover:not(:disabled) {
    filter: brightness(1.1);
}

/* ===== STATUS ===== */
.ef-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
}

.ef-status-loading {
    background: var(--ef-primary-light);
    border: 1px solid #bfdbfe;
    color: var(--ef-primary-dark);
}

.ef-status-success {
    background: var(--ef-green-light);
    border: 1px solid #bbf7d0;
    color: var(--ef-green);
}

.ef-status-error {
    background: var(--ef-red-light);
    border: 1px solid #fecaca;
    color: var(--ef-red);
}

.hidden {
    display: none !important;
}

/* ===== EMAIL SECTION ===== */
.ef-email-section {
    margin-top: 20px;
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: 14px;
    overflow: hidden;
    animation: efFadeIn 0.3s ease;
}

@keyframes efFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ef-email-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--ef-bg);
    border-bottom: 1px solid var(--ef-border);
    flex-wrap: wrap;
    gap: 8px;
}

.ef-email-label {
    color: var(--ef-muted);
    font-size: 14px;
}

.ef-email-label strong {
    color: var(--ef-ink);
}

.ef-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.ef-badge-success {
    background: var(--ef-green-light);
    border: 1px solid #bbf7d0;
    color: var(--ef-green);
}

.ef-badge-error {
    background: var(--ef-red-light);
    border: 1px solid #fecaca;
    color: var(--ef-red);
}

.ef-empty {
    padding: 24px;
    text-align: center;
    color: var(--ef-muted);
    font-size: 14px;
}

/* ===== TABLE ===== */
.ef-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ef-table th {
    background: var(--ef-table-head);
    color: var(--ef-ink);
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--ef-border);
    white-space: nowrap;
    font-size: 13px;
}

.ef-table td {
    padding: 12px 14px;
    color: var(--ef-ink);
    border-bottom: 1px solid var(--ef-border);
    vertical-align: middle;
}

.ef-table tbody tr:hover {
    background: var(--ef-table-hover);
}

.ef-table tbody tr:nth-child(even) {
    background: var(--ef-bg);
}

.ef-table tbody tr:nth-child(even):hover {
    background: var(--ef-table-hover);
}

/* ===== CODE CELL ===== */
.ef-code-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ef-otp-code {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--ef-yellow-light);
    border: 1px solid #fde68a;
    color: var(--ef-yellow);
    font-weight: 700;
    font-family: "Consolas", monospace;
    font-size: 14px;
}

.ef-no-code {
    color: var(--ef-muted);
    font-size: 12px;
}

.ef-copy-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: none;
    background: var(--ef-green);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ef-copy-btn:hover {
    background: #15803d;
}

/* ===== CONTENT CELL ===== */
.ef-content-cell {
    max-width: 400px;
}

.ef-content-preview {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ef-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ef-content-preview strong {
    color: var(--ef-ink);
    font-weight: 700;
}

.ef-view-more-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ef-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.ef-view-more-link:hover {
    color: var(--ef-primary-dark);
    text-decoration: underline;
}

/* ===== DETAIL TOGGLE ===== */
.ef-detail-toggle-wrap {
    padding: 12px 18px;
    border-top: 1px solid var(--ef-border);
}

.ef-btn-detail {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--ef-primary);
    background: var(--ef-primary-light);
    color: var(--ef-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.ef-btn-detail:hover {
    background: var(--ef-primary);
    color: #fff;
}

/* ===== EXPAND ROW (body email) ===== */
.ef-expand-row td {
    padding: 0 !important;
}

.ef-expand-row.hidden {
    display: none !important;
}

.ef-body-cell {
    background: var(--ef-bg);
}

.ef-body-content {
    padding: 14px 18px;
    border-top: 1px dashed var(--ef-border);
}

.ef-body-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--ef-muted);
}

.ef-body-meta strong {
    color: var(--ef-ink);
}

.ef-body-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ef-muted);
    margin-bottom: 6px;
}

.ef-body-text {
    font-size: 13px;
    color: var(--ef-ink);
    line-height: 1.7;
    background: var(--ef-surface);
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    padding: 12px 14px;
    max-height: 300px;
    overflow-y: auto;
    word-break: break-word;
    white-space: pre-wrap;
    font-family: "Consolas", "Courier New", monospace;
}

.ef-body-iframe {
    width: 100%;
    min-height: 200px;
    height: 400px;
    border: 1px solid var(--ef-border);
    border-radius: 10px;
    background: #fff;
    transition: height 0.3s ease;
}

/* ===== DETAIL CONTAINER ===== */
.ef-detail-container {
    animation: efFadeIn 0.3s ease;
    border-top: 2px solid var(--ef-primary);
}

.ef-detail-container.hidden {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ef-wrapper {
        padding: 10px 6px;
    }

    .ef-container {
        padding: 14px 10px;
        border-radius: 14px;
    }

    .ef-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .ef-textarea {
        min-height: 100px;
        font-size: 13px;
        padding: 10px;
    }

    .ef-actions {
        flex-direction: column;
    }

    .ef-btn {
        width: 100%;
    }

    .ef-email-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .ef-email-label {
        font-size: 12px;
        word-break: break-all;
    }

    .ef-table {
        border: none;
    }

    .ef-table thead {
        display: none;
    }

    .ef-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--ef-surface);
        border: 1px solid var(--ef-border);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 10px;
        gap: 6px;
    }

    .ef-table td {
        display: flex;
        padding: 2px 0;
        border: none;
        font-size: 13px;
        text-align: left;
    }

    .ef-table td::before {
        content: attr(data-label);
        font-weight: 700;
        min-width: 65px;
        color: var(--ef-muted);
        font-size: 12px;
        flex-shrink: 0;
    }

    .ef-code-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .ef-otp-code {
        font-size: 16px;
        padding: 4px 14px;
    }

    .ef-copy-btn {
        padding: 6px 16px;
        font-size: 13px;
    }

    .ef-content-cell {
        max-width: 100%;
    }

    .ef-content-preview {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .ef-detail-toggle-wrap {
        padding: 10px 12px;
    }

    .ef-btn-detail {
        font-size: 12px;
        padding: 10px 14px;
    }

    .ef-body-meta {
        flex-direction: column;
        gap: 4px;
    }

    .ef-body-text {
        font-size: 12px;
        max-height: 200px;
    }

    .ef-body-iframe {
        min-height: 150px;
        height: 300px;
    }
}
