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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #4a5568;
    font-size: 2rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    color: #4a5568;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #4a5568;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-logout {
    background: #ed8936;
    color: white;
}

.btn-logout:hover {
    background: #dd6b20;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

/* Login Form Styles */
.login-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 50px auto;
}

.login-form h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 2rem;
}

.login-form h2 {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
}

.default-credentials {
    margin-top: 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 12px;
    color: #718096;
}

.default-credentials p {
    margin-bottom: 5px;
}

/* Dashboard Styles */
.upload-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.upload-section h2 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.upload-section p {
    color: #718096;
    margin-bottom: 30px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: border-color 0.3s ease;
    background: #f7fafc;
}

.upload-area.drag-over {
    border-color: #4299e1;
    background: #ebf8ff;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.file-input-label {
    display: block;
    cursor: pointer;
    padding: 20px;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.file-input-label p {
    margin: 5px 0;
    color: #4a5568;
}

.small-text {
    font-size: 12px;
    color: #718096;
}

#fileInput {
    display: none;
}

.file-list {
    text-align: left;
    margin: 20px 0;
    padding: 15px;
    background: #f7fafc;
    border-radius: 6px;
}

.file-list h4 {
    margin-bottom: 10px;
    color: #4a5568;
}

.file-list ul {
    list-style: none;
    padding: 0;
}

.file-list li {
    padding: 5px 0;
    color: #718096;
    font-size: 14px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

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

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

/* Results Section */
.results-section {
    margin-top: 30px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.results-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

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

.download-section {
    text-align: center;
    margin-top: 20px;
}

/* Admin Panel Styles */
.admin-content {
    display: grid;
    gap: 30px;
}

.create-user-section,
.users-list-section,
.stats-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.create-user-section h2,
.users-list-section h2,
.stats-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.user-form {
    max-width: 400px;
}

.table-responsive {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.users-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.users-table tr:hover {
    background: #f7fafc;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-admin {
    background: #fed7d7;
    color: #c53030;
}

.role-user {
    background: #c6f6d5;
    color: #22543d;
}

.current-user {
    color: #718096;
    font-style: italic;
}

.no-users {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
}

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

.stat-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-card h3 {
    color: #718096;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-number {
    color: #4299e1;
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

/* Admin Actions Section */
.admin-actions-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.admin-actions-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 12px 24px;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .login-form,
    .upload-section,
    .create-user-section,
    .users-list-section,
    .stats-section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        margin: 0 -10px;
    }
}

@media (max-width: 480px) {
    .login-form,
    .upload-section,
    .create-user-section,
    .users-list-section,
    .stats-section {
        padding: 15px;
    }
    
    .btn {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .upload-area {
        padding: 20px;
    }
}
