/* ========================================================
   TEMPMAIL - MODERN UI / UX STYLES
   Responsive, Dark/Light Mode, Clean Minimalist
   ======================================================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-radius: 16px;
    --transition-speed: 0.2s;
}

[data-bs-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    --bg-page: #0b1120;
    --bg-card: #151e32;
    --border-color: #26334d;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.main-content {
    flex: 1 0 auto;
}

/* Navbar */
.navbar-custom {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--primary-color) !important;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Cards */
.custom-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-speed);
}

/* Mailbox Hero Box */
.email-generator-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.04) 0%, rgba(37, 99, 235, 0.01) 100%);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
}

.email-address-display {
    font-family: monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    word-break: break-all;
}

/* Countdown Progress */
.expiry-progress {
    height: 6px;
    border-radius: 4px;
    background-color: var(--border-color);
    overflow: hidden;
}

.expiry-progress .progress-bar {
    transition: width 1s linear;
    background-color: var(--primary-color);
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    transition: all var(--transition-speed);
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

/* Inbox List */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.email-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
}

.email-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.email-item.unread {
    border-left: 4px solid var(--primary-color);
    background: var(--primary-light);
}

.sender-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.email-content-preview {
    flex: 1;
    min-width: 0;
}

.email-subject {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-sender {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.email-snippet {
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, rgba(190, 190, 190, 0.15) 25%, rgba(120, 120, 120, 0.25) 37%, rgba(190, 190, 190, 0.15) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.skeleton-item {
    height: 75px;
    margin-bottom: 0.75rem;
    border-radius: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: 1rem;
}

/* Email Viewer */
.email-view-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.75rem;
}

.email-body-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 200px;
    overflow-x: auto;
    word-break: break-word;
}

.attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-main);
    transition: all var(--transition-speed);
}

.attachment-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Toast Container */
.toast-container-custom {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1090;
}

/* Footer */
.footer-custom {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.75rem 0;
    margin-top: 3rem;
}
