/* Email Header Analyzer Styles */
.eha-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Header */
.eha-header {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.eha-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 4rem;
}

.eha-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.eha-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eha-title-section h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.eha-title-section p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.eha-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.eha-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.eha-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #d1d5db !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
}

.eha-btn-primary {
    background: #059669;
    color: white;
    border-color: #059669;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.eha-btn-primary:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

.eha-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: transparent;
}

.eha-btn-ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

.eha-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Layout */
.eha-main {
    padding: 0 1rem;
}

.eha-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .eha-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.eha-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.eha-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.eha-card-header h2,
.eha-card h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.eha-card h3 {
    padding: 1.5rem 1.5rem 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid #f3f4f6;
}

/* Instructions */
.eha-instructions {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.eha-instructions h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    padding: 0;
    border: none;
}

.eha-provider-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.eha-provider {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.eha-provider-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.eha-provider-name {
    font-weight: 600;
}

.eha-gmail {
    color: #dc2626;
}

.eha-outlook {
    color: #2563eb;
}

.eha-proton {
    color: #7c3aed;
}

.eha-apple {
    color: #6b7280;
}

.eha-tip {
    padding: 0.75rem;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #1e40af;
}

/* Input Area */
.eha-input-area {
    padding: 1.5rem;
}

#eha-headers-input {
    width: 100%;
    height: 16rem;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    resize: vertical;
    background: #fafafa;
}

#eha-headers-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.eha-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.eha-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.eha-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #10b981;
}

.eha-status-dot.waiting {
    background: #f59e0b;
}

.eha-status-dot.ready {
    background: #10b981;
}

/* Stats Grid */
.eha-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.eha-stat {
    text-align: center;
}

.eha-stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.eha-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.eha-stat-primary {
    color: #3b82f6;
}

.eha-stat-green {
    color: #10b981;
}

.eha-stat-yellow {
    color: #f59e0b;
}

.eha-stat-blue {
    color: #06b6d4;
}

/* Waiting State */
.eha-waiting {
    padding: 3rem 1.5rem;
}

.eha-waiting-content {
    text-align: center;
}

.eha-waiting-content svg {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.eha-waiting-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #111827;
    padding: 0;
    border: none;
}

.eha-waiting-content p {
    margin: 0;
    color: #6b7280;
}

/* Authentication Results */
.eha-auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.eha-auth-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    text-align: center;
}

.eha-auth-type {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.eha-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid;
}

.eha-status-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.eha-status-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.eha-status-warning {
    background: #fef3c7;
    color: #d97706;
    border-color: #fde68a;
}

.eha-auth-details {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

/* Routing Path */
.eha-routing-list {
    padding: 1.5rem;
}

.eha-hop {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(243, 244, 246, 0.3);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    position: relative;
}

.eha-hop:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    width: 2px;
    height: calc(100% - 20px);
    background: #e5e7eb;
}

.eha-hop-number {
    width: 2rem;
    height: 2rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.eha-hop-details {
    flex: 1;
}

.eha-hop-server {
    font-family: monospace;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.eha-hop-ip {
    font-family: monospace;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.eha-hop-location {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.eha-hop-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Alerts */
.eha-alert {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.eha-alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.eha-alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.eha-alert-warning {
    background: #fef3c7;
    color: #d97706;
    border-color: #fde68a;
}

/* Content Areas */
.eha-security-content,
.eha-spam-content,
.eha-ai-content,
.eha-basic-info,
.eha-auth-info {
    padding: 1.5rem;
}

.eha-basic-info p,
.eha-auth-info p {
    margin: 0.5rem 0;
}

.eha-spam-score {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.eha-spam-indicators h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.eha-spam-indicators ul {
    margin: 0;
    padding-left: 1.5rem;
}

.eha-spam-indicators li {
    margin-bottom: 0.25rem;
}

.eha-ai-likelihood {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Loading Animation */
.eha-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: eha-spin 1s linear infinite;
}

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

/* Utilities */
.eha-text-center {
    text-align: center;
}

.eha-text-sm {
    font-size: 0.875rem;
}

.eha-text-xs {
    font-size: 0.75rem;
}

.eha-font-mono {
    font-family: monospace;
}

.eha-font-bold {
    font-weight: 700;
}

.eha-mb-4 {
    margin-bottom: 1rem;
}

.eha-mt-4 {
    margin-top: 1rem;
}

.eha-hidden {
    display: none;
}