/* Main admin CSS file */

/* Import base styles */
@import url('base/variables.css');
@import url('base/reset.css');
@import url('base/typography.css');

/* Import theme */
@import url('themes/admin-theme.css');

/* Import components */
@import url('components/buttons.css');
@import url('components/forms.css');
@import url('components/tables.css');

/* Import specific styles */
/* dashboard.css is imported separately as it has its own structure */

/* Additional admin styles */

/* ===== COMMON STYLES FOR ALL ADMIN PAGES ===== */

/* Base body styles for admin pages */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Common containers */
.container,
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Common headers */
.header,
.form-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.header h1,
.form-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

.header p,
.form-header p {
    color: #7f8c8d;
    margin: 10px 0 0 0;
    font-size: 1.1em;
}

/* Common buttons */
.btn,
.button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 5px;
    font-weight: 500;
}

.btn-primary,
.button.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-success,
.button.success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-warning,
.button.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-danger,
.button.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-secondary,
.button.secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.btn:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:disabled,
.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Common forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control:hover {
    border-color: #bdc3c7;
}

/* Common alerts */
.alert {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 10px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.alert-info {
    background: #d1ecf1;
    border-color: #3498db;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: #f39c12;
    color: #856404;
}

.alert-danger,
.alert-error {
    background: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

/* Common tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.table th {
    background: #34495e;
    color: white;
    font-weight: bold;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Common animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Common utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Responsiveness */
@media (max-width: 768px) {
    .container,
    .admin-container {
        padding: 20px;
    }
    
    .header h1,
    .form-header h1 {
        font-size: 1.8em;
    }
    
    .btn,
    .button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ===== STYLES FOR LOGOUT PAGE (logout.php) ===== */

/* Common styles for logout page */
body.logout-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

/* ===== STYLES FOR LOGIN PAGE (index.php) ===== */
.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    font-size: 1em;
    opacity: 0.9;
}

.login-body {
    padding: 40px 30px;
}

.login-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
}

.password-toggle {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.2em;
    padding: 5px;
    transition: color 0.3s ease;
}

.password-toggle-btn:hover {
    color: #667eea;
}

.icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

/* ===== STYLES FOR SYNC INTERFACE PAGE (sync_interface.php) ===== */

/* Common styles for sync page */
.sync-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.sync-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.sync-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

.sync-header p {
    color: #7f8c8d;
    margin: 10px 0 0 0;
    font-size: 1.1em;
}

.user-panel {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    font-weight: 500;
}

.logout-btn {
    padding: 8px 20px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.sync-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* Section styles */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* Card styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    font-weight: bold;
    color: #2c3e50;
}

.card-body {
    padding: 20px;
}
.sync-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.sync-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.sync-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

.sync-header p {
    color: #7f8c8d;
    margin: 10px 0 0 0;
    font-size: 1.1em;
}

.user-panel {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    font-weight: 500;
}

.logout-btn {
    padding: 8px 20px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.sync-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.nav-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.nav-btn.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.progress-container {
    background: #ecf0f1;
    border-radius: 10px;
    padding: 3px;
    margin: 15px 0;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    height: 20px;
    border-radius: 8px;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.status-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.stat-label {
    color: #7f8c8d;
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.status-ok {
    color: #27ae60;
    font-weight: bold;
}

.status-error {
    color: #e74c3c;
    font-weight: bold;
}

.sheet-link {
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.sheet-link:hover {
    background: #c0392b;
    transform: scale(1.05);
    color: white;
    text-decoration: none;
}

.row-label.sheet-link {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.row-label.sheet-link:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* ===== STYLES FOR FIELD MAPPING PAGE (field_mapping.php) ===== */
.field-mapping-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.field-mapping-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.field-mapping-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

.field-mapping-header p {
    color: #7f8c8d;
    margin: 10px 0 0 0;
    font-size: 1.1em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.required-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.optional-badge {
    background: #95a5a6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 2px solid #e9ecef;
    position: relative;
    z-index: 1001;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Modal header styles */
.modal-content h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: bold;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

/* Close button styles */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    margin: -5px -5px 0 0;
}

.close:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

/* Modal animation */
.modal.show {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

.modal-content.show {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Data inspector styles */
.data-inspector {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.inspector-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: #e9ecef;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-btn:hover {
    background: #d1ecf1;
}

.tab-btn.active:hover {
    background: #2980b9;
}

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

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

.inspector-table th {
    background: #34495e;
    color: white;
    font-weight: bold;
}

.inspector-table tbody tr:hover {
    background: #f8f9fa;
}

.column-name {
    cursor: pointer;
    color: #3498db;
    font-weight: bold;
    text-decoration: underline;
}

.column-name:hover {
    color: #2980b9;
}

.sample-value {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.suggestion-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.suggestion-item.confidence-high {
    border-left: 4px solid #28a745;
}

.suggestion-item.confidence-medium {
    border-left: 4px solid #ffc107;
}

.suggestion-item.confidence-low {
    border-left: 4px solid #dc3545;
}

.use-suggestion-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.use-suggestion-btn:hover {
    background: #218838;
}

/* Modal form styles */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control:hover {
    border-color: #bdc3c7;
}

/* Special styles for select elements */
.form-control select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Option element styles */
.form-control option {
    padding: 8px;
    background: white;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-wrapper label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Modal button styles */
.modal-content .btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 5px;
    font-weight: 500;
}

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

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

.modal-content .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal-content .btn-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* Additional modal styles */
.modal-content {
    background: white !important;
    border: 2px solid #e9ecef !important;
}

.modal-content * {
    background: inherit;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    background: white !important;
    border: 2px solid #e9ecef !important;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    background: white !important;
    border-color: #3498db !important;
}

/* Card styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    font-weight: bold;
    color: #2c3e50;
}

.card-body {
    padding: 20px;
}

/* Field mapping table styles */
.mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.mapping-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
}

.mapping-table td {
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.mapping-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Compact table buttons */
.mapping-table .btn {
    padding: 4px 8px;
    font-size: 12px;
    margin: 2px;
    border-radius: 4px;
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mapping-table .btn-warning {
    background: #3498db;
    color: white;
}

.mapping-table .btn-danger {
    background: #e74c3c;
    color: white;
}

.mapping-table .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}


/* Actions column styles */
.mapping-table .actions-cell {
    white-space: nowrap;
    text-align: center;
}

.mapping-table .actions-cell form {
    display: inline;
}

/* Compact badges */
.mapping-table .required-badge,
.mapping-table .optional-badge {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .mapping-table {
        font-size: 12px;
    }
    
    .mapping-table th,
    .mapping-table td {
        padding: 6px 4px;
    }
    
    .mapping-table .btn {
        padding: 3px 6px;
        font-size: 10px;
        margin: 1px;
    }
    
    /* Hide less important columns on mobile */
    .mapping-table th:nth-child(4),
    .mapping-table td:nth-child(4) {
        display: none; /* Rule */
    }
    
    .mapping-table th:nth-child(5),
    .mapping-table td:nth-child(5) {
        display: none; /* Example */
    }
}

/* Data inspector styles */
.data-inspector {
    background: #f8f9fa;
    border-radius: 15px;
    margin: 20px 0;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-inspector h3 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.inspector-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid #dee2e6;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    color: #6c757d;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 5px rgba(0,123,255,0.3);
}

#inspector-content {
    min-height: 200px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.loading {
    text-align: center;
    color: #6c757d;
    font-size: 1.1em;
    padding: 40px;
}

.inspector-section {
    display: none;
}

.inspector-section.active {
    display: block;
}

.inspector-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.inspector-table th,
.inspector-table td {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.inspector-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.inspector-table tr:nth-child(even) {
    background: #f8f9fa;
}

.column-name {
    font-family: 'Courier New', monospace;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.sample-value {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.confidence-high { border-left: 4px solid #28a745; }
.confidence-medium { border-left: 4px solid #ffc107; }
.confidence-low { border-left: 4px solid #dc3545; }

.use-suggestion-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.use-suggestion-btn:hover {
    background: #218838;
}

/* ===== STYLES FOR ARTICLE VALIDATOR PAGE (article_validator.php) ===== */
.validator-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.validator-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.validator-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

.validator-header p {
    color: #7f8c8d;
    margin: 10px 0 0 0;
    font-size: 1.1em;
}

.validator-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.validation-section {
    margin: 20px 0;
}

.section-header {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    margin: 0;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: normal;
}

.toggle-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.3);
}

.section-content {
    background: white;
    padding: 20px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section-content.collapsed {
    display: none;
}

.prefix-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.prefix-info h4 {
    margin-top: 0;
    color: #0d47a1;
    font-weight: 600;
}

.prefix-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.prefix-badge {
    background: white;
    border: 2px solid #1565c0;
    color: #0d47a1;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.item-card {
    background: #f8f9fa;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.item-title {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
}

.item-row {
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.item-row:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.item-details {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.item-detail {
    display: flex;
    gap: 8px;
}

.detail-label {
    font-weight: bold;
    color: #7f8c8d;
    min-width: 120px;
}

.detail-value {
    color: #2c3e50;
}

.duplicate-group {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.duplicate-group:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.duplicate-header {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 0;
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.duplicate-header .toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    color: #856404;
}

.duplicate-header .toggle-icon.expanded {
    transform: rotate(90deg);
}

.duplicate-items {
    display: grid;
    gap: 10px;
    margin-left: 20px;
    margin-top: 15px;
}

.duplicate-items.collapsed {
    display: none;
}

.duplicate-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #f39c12;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.duplicate-item strong {
    color: #2c3e50;
}

.duplicate-item .row-label {
    color: #7f8c8d;
    font-size: 13px;
    margin-top: 5px;
}

#loader {
    text-align: center;
    padding: 60px 20px;
}

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

#loader p {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
}

#success-message {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease;
}

#success-message h2 {
    color: #27ae60;
    margin-bottom: 10px;
}

#success-message p {
    color: #7f8c8d;
    font-size: 16px;
}

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

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .header h1 {
        font-size: 1.8em;
    }
    .nav {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .item-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* Admin container */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Form header */
.form-header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.form-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 2.5em;
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* Карточки */
.card {
    background: #f8f9fa;
    border-radius: 15px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 20px;
    font-weight: bold;
    font-size: 1.2em;
}

.card-body {
    padding: 25px;
}

/* Lists */
.categories-list,
.types-list {
    margin-top: var(--spacing-lg);
}

.empty-state {
    text-align: center;
    padding: 60px var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state p {
    font-size: 18px;
    margin: 0;
}

/* Information blocks */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.info-box p {
    margin: 0;
    color: #01579b;
}

/* Алерты */
.alert {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 10px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

.alert-info {
    background: #d1ecf1;
    border-color: #3498db;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    border-color: #27ae60;
    color: #155724;
}

.alert-warning {
    background: #fff3cd;
    border-color: #f39c12;
    color: #856404;
}

.alert-danger {
    background: #f8d7da;
    border-color: #e74c3c;
    color: #721c24;
}

/* Status messages */
.status-message {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Modal windows */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal.modal-open {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 2px solid #e9ecef;
    position: relative;
    z-index: 1001;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: bold;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    margin: -5px -5px 0 0;
}

.modal-close:hover {
    color: #e74c3c;
    transform: scale(1.1);
}

.modal-body {
    padding: 0;
}

/* Modal form styles */
.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.modal-content .form-group input,
.modal-content .form-group select,
.modal-content .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal-content .form-group input:hover,
.modal-content .form-group select:hover,
.modal-content .form-group textarea:hover {
    border-color: #bdc3c7;
}

.modal-content .form-help {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.85rem;
}

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

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.modal-content .button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
}

.modal-content .button.primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal-content .button.primary:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.modal-content .button:not(.primary) {
    background: #6c757d;
    color: white;
}

.modal-content .button:not(.primary):hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: var(--shadow-md);
}

.notification.success {
    background: var(--gradient-success);
}

.notification.error {
    background: var(--gradient-danger);
}

.notification.info {
    background: var(--gradient-button);
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Specific styles for category and type tables */
.categories-table,
.types-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.categories-table th,
.categories-table td,
.types-table th,
.types-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.categories-table th,
.types-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.categories-table tr:hover,
.types-table tr:hover {
    background: var(--hover-color);
}

.categories-table .actions,
.types-table .actions {
    white-space: nowrap;
}

.categories-table .actions .button,
.types-table .actions .button {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0;
    border: none;
}

/* Drag and Drop for categories */
.category-row {
    transition: all 0.2s ease;
    cursor: default;
}

.category-row:hover {
    background-color: var(--hover-color);
}

.category-row.dragging {
    opacity: 0.6;
    background-color: var(--accent-color);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.category-row.drag-over {
    border-top: 2px solid var(--accent-color);
}

.drag-handle {
    color: var(--text-color);
    opacity: 0.6;
    margin-right: 8px;
    font-weight: bold;
    cursor: move;
    user-select: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-block;
}

.drag-handle:hover {
    opacity: 1;
    color: var(--accent-color);
    background-color: var(--hover-color);
    transform: scale(1.1);
}

.sortable-tbody {
    position: relative;
}

.drop-indicator {
    height: 3px;
    background-color: var(--accent-color);
    position: absolute;
    left: 10px;
    right: 10px;
    display: none;
    z-index: 100;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 165, 0, 0.6);
    transition: all 0.1s ease;
}

.drop-indicator.active {
    display: block;
}

/* Styles for item_manager.php */

/* Main containers */
.admin-container {
    max-width: 70%;
    margin: 20px auto;
    padding: 20px;
}


/* Product card preview */
.item-preview-container {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--card-background);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    max-width: 350px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    z-index: 100;
    height: auto;
}

/* Reset margins for all elements inside preview container */
.item-preview-container * {
    box-sizing: border-box;
}

.item-preview-container #preview-frame {
    width: 100% !important;
    min-height: 400px;
    max-height: 600px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 0;
    padding: 0;
    display: block;
}

.item-preview-container h2 {
    margin: 0 0 20px 0;
    padding: 0;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.2;
}

.item-preview-container .container {
    display: block;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

#item-preview .item_div {
    width: 100%;
    transform: none !important;
}

#item-preview .buy-button {
    cursor: default;
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Main form styles */
.admin-form {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    padding: 20px;
}

/* Headers */
.form-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.form-header h1 {
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

h1, h2, h3 {
    color: var(--text-color);
    margin: 0;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

h3 {
    font-size: 1rem;
    margin-bottom: 15px;
}

/* Vertical section layout */
.editor-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    padding: 20px;
    background: var(--background-color);
    border-radius: 6px;
}

/* Full-width section */
.form-section-full {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

/* Field groups */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--background-color);
    color: var(--text-color);
}

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

/* Notifications */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Buttons */
.button {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.2;
    height: 38px;
    box-sizing: border-box;
    font-family: inherit;
    background-color: #6c757d;
    color: white;
}

.button:hover {
    background-color: #5a6268;
}

.button.primary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.button.primary:hover {
    background-color: var(--accent-color);
}

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

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

.button.sync {
    background-color: #17a2b8;
    color: white;
}

.button.sync:hover {
    background-color: #138496;
}

.button.sync:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.sync-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.button.sync.syncing .sync-icon {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Error indicators */
.error {
    border-color: #dc3545 !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.historical-details {
    animation: fadeIn 0.3s ease-in-out;
}

/* Image loading */
.image-preview img {
    transition: transform 0.3s ease-in-out;
}

.image-preview img:hover {
    transform: scale(1.1);
}

.image-upload-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
}

.image-preview-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--background-color);
    color: var(--text-color);
}

.drop-zone:hover {
    border-color: var(--accent-color);
    background-color: var(--hover-color);
}

.drop-zone.highlight {
    border-color: var(--secondary-color);
    background-color: var(--hover-color);
}

.image-preview {
    max-width: 300px;
    margin-top: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#upload-status {
    margin-top: 5px;
    font-size: 0.9rem;
}

.upload-success {
    color: #28a745;
}

.upload-error {
    color: #dc3545;
}

.remove-image {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.remove-image:hover {
    background-color: #c82333;
}

/* Dimensions and weight */
.dimensions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dimension-group {
    display: flex;  /* Default flex, but will be overridden via JS */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dimension-label {
    flex: 1;
    color: var(--text-color);
}

.dimension-input {
    display: flex;
    align-items: center;
    width: 120px;
}

.dimension-input input {
    width: 80px;
    padding: 6px;
    text-align: right;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}

.unit {
    margin-left: 5px;
    color: var(--text-color);
}

/* Historical details */
.historical-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.checkbox-group label {
    margin-left: 10px;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Image gallery */
.images-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 80px;
}

.gallery-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--card-background);
    padding: 10px;
    transition: all 0.2s;
    cursor: grab;
    min-height: 100px;
}

.gallery-item:active {
    cursor: grabbing;
}

.gallery-item.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.gallery-item.drag-over {
    border-color: var(--accent-color);
    border-width: 3px;
    background-color: var(--hover-color);
}

.gallery-item:hover:not(.dragging) {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gallery-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gallery-item-filename {
    font-size: 0.9rem;
    color: var(--text-color);
    word-break: break-all;
}

.reorder-info {
    margin-top: -10px;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--hover-color);
    border-radius: 4px;
    text-align: center;
}

.gallery-item img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.gallery-item-controls {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.image-badge {
    background: var(--secondary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.btn-delete-image {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-images-message {
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-info p {
    margin: 0;
}

.sync-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border: 1px solid #81d4fa;
    border-left: 4px solid #17a2b8;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.sync-info-box p {
    margin: 0;
    color: #01579b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Textarea improvements */
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--background-color);
    color: var(--text-color);
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Field hints */
.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Responsiveness */
@media (max-width: 1400px) {
    .item-preview-container {
        position: static;
        max-width: 500px;
        margin: 20px auto;
    }
}

@media (max-width: 768px) {
    .admin-container {
        padding: var(--spacing-lg);
    }
    
    .form-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .form-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .button {
        flex: 1 1 auto;
        min-width: 110px;
    }
    
    .form-section-full {
        grid-column: 1;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: var(--spacing-lg);
    }
    
    .categories-table,
    .types-table {
        font-size: 14px;
    }
    
    .categories-table th,
    .categories-table td,
    .types-table th,
    .types-table td {
        padding: var(--spacing-sm);
    }
}

/* Temporary image styles */
.temp-images-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.temp-images-info p {
    margin: 0;
    color: #856404;
    font-size: 0.9em;
}

.gallery-item.temp-image {
    border: 2px dashed #ffc107;
    background: #fffbf0;
}

.gallery-item.temp-image:hover {
    border-color: #ff8c00;
    background: #fff8e1;
}

.image-badge.temp-badge {
    background: #ffc107;
    color: #000;
    font-weight: bold;
}

.gallery-item.temp-image .gallery-item-filename {
    color: #856404;
    font-style: italic;
}
