/* ========================================
   MishiTV — Premium Netflix Inbox Dashboard
   Gmail-Style Redesign · Navy/Teal Palette
   ======================================== */

/* --- DESIGN TOKENS --- */
:root {
    --primary: #4fc3f7;
    --primary-dim: rgba(79, 195, 247, 0.12);
    --primary-glow: rgba(79, 195, 247, 0.25);
    --secondary: #1a237e;
    --secondary-dim: rgba(26, 35, 126, 0.2);
    --accent: #80deea;
    --accent-dim: rgba(128, 222, 234, 0.1);
    --dark-bg: #0b1120;
    --dark-surface: rgba(12, 18, 38, 0.92);
    --dark-glass: rgba(10, 15, 32, 0.85);
    --dark-card: rgba(16, 24, 48, 0.7);
    --light-glass: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(79, 195, 247, 0.08);
    --border-hover: rgba(79, 195, 247, 0.2);
    --text-primary: #e8eaf6;
    --text-secondary: #90a4ae;
    --text-muted: #546e7a;
    --success: #66bb6a;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- BACKGROUND --- */
.login-page,
.dashboard-page {
    background: var(--dark-bg);
    position: relative;
}

.login-page::before,
.dashboard-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(79, 195, 247, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 20%, rgba(26, 35, 126, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 90% 50% at 50% 50%, rgba(128, 222, 234, 0.04) 0%, transparent 70%),
        linear-gradient(180deg, #0b1120 0%, #0d1a2e 40%, #111d35 70%, #0b1120 100%);
    z-index: 0;
    animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        opacity: 1;
    }
}

/* ===================
   LOGIN PAGE
   =================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding: 20px;
}

/* Floating decorative orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -80px;
    left: -80px;
    animation: float1 12s ease-in-out infinite;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: var(--secondary);
    bottom: -60px;
    right: -60px;
    animation: float2 15s ease-in-out infinite;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #1565c0;
    top: 50%;
    left: 60%;
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-20px, -20px) scale(1.15);
    }
}

@keyframes float3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-30px, 20px) scale(0.9);
    }
}

/* Login Card */
.login-card {
    background: var(--dark-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--light-glass);
    border-radius: 24px;
    padding: 50px 40px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(79, 195, 247, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: cardEnter 0.6s ease-out;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 35px;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(79, 195, 247, 0.3));
    animation: logoPulse 3s ease-in-out infinite;
    border-radius: 16px;
}

@keyframes logoPulse {

    0%,
    100% {
        filter: drop-shadow(0 4px 12px rgba(79, 195, 247, 0.3));
    }

    50% {
        filter: drop-shadow(0 6px 20px rgba(79, 195, 247, 0.5));
    }
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 3px;
    margin: 0;
}

.logo-accent {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    transition: color 0.3s;
}

.login-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    transition: all 0.3s ease;
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.15);
}

.login-input:focus+.input-icon,
.input-group:focus-within .input-icon {
    color: var(--primary);
}

.login-input::placeholder {
    color: var(--text-muted);
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), #1565c0);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(79, 195, 247, 0.3), 0 5px 15px rgba(21, 101, 192, 0.2);
}

.login-btn:hover::before {
    transform: translateX(100%);
}

.login-btn:active {
    transform: translateY(0);
}

/* Login Footer */
.login-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
}

.footer-line {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

/* ===================
   DASHBOARD PAGE
   =================== */

/* Navbar */
.inbox-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 60px;
    background: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1rem;
}

.nav-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 2px 6px rgba(79, 195, 247, 0.2));
}

.nav-logo {
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 1.1rem;
}

.nav-divider {
    color: var(--text-muted);
    font-weight: 300;
}

.nav-section {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Refresh Button */
.btn-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-refresh:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: var(--border-hover);
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.1);
}

.btn-refresh:active {
    transform: scale(0.96);
}

.btn-refresh .refresh-icon {
    display: flex;
    transition: transform 0.4s ease;
}

