/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Main Content */
.main {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 0;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    background: #eef1ff;
    border-color: #764ba2;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #666;
    margin-bottom: 1.5rem;
}

.file-info {
    font-size: 0.9rem;
    color: #888;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.results-header h2 {
    color: #333;
}

/* File Details */
.file-details {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.file-details p {
    margin: 0.25rem 0;
    color: #666;
}

/* Status Card */
.status-card {
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.status-card.valid {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.status-card.invalid {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Messages Container */
.messages-container {
    margin-bottom: 2rem;
}

.message-section {
    margin-bottom: 1.5rem;
}

.message-header {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.message-header.errors {
    background: #fee;
    color: #c33;
}

.message-header.warnings {
    background: #ffeaa7;
    color: #d63031;
}

.message-header.info {
    background: #e3f2fd;
    color: #1976d2;
}

.message-list {
    list-style: none;
    padding: 0;
}

.message-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid;
}

.message-item.error {
    border-left-color: #c33;
}

.message-item.warning {
    border-left-color: #ff9800;
}

.message-item.info {
    border-left-color: #2196f3;
}

/* Fields Container */
.fields-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.fields-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.fields-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.field-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.field-badge.detected {
    background: #d4edda;
    color: #155724;
}

.field-badge.missing {
    background: #f8d7da;
    color: #721c24;
}

.field-badge.extra {
    background: #fff3cd;
    color: #856404;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 0.9rem;
}

.footer-note {
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

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

    .main {
        padding: 1.5rem;
    }

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

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

    .fields-container {
        grid-template-columns: 1fr;
    }
}
