* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --text-dark: #111827;
    --text-gray: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    max-width: 600px;
    margin: 50px auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.admin-container {
    max-width: 1200px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.header p {
    color: var(--text-gray);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-light);
}

.file-input-label:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.file-input-label svg {
    width: 48px;
    height: 48px;
    color: var(--text-gray);
    margin-bottom: 12px;
}

.file-input-label span {
    display: block;
    text-align: center;
}

.file-input-label .main-text {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.file-input-label .sub-text {
    font-size: 0.875rem;
    color: var(--text-gray);
}

input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-list {
    margin-top: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-item span {
    font-size: 0.875rem;
    color: var(--text-dark);
}

.file-item button {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.2rem;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.admin-header h1 {
    color: var(--primary);
    font-size: 1.75rem;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-light);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: var(--bg-light);
}

.actions {
    display: flex;
    gap: 8px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
}

.login-container {
    max-width: 400px;
}

@media (max-width: 768px) {
    .container {
        padding: 24px;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 12px 8px;
    }
    
    .actions {
        flex-direction: column;
    }
}

/* Upload Loading Overlay */
.upload-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.upload-overlay.active {
    display: flex;
}

.upload-loader {
    text-align: center;
    color: white;
}

.spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.upload-subtext {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 24px;
}

.progress-bar-container {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.upload-tips {
    margin-top: 24px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 400px;
}

.upload-tips p {
    margin-bottom: 8px;
}

/* Pulse animation for file icon */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.uploading .file-input-label svg {
    animation: pulse 1.5s ease-in-out infinite;
}