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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.error-message {
    padding: 12px;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    font-size: 14px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

/* Admin Layout */
.admin-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-section h1 {
    font-size: 20px;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    font-weight: 500;
    color: #666;
}

/* Navigation Links */
.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f0f0f0;
    color: #333;
}

.nav-link.active {
    background-color: #667eea;
    color: white;
}

/* Page Content - for single-page layouts */
.page-content {
    display: block;
}

/* Main Content */
.admin-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    padding-top: 90px; /* Space for fixed header */
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #333;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

/* Section Cards */
.section-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.section-description {
    color: #666;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #667eea;
    background-color: #f9f9ff;
}

.upload-area.drag-over {
    border-color: #667eea;
    background-color: #f0f0ff;
}

.upload-prompt svg {
    color: #999;
    margin-bottom: 16px;
}

.upload-prompt p {
    color: #666;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px;
    color: #999;
}

/* Uploaded Files */
.uploaded-files {
    margin-top: 24px;
}

.uploaded-files h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.uploaded-files ul {
    list-style: none;
    margin-bottom: 16px;
}

.uploaded-files li {
    padding: 8px 12px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Import Progress */
.import-progress {
    margin-top: 24px;
}

.import-progress h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

#progressText {
    color: #666;
    font-size: 14px;
}

/* Import Results */
.import-results {
    margin-top: 24px;
    padding: 16px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.result-item {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.result-item.success {
    background-color: #d4edda;
    color: #155724;
}

.result-item.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

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

.admin-table th {
    font-weight: 600;
    color: #333;
    background-color: #f9f9f9;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.icon-button {
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.icon-button:hover {
    background-color: #f0f0f0;
}

.icon-button.delete:hover {
    background-color: #fee;
    border-color: #fcc;
    color: #c33;
}

/* Document link in table */
.doc-link {
    color: #667eea;
    text-decoration: none;
}

.doc-link:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    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 h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}