.btn-refresh.loading .refresh-icon {
    animation: spinRefresh 0.8s linear infinite;
}

@keyframes spinRefresh {
    to {
        transform: rotate(360deg);
    }
}

.refresh-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(102, 187, 106, 0.4);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 5px rgba(102, 187, 106, 0);
    }
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-logout:hover {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
    border-color: rgba(239, 83, 80, 0.2);
}

/* Inbox Toolbar */
.inbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--dark-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toolbar-label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

.toolbar-count {
    font-weight: 700;
    color: var(--primary);
}

/* Main Content */
.inbox-main {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    padding: 76px 16px 40px;
}

/* Loading */
.loading-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-subtle);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: loadPulse 1.5s ease-in-out infinite;
}

@keyframes loadPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===========================
   GMAIL-STYLE EMAIL LIST
   =========================== */

.inbox-list {
    display: flex;
    flex-direction: column;
    background: var(--dark-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Email Row */
.mail-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    gap: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(79, 195, 247, 0.05);
    transition: background var(--transition-fast);
    animation: rowFadeIn 0.4s ease-out both;
    position: relative;
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mail-row:last-child {
    border-bottom: none;
}

.mail-row:hover {
    background: rgba(79, 195, 247, 0.04);
}

.mail-row.expanded {
    background: rgba(79, 195, 247, 0.06);
}

/* Left accent bar on hover */
.mail-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform var(--transition-smooth);
    border-radius: 0 2px 2px 0;
}

.mail-row:hover::before,
.mail-row.expanded::before {
    transform: scaleY(1);
}

/* Avatar */
.mail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(21, 101, 192, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    flex-shrink: 0;
    border: 1px solid rgba(79, 195, 247, 0.1);
    text-transform: uppercase;
}

/* Mail info */
.mail-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mail-sender {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-subject {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right side */
.mail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mail-date {
    color: var(--text-muted);
    font-size: 0.73rem;
    white-space: nowrap;
    font-weight: 500;
}

.mail-expand-icon {
    color: var(--text-muted);
    transition: all var(--transition-smooth);
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.mail-expand-icon:hover {
    background: var(--primary-dim);
    color: var(--primary);
}

.mail-row.expanded .mail-expand-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Mail Body */
.mail-body-wrapper {
    display: none;
    border-bottom: 1px solid rgba(79, 195, 247, 0.05);
}

.mail-row.expanded+.mail-body-wrapper {
    display: block;
    animation: bodySlide 0.35s ease-out;
}

@keyframes bodySlide {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mail-body-content {
    background: #f8f9fa;
    color: #222;
    padding: 24px 28px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.92rem;
    line-height: 1.6;
    border-top: 1px solid var(--border-subtle);
}

.mail-body-content::-webkit-scrollbar {
    width: 6px;
}

.mail-body-content::-webkit-scrollbar-track {
    background: #e8e8e8;
}

.mail-body-content::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.empty-state h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===================
   RESPONSIVE
   =================== */
@media (max-width: 600px) {
    .login-card {
        padding: 35px 24px 30px;
    }

    .logo-text {
        font-size: 1.6rem;
    }

    .logo-image {
        width: 64px;
        height: 64px;
    }

    .inbox-navbar {
        padding: 0 12px;
        height: 52px;
    }

    .nav-divider,
    .nav-section {
        display: none;
    }

    .btn-refresh span.refresh-label {
        display: none;
    }

    .btn-refresh {
        padding: 8px 12px;
    }

    .refresh-status {
        display: none;
    }

    .inbox-main {
        padding: 64px 8px 30px;
    }

    .inbox-toolbar {
        padding: 8px 14px;
        border-radius: var(--radius-sm);
    }

    .mail-row {
        padding: 12px 14px;
        gap: 10px;
    }

    .mail-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.82rem;
    }

    .mail-subject {
        font-size: 0.84rem;
    }

    .mail-date {
        display: none;
    }

    .mail-body-content {
        padding: 16px;
    }

    .nav-logo-img {
        width: 30px;
        height: 30px;
    }
}