
:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--primary);
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-main);
}

.btn-github {
    background-color: #24292F;
    color: white !important;
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.btn-github:hover {
    background-color: #000000;
}

/* Demo Banner */
.demo-banner {
    background-color: #FEF3C7;
    color: #92400E;
    text-align: center;
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #FDE68A;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

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

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

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

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="text"], textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #F9FAFB;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: #FFFFFF;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 1rem;
    position: relative;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

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

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

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-color);
    border-color: #D1D5DB;
}

.btn-danger-text {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 500;
}
.btn-danger-text:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #F87171;
}

.hidden {
    display: none !important;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    background-color: var(--card-bg);
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
    height: 100%;
}

.empty-icon {
    color: #D1D5DB;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

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

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-work { background-color: #DBEAFE; color: #1E40AF; }
.badge-personal { background-color: #D1FAE5; color: #065F46; }
.badge-important { background-color: #FEE2E2; color: #991B1B; }
.badge-spam { background-color: #F3F4F6; color: #374151; }

.result-group {
    margin-bottom: 1.5rem;
}

.result-group h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 1s ease-out;
}

.confidence-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.summary-box {
    background-color: #F3F4F6;
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.reply-box {
    background-color: #F9FAFB;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    min-height: 100px;
}

.demo-notice {
    margin-top: 1rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--warning);
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
}

/* Loader */
.loader {
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 2px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    position: absolute;
}
.loader-dark {
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}
.loader-container {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

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

/* History Table */
.table-container {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 500;
}
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.table tr:last-child td {
    border-bottom: none;
}
.col-summary {
    max-width: 300px;
}
.summary-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* About Page */
.about-card {
    max-width: 800px;
    margin: 0 auto;
}
.lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}
.divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 2rem 0;
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.tech-item {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}
.about-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    background-color: white;
}
