/* CompTbl Admin Panel Styles */

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.admin-title h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.admin-title p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.back-link {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--primary-dark);
}

.admin-main {
    display: grid;
    gap: 40px;
}

/* Formats List */
.formats-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.formats-list {
    display: grid;
    gap: 15px;
}

.format-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.format-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.format-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.format-detect {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 5px 0;
}

.format-detect code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.format-fields {
    color: var(--text-light);
    font-size: 0.85rem;
}

.format-actions {
    display: flex;
    gap: 10px;
}

.btn-view, .btn-delete {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

.btn-view:hover {
    background: var(--primary-dark);
}

.btn-delete {
    background: var(--error-color);
    color: white;
}

.btn-delete:hover {
    background: #C0392B;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

/* Add Format Section */
.add-format-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.add-format-section h2 {
    margin-bottom: 30px;
    font-size: 1.5rem;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Step Content */
.step-content {
    min-height: 400px;
}

.step-content.hidden {
    display: none;
}

/* Mapping Interface */
.mapping-container {
    padding: 20px 0;
}

.mapping-header {
    margin-bottom: 30px;
}

.mapping-header h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

#csvFileName {
    color: var(--primary-color);
    font-weight: 500;
}

.mapping-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.mapping-column h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.field-item, .column-item {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: grab;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.field-item:hover, .column-item:hover {
    background: #e9ecef;
}

.field-item.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 5px;
}

.field-item.mapped {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.column-item.dragging {
    opacity: 0.5;
}

.column-item.selected {
    background: var(--primary-color);
    color: white;
}

/* Sample Preview */
.sample-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.sample-preview h4 {
    margin-bottom: 15px;
}

#sampleDataPreview {
    overflow-x: auto;
}

.sample-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sample-table th,
.sample-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.sample-table th {
    background: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

/* Save Form */
.save-form {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input:read-only {
    background: #f8f9fa;
    color: var(--text-light);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

.mapping-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.mapping-summary h4 {
    margin-bottom: 15px;
}

.mapping-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.mapping-item:last-child {
    border-bottom: none;
}

.mapping-item strong {
    color: var(--primary-color);
}

/* Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .mapping-grid {
        grid-template-columns: 1fr;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 20px;
    }
    
    .step-indicator::before {
        display: none;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
