/* Admin Panel Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow-x: hidden;
}

#root {
    display: flex;
    min-height: 100vh;
}

/* Admin layout styles */
.admin-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Side navigation styles */
.side-nav {
    background-color: #2b5876;
    color: white;
    width: 250px;
    min-height: 100vh;
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
}

.side-nav-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.side-nav-header img {
    max-width: 120px;
    margin-bottom: 10px;
}

.side-nav-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.nav-items {
    margin-top: 20px;
}

.nav-item {
    padding: 15px 20px;
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main content area */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

.page-header h1 {
    margin: 0;
    color: #2b5876;
    font-weight: 600;
}

/* Page container */
.page-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

/* Mobile navigation toggle */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background-color: #2b5876;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
}

/* Form styles */
.form-section {
    background-color: #f1f7fc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(43, 88, 118, 0.25);
    border-color: #2b5876;
}

.btn-primary {
    background-color: #2b5876;
    border-color: #2b5876;
}

.btn-primary:hover {
    background-color: #1e3f54;
    border-color: #1e3f54;
}

/* Filter styles */
.filter-section {
    background-color: #f1f7fc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

/* Table styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table th {
    background-color: #2b5876;
    color: white;
    font-weight: 500;
    white-space: nowrap;
}

.table-hover tbody tr:hover {
    background-color: rgba(43, 88, 118, 0.05);
}

/* Image preview */
.img-thumbnail {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
}

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

/* Page not implemented */
.page-not-implemented {
    text-align: center;
    padding: 50px 20px;
}

.page-not-implemented i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 20px;
}

/* FAQ Management Styles */
.faq-item {
    background-color: #fff;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.faq-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-left-color: #007bff;
}

.faq-item .drag-handle {
    opacity: 0.3;
    cursor: grab;
    font-size: 1.1em;
    color: #6c757d;
}

.faq-item:hover .drag-handle {
    opacity: 0.7;
}

.faq-answer {
    padding-left: 2rem;
    color: #6c757d;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.faq-category {
    margin-left: 2rem;
}

/* Catalog Categories Management Styles */
.category-item {
    background-color: #fff;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    padding: 1rem;
}

.category-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-left-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-item.drag-over {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    transform: scale(1.02);
}

.category-item .drag-handle {
    opacity: 0.3;
    cursor: grab;
    font-size: 1.2em;
    color: #6c757d;
    transition: opacity 0.2s;
}

.category-item:hover .drag-handle {
    opacity: 0.8;
}

.category-item .drag-handle:active {
    cursor: grabbing;
}

.category-color {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.category-item:hover .category-color {
    transform: scale(1.1);
}

.category-info {
    min-width: 0; /* Allow flex item to shrink */
}

.category-info h3 {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.category-info p {
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.color-preview {
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

/* Drag and drop animation */
.category-item[draggable="true"]:active {
    opacity: 0.7;
    transform: rotate(2deg);
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button hover effects */
.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Catalog Card Styles */
.catalog-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.catalog-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.catalog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.catalog-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.catalog-card-image img:hover {
    transform: scale(1.05);
}

.catalog-card-image .no-image {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
}

.catalog-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #4A90E2;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

.catalog-card-content {
    padding: 20px;
}

.catalog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.catalog-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2b5876;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
}

.catalog-card-price {
    background: #e8f5e8;
    color: #28a745;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.catalog-card-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    min-height: 44px;    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

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

.catalog-card-actions .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.catalog-card-actions .btn-edit {
    background: #17a2b8;
    color: white;
    border: none;
}

.catalog-card-actions .btn-edit:hover {
    background: #138496;
}

.catalog-card-actions .btn-delete {
    background: #dc3545;
    color: white;
    border: none;
}

.catalog-card-actions .btn-delete:hover {
    background: #c82333;
}

.catalog-card-id {
    font-size: 0.75rem;
    color: #adb5bd;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.view-toggle-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.view-toggle-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.view-toggle-btn.active {
    background: #4A90E2;
    color: white;
    border-color: #4A90E2;
}

/* Search and Filter Bar */
.catalog-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.catalog-search {
    flex: 1;
    min-width: 250px;
}

.catalog-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
}

.catalog-filter select {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 150px;
}

.catalog-stats {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .side-nav {
        position: fixed;
        left: -250px;
        z-index: 999;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .side-nav.open {
        left: 0;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .main-content {
        padding-top: 70px;
    }
    
    .catalog-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .catalog-card-content {
        padding: 16px;
    }
    
    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .catalog-search {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .catalog-cards-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .catalog-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .catalog-card-title {
        margin-right: 0;
    }
}
