/* Item Management Styles */
.container-fluid {
    padding: 8px 10px;
}

.item-management {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.item-header h5 {
    margin: 0;
    font-weight: 600;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.item-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.item-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-placeholder {
    font-size: 4rem;
    color: rgba(255,255,255,0.5);
}

.item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.item-badge.single {
    background: #28a745;
}

.item-badge.variant {
    background: #007bff;
}

.item-card-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.item-info small {
    color: #6c757d;
    font-size: 0.75rem;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.item-card-body {
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #6c757d;
}

.item-card-body p {
    margin: 6px 0;
    display: flex;
    align-items: center;
}

.item-card-body i {
    width: 18px;
    margin-right: 8px;
    color: #007bff;
}

.item-actions {
    padding: 10px 16px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-edit {
    background: #ffc107;
    color: white;
}

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

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

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

.btn-edit i, .btn-delete i {
    margin-right: 4px;
    font-size: 0.85rem;
}

/* Modal Styles */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-xl {
    max-width: 1200px;
}

.modal-content {
    border-radius: 10px;
}

.form-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 8px;
    color: #007bff;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.form-group label .text-danger {
    color: #dc3545;
    margin-left: 2px;
}

.form-control, .form-control-file {
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-control:disabled, .form-control[readonly] {
    background-color: #e9ecef;
}

.input-group {
    position: relative;
}

.input-group-text {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 6px 0 0 6px;
    font-size: 0.875rem;
}

.item-type-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.item-type-option {
    flex: 1;
    position: relative;
}

.item-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.item-type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.item-type-label i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #6c757d;
}

.item-type-label span {
    font-weight: 600;
    color: #495057;
}

.item-type-option input[type="radio"]:checked + .item-type-label {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.item-type-option input[type="radio"]:checked + .item-type-label i {
    color: #667eea;
}

.variant-section {
    background: white;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

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

.variant-header h6 {
    margin: 0;
    font-weight: 700;
    color: #495057;
}

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.variant-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.variant-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-add-variant {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-variant:hover {
    background: #218838;
}

.price-calculator {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.price-calculator h6 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #856404;
    margin-bottom: 10px;
}

.calculated-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #155724;
    margin-top: 10px;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 10px;
    color: #495057;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 4px 8px;
    }
    
    .item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 15px;
    }
    
    .item-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .modal-xl {
        max-width: 100%;
        margin: 10px;
    }
    
    .item-type-selector {
        flex-direction: column;
    }
    
    .form-section {
        padding: 12px;
    }
}

/* Animation */
.item-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.4s ease forwards;
}

.item-card:nth-child(2) { animation-delay: 0.1s; }
.item-card:nth-child(3) { animation-delay: 0.2s; }
.item-card:nth-child(4) { animation-delay: 0.3s; }
.item-card:nth-child(5) { animation-delay: 0.4s; }
.item-card:nth-child(6) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .item-actions,
    .item-header button,
    .sidebar,
    .topbar,
    .modal {
        display: none !important;
    }
}

/* Custom Scrollbar */
.modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Image Preview */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    margin-top: 10px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    padding: 5px;
}

.image-preview img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Helper Text */
.form-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Required Field Indicator */
.required-indicator {
    color: #dc3545;
    margin-left: 3px;
    font-weight: 700;
}

/* Quick Add Button Styles */
.input-group-append .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.input-group .form-control {
    border-right: 0;
}

.input-group-append .btn-success {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.input-group-append .btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
}

.input-group-append .btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}

/* Quick Add Modal Styles */
#quickAddModal .modal-header {
    background: #28a745;
    color: white;
}

#quickAddModal .form-control.is-invalid {
    border-color: #dc3545;
}

#quickAddModal .form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Notification Toast */
.notification-toast {
    animation: slideInRight 0.3s ease-out;
}

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