:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-primary: #06b6d4;
    /* Cyan 500 */
    --accent-secondary: #0891b2;
    /* Cyan 600 */
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Typography */
.text-gradient {
    color: var(--accent-primary);
}

header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInDown 0.5s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.logo i {
    color: var(--accent-primary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Clean Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Email Generator Section */
.email-generator-section {
    animation: fadeInUp 0.5s ease-out;
}

.email-generator-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.email-display-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.email-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    color: var(--text-muted);
    font-size: 1.2rem;
}

#email-address {
    width: 100%;
    padding: 1.2rem 1rem 1.2rem 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    cursor: default;
}

#email-address:focus {
    border-color: var(--accent-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Buttons */
.btn {
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn i {
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Toast */
.toast {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

.toast:not(.hidden) {
    top: -30px;
    opacity: 1;
}

/* Inbox Section */
.inbox-section {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.7s ease-out;
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ping {
    width: 10px;
    height: 10px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    position: relative;
}

.ping::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--accent-primary);
    border-radius: 50%;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.inbox-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.inbox-list::-webkit-scrollbar {
    width: 6px;
}

.inbox-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.inbox-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    text-align: center;
    gap: 1rem;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

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

/* Email Item (in list) */
.email-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.email-item:hover {
    background: #f8fafc;
    border-color: var(--accent-primary);
    transform: translateX(3px);
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-item-sender {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.email-item-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

/* Modal / Email Reader */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    opacity: 1;
    pointer-events: auto;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    margin: 0 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
}

.token-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
    font-weight: bold;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
    transform: scale(0.95);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: var(--text-main);
    word-break: break-word;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-meta {
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-meta span {
    color: var(--text-main);
}

.modal-body {
    flex: 1;
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

#modal-iframe {
    width: 100%;
    flex: 1;
    min-height: 400px;
    border: none;
    display: none;
}

#modal-text {
    flex: 1;
    padding: 1.5rem;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
    min-height: 400px;
    overflow-y: auto;
    display: none;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@media (max-width: 640px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .email-display-container {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }
}