/* Temporary Mail - Dark Theme CSS */

:root {
    /* Dark Theme Colors */
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252540;
    --bg-input: #12121f;
    --bg-features: rgba(124, 58, 237, 0.1);

    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #6b6b80;

    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-light: #a78bfa;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* Gradient Background */
    --gradient-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f1a 100%);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* App Container */
.app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* Background Gradient */
.bg-gradient {
    position: fixed;
    inset: 0;
    background: var(--gradient-bg);
    z-index: 0;
}

.bg-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-5%, -5%);
    }
}

/* Pages */
.page {
    display: none;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

/* ==================== */
/* Page 1: Landing Card */
/* ==================== */

.card-landing {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Features Box */
.features-box {
    background: var(--bg-features);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
}

.features-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 0.75rem;
}

.features-list {
    list-style: none;
    padding-left: 1.5rem;
}

.features-list li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.25rem 0;
    position: relative;
}

.features-list li::before {
    content: '•';
    position: absolute;
    left: -1rem;
    color: var(--accent);
}

/* Input Section */
.input-section {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-email {
    flex: 1;
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 0.75rem 0 0 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-email:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.input-email::placeholder {
    color: var(--text-muted);
}

/* Input Group */
.input-group {
    display: flex;
}

.input-email {
    flex: 1;
    min-width: 0;
}

.domain-select {
    padding: 0 1rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0;
    color: var(--accent-light);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.domain-select:focus {
    border-color: var(--accent);
}

.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-left: none;
    border-radius: 0 0.75rem 0.75rem 0;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
}

.btn-copy:hover {
    background: var(--accent-hover);
}

.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
}

/* Card Actions */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
    border-color: var(--accent);
}

.btn-action {
    background: var(--accent);
    color: white;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.btn-action:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==================== */
/* Page 2: Inbox        */
/* ==================== */

.card-inbox {
    max-width: 900px;
}

.inbox-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.inbox-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.inbox-header h2 span:first-child {
    font-size: 1.75rem;
}

#inboxEmail {
    color: var(--accent-light);
}

.inbox-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Inbox Table */
.inbox-table-container {
    overflow-x: auto;
}

.inbox-table {
    width: 100%;
    border-collapse: collapse;
}

.inbox-table th,
.inbox-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.inbox-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.inbox-table th span {
    margin-right: 0.5rem;
}

.inbox-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}

.inbox-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.inbox-table td {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.inbox-table td:first-child {
    color: var(--accent-light);
    font-weight: 500;
}

.inbox-table td:nth-child(2) {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-table td:nth-child(3) {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.new {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-light);
}

/* Empty State */
.inbox-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.inbox-empty.show {
    display: flex;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.inbox-empty p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==================== */
/* Page 3: Email Detail */
/* ==================== */

.card-detail {
    max-width: 800px;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Meta Info */
.detail-meta {
    background: var(--bg-input);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.meta-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-label {
    width: 120px;
    flex-shrink: 0;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-value {
    flex: 1;
    color: var(--text-primary);
    word-break: break-word;
}

/* Email Content */
.detail-content {
    background: var(--bg-input);
    border-radius: 1rem;
    overflow: hidden;
}

.content-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card-hover);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.content-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.7;
    color: var(--text-secondary);
}

.content-body img {
    max-width: 100%;
    height: auto;
}

.content-body a {
    color: var(--accent-light);
}

/* Detail Footer */
.detail-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ==================== */
/* Toast Notification   */
/* ==================== */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==================== */
/* Responsive           */
/* ==================== */

@media (max-width: 640px) {
    .app {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: 1rem;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .inbox-header h2 {
        font-size: 1.125rem;
        flex-direction: column;
    }

    .inbox-table th,
    .inbox-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .meta-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .meta-label {
        width: 100%;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .inbox-actions,
    .detail-actions {
        flex-direction: column;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}