:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --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;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    min-height: 100vh;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 45px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
}

.logo small {
    font-size: 0.65rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-transform: uppercase;
}

#theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#theme-toggle:hover {
    background: var(--border);
    border-color: var(--primary-light);
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 50px 20px;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mrz-tagline {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 30px;
    color: var(--text-muted);
}

.mrz-tagline span {
    color: #818cf8;
    font-weight: 700;
}

.email-generator {
    max-width: 650px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    align-items: center;
    background: #0f172a;
    padding: 8px;
    border-radius: 20px;
    border: 2px solid var(--border);
    margin-bottom: 25px;
    transition: border-color 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary);
}

#email-address {
    background: transparent;
    border: none;
    color: white;
    padding: 10px 20px;
    flex: 1;
    font-size: 1.3rem;
    font-weight: 600;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.domain-select {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: #818cf8;
    padding: 10px 15px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    margin-right: 10px;
    font-size: 0.95rem;
}

#copy-btn {
    background: var(--gradient);
    border: none;
    color: white;
    width: 54px;
    height: 54px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

#copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

button.primary, button.secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

button.primary {
    background: var(--gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

button.secondary {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: white;
}

button:hover {
    transform: translateY(-3px);
}

/* Restore Section */
.restore-box {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.restore-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.restore-actions {
    display: flex;
    gap: 10px;
    max-width: 450px;
    margin: 0 auto;
}

.restore-actions input {
    background: #0f172a;
    border: 1px solid var(--border);
    color: white;
    padding: 12px 20px;
    border-radius: 14px;
    flex: 1;
    outline: none;
}

/* Inbox Section */
.inbox-section {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 30px;
    border: 1px solid var(--border);
    min-height: 450px;
    box-shadow: var(--shadow-lg);
}

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

.badge {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

.empty-state {
    text-align: center;
    padding: 100px 0;
    color: var(--text-muted);
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid #818cf8;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

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

.email-item {
    background: rgba(15, 23, 42, 0.4);
    padding: 18px 25px;
    border-radius: 18px;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 1px solid transparent;
    animation: slideIn 0.5s ease-out backwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.email-item:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: var(--primary-light);
    transform: scale(1.01);
}

.email-info h4 { 
    margin-bottom: 5px; 
    font-size: 1.1rem;
    color: #fff;
}

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

.email-time { 
    font-size: 0.85rem; 
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(15px);
    z-index: 2000;
}

.modal-content {
    background: var(--card-bg);
    width: 95%;
    max-width: 850px;
    margin: 5vh auto;
    padding: 0;
    border-radius: 28px;
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.3);
}

.modal-header h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    background: #fff; /* White background for email content */
    color: #333;
    flex: 1;
}

.close-modal {
    position: absolute;
    right: 25px; top: 20px;
    font-size: 2.5rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.close-modal:hover { color: white; }

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

/* Responsive */
@media (max-width: 600px) {
    h1 { font-size: 2.2rem; }
    .input-group { flex-direction: column; border-radius: 20px; padding: 15px; }
    #email-address { width: 100%; text-align: center; padding: 10px 0; }
    .domain-select { width: 100%; margin-right: 0; margin-bottom: 15px; border-left: none; border-top: 1px solid var(--border); padding-top: 15px; }
    #copy-btn { width: 100%; height: 50px; }
    .actions { flex-direction: column; }
}

