:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.main-content {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-section label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

#emailInput {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    font-size: 1rem;
    font-family: 'Monaco', 'Courier New', monospace;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s;
    resize: vertical;
    line-height: 1.5;
}

#emailInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* Results Section */
.results-section {
    display: none;
    margin-top: 2rem;
}

.results-section.visible {
    display: block;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow);
}

.stat-card.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.valid {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.invalid {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-card.duplicate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: 'Monaco', 'Courier New', monospace;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border-radius: 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Emails List */
.emails-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border-left: 4px solid;
    gap: 1rem;
}

.email-item.valid {
    border-left-color: var(--success-color);
}

.email-item.invalid {
    border-left-color: var(--danger-color);
}

.email-item.duplicate {
    border-left-color: var(--warning-color);
}

.email-content {
    flex: 1;
    min-width: 0;
}

.email-address {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-all;
}

.email-reason {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.email-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.email-badge.valid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.email-badge.invalid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.email-badge.duplicate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Info Section */
.info-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.info-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    color: var(--text-secondary);
}

.info-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .actions {
        flex-direction: column;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 2rem;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .email-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
