/* ============================================================
   TempMail Pro - Premium CSS
   Theme: White + Blue + Glassmorphism
============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f0f4ff;
    --bg-card: #ffffff;
    --bg-sidebar: #f8faff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #2563eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 24px rgba(37,99,235,0.10);
    --shadow-lg: 0 8px 40px rgba(37,99,235,0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ── */
.navbar {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    padding: 14px 0;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.brand-pro {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge-live {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(16,185,129,0.3);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── Hero Section ── */
.hero-section {
    background: linear-gradient(180deg, #1e40af 0%, #2563eb 40%, #f0f4ff 100%);
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 50%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(59,130,246,0.3) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    color: #e0f2fe;
    padding: 7px 18px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(90deg, #bfdbfe, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 1.05rem;
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Main Section ── */
.main-section {
    flex: 1;
    padding: 0 0 60px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

/* ── Email Card ── */
.email-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 16px;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.email-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8faff, #eff6ff);
    border-bottom: 1px solid var(--border);
}

.fw-600 { font-weight: 600; font-size: 0.9rem; color: var(--text-main); }

.timer-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border: 1px solid #fcd34d;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    color: #92400e;
}

.timer-text {
    font-weight: 700;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.timer-text.urgent {
    color: #dc2626;
    animation: timerBlink 1s ease-in-out infinite;
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.email-display-wrapper {
    padding: 24px;
    background: linear-gradient(135deg, #f8faff 0%, #fff 100%);
}

.email-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 12px;
    font-size: 0.9rem;
}

.email-display {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--primary-light);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 0 0 4px rgba(37,99,235,0.06);
    animation: emailFade 0.4s ease-out;
}

@keyframes emailFade {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.email-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    word-break: break-all;
    flex: 1;
    letter-spacing: 0.3px;
}

.email-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.4);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary-light) !important;
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-glow);
    transform: translateY(-1px);
}

.btn-success-soft {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.btn-success-soft:hover {
    background: linear-gradient(135deg, #a7f3d0, #6ee7b7);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Timer Progress Bar */
.timer-progress-wrapper {
    height: 4px;
    background: #e2e8f0;
}

.timer-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    transition: width 1s linear, background-color 0.5s;
    border-radius: 0 2px 2px 0;
}

.timer-progress-bar.urgent {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* ── Stats Row ── */
.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

.pulse-ring {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--success);
    animation: pulseRing 1.5s ease-out infinite;
    opacity: 0;
}

@keyframes pulseRing {
    0% { opacity: 0.8; transform: scale(0.8); }
    100% { opacity: 0; transform: scale(2); }
}

/* ── Inbox Card ── */
.inbox-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: slideUp 0.5s ease-out 0.1s both;
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8faff, #eff6ff);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.badge-count {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary-light);
    margin: 0 auto 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state h5 {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    max-width: 320px;
    margin: 0 auto 24px;
}

.empty-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 260px;
    margin: 0 auto;
    text-align: left;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-main);
}

.step-num {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Message Item ── */
.message-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.message-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.message-item:hover {
    background: linear-gradient(135deg, #f0f7ff, #fafbff);
}

.message-item:hover::before {
    opacity: 1;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item.unread .msg-subject {
    font-weight: 700;
}

.msg-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.msg-body { flex: 1; min-width: 0; }

.msg-from {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-subject {
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.msg-time {
    font-size: 0.72rem;
    color: var(--text-light);
    white-space: nowrap;
}

.msg-new-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Features Section ── */
.features-row { animation: slideUp 0.5s ease-out 0.2s both; }

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    margin: 0 auto 14px;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.feature-card h6 {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ── Modal ── */
.modal-modern {
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

.modal-header-modern {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    padding: 20px 24px;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
}

.modal-meta {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    margin-top: 4px;
}

.btn-close-modern {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 12px;
}

.btn-close-modern:hover {
    background: rgba(255,255,255,0.25);
}

.modal-body-modern {
    padding: 24px;
    background: #fafbff;
}

#messageContent {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-main);
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
    min-height: 120px;
    word-break: break-word;
    overflow-x: auto;
}

/* ── Toast ── */
.toast-modern {
    background: var(--text-main);
    color: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 200px;
}

.toast-body {
    padding: 12px 18px;
}

/* ── Footer ── */
.footer {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: rgba(255,255,255,0.8);
    padding: 28px 0;
    font-size: 0.875rem;
}

.footer strong { color: #fff; }

/* ── Spinner inside btn ── */
.btn .spinner-border-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ── New message highlight ── */
@keyframes newMessagePop {
    0% { opacity: 0; transform: translateX(-10px); background: #eff6ff; }
    30% { background: #dbeafe; }
    100% { opacity: 1; transform: translateX(0); background: transparent; }
}

.message-item.new-entry {
    animation: newMessagePop 0.6s ease-out;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 0.9rem; }
    .hero-section { padding: 40px 0 70px; }
    .email-text { font-size: 0.88rem; }
    .email-actions { gap: 8px; }
    .action-btn { padding: 9px 14px; font-size: 0.8rem; }
    .message-item { padding: 14px 16px; }
    .email-card-header { padding: 14px 16px; }
    .email-display-wrapper { padding: 16px; }
    .inbox-header { padding: 14px 16px; }
    .stats-row { flex-direction: column; gap: 8px; align-items: flex-start; }
    .feature-card { padding: 18px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.6rem; }
    .timer-wrapper { font-size: 0.72rem; padding: 5px 10px; }
    .ms-auto { margin-left: auto !important; }
}
