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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-button.active {
    background: white;
    color: #667eea;
}

.tab-content {
    display: none;
}

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

.card {
    background: white;
    border-radius: 0 0 15px 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
}

.form-group input[type="email"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.file-input-wrapper {
    padding: 12px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.file-name {
    color: #888;
    font-size: 0.95rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.result-email {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    word-break: break-all;
}

.status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.status-valid {
    background: #d4edda;
    color: #155724;
}

.status-invalid {
    background: #f8d7da;
    color: #721c24;
}

.status-risky {
    background: #fff3cd;
    color: #856404;
}

.result-section {
    margin: 15px 0;
}

.result-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.result-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.result-item strong {
    display: block;
    color: #555;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.result-item span {
    color: #333;
    font-size: 1rem;
}

.analysis-reasons {
    list-style: none;
    padding: 0;
}

.analysis-reasons li {
    padding: 10px;
    margin: 8px 0;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.recommendation {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #2196f3;
    margin-top: 15px;
}

.upload-instructions {
    background: #f8f9ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.upload-instructions h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.upload-instructions ul {
    list-style-position: inside;
    color: #555;
}

.upload-instructions li {
    margin: 5px 0;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.stat-card .stat-label {
    color: #888;
    font-size: 0.9rem;
    margin-top: 5px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.results-table tr:hover {
    background: #f8f9ff;
}

.table-container {
    max-height: 500px;
    overflow-y: auto;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.export-btn {
    margin-top: 20px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.export-btn:hover {
    background: #218838;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.9;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #f5c6cb;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

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

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 8px;
    }
}

/* Enhanced Analysis Styles */
.reason-success {
    border-left-color: #28a745;
}

.reason-error {
    border-left-color: #dc3545;
}

.reason-info {
    border-left-color: #17a2b8;
}

.reason-warning {
    border-left-color: #ffc107;
}

.reason-message {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.reason-detail {
    font-size: 0.9rem;
    color: #666;
    padding-left: 10px;
    margin-top: 5px;
}

/* Warnings Section */
.warnings-section {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-top: 15px;
}

.warnings-section h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1rem;
}

.analysis-warnings {
    list-style: none;
    padding: 0;
}

.analysis-warnings li {
    padding: 10px;
    margin: 8px 0;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.warning-message {
    font-weight: 600;
    color: #856404;
    margin-bottom: 4px;
}

.warning-detail {
    font-size: 0.9rem;
    color: #666;
    padding-left: 10px;
    margin-top: 5px;
}

.suggested-email {
    margin-top: 8px;
    padding: 8px;
    background: #e7f3ff;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #004085;
}

/* Confidence Score Section */
.confidence-section {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-top: 15px;
}

.confidence-section h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1rem;
}

.confidence-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.confidence-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.confidence-level {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #555;
}

.confidence-factors {
    margin-top: 15px;
}

.confidence-factors summary {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    padding: 8px;
    background: white;
    border-radius: 6px;
    list-style: none;
}

.confidence-factors summary::-webkit-details-marker {
    display: none;
}

.confidence-factors summary:hover {
    background: #f0f0f0;
}

.confidence-factors ul {
    margin-top: 10px;
    padding-left: 20px;
}

.confidence-factors li {
    margin: 8px 0;
    color: #333;
}

.confidence-factors .positive {
    color: #28a745;
    font-weight: 600;
}

.confidence-factors .negative {
    color: #dc3545;
    font-weight: 600;
}

/* Risk Level Badges */
.risk-level {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.risk-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-left: 8px;
}

.risk-low {
    background: #d4edda;
    color: #155724;
}

.risk-medium {
    background: #fff3cd;
    color: #856404;
}

.risk-high {
    background: #f8d7da;
    color: #721c24;
}

.risk-critical {
    background: #f5c6cb;
    color: #491217;
    font-weight: 700;
}
