* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Login Page */
#loginPage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Navbar */
.navbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.navbar h2 {
    color: #333;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

/* Page Content */
.page-content {
    padding: 0 2rem 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #333;
}

/* Data List */
.data-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-item:last-child {
    border-bottom: none;
}

.data-item-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.data-item-info p {
    color: #666;
    font-size: 0.9rem;
}

.data-item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.modal.hidden {
    display: none !important;
    visibility: hidden !important;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.large-modal {
    max-width: 900px;
}

.modal-content .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-content .close:hover {
    color: #333;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Error Message */
.error-message {
    color: #dc3545;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Success Message */
.success-message {
    color: #28a745;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Images Preview */
.images-preview {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.image-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
}

/* Insights View - Grouped by Category */
.insights-view {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.category-section {
    margin-bottom: 2rem;
}

.category-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.category-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.insight-card.view-card {
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.insight-card.view-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.insight-card-wrapper {
    display: flex;
    flex-direction: column;
}

.insight-feedback-section {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.875rem;
}

.feedback-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.feedback-positive {
    color: #28a745;
    font-weight: 500;
}

.feedback-negative {
    color: #dc3545;
    font-weight: 500;
}

.insight-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.insight-card-content {
    padding: 1rem;
}

.insight-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.insight-card-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.insight-card-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.insight-card-premium {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-enabled {
    background: #d4edda;
    color: #155724;
}

.status-disabled {
    background: #f8d7da;
    color: #721c24;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Images Gallery */
.images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.images-gallery.sortable-gallery {
    min-height: 200px;
}

.image-gallery-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
    cursor: move;
    user-select: none;
    transition: transform 0.2s, border-color 0.2s;
}

.image-gallery-item.dragging {
    opacity: 0.5;
    border: 2px dashed #667eea !important;
    transform: scale(0.95);
}

.image-gallery-item.drag-over {
    border: 2px solid #667eea !important;
    transform: scale(1.05);
}

.image-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-gallery-item .image-info {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.image-gallery-item .image-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.image-gallery-item .image-actions button {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.image-gallery-item .image-actions button:hover {
    background: rgba(220, 53, 69, 1);
}

/* Radio buttons */
.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input[type="radio"] {
    width: auto;
    margin: 0;
}

