* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-weight: normal;
    font-size: 1.2em;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.category-card.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.category-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.category-name {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.category-desc {
    font-size: 0.9em;
    opacity: 0.8;
}

.upload-section {
    display: none;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.upload-section.active {
    display: block;
}

.upload-section h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.database-info {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.file-upload-box {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: white;
    margin: 20px 0;
}

.file-upload-box h4 {
    margin-bottom: 20px;
}

.file-upload-box.active {
    border-color: #667eea;
    background: #f3f4ff;
}

input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
}

.file-label:hover {
    background: #5a55d2;
}

#csvInfo {
    margin-top: 15px;
    color: #666;
    font-size: 0.9em;
}

.process-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loader {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loader p {
    margin-top: 10px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.results {
    display: none;
    margin-top: 30px;
}

.results h3 {
    text-align: center;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-box {
    background: white;
    border: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    color: #667eea;
    font-weight: bold;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}