/* Sales Order New - Custom Styles */

/* Ensure Google Maps functionality is not affected */
#map {
    position: relative !important;
    overflow: hidden !important;
    background-color: #e5e3df !important;
    height: 400px !important;
    width: 100% !important;
    min-height: 300px !important;
}

/* Responsive map height */
@media (max-width: 768px) {
    #map {
        height: 300px !important;
        min-height: 250px !important;
    }
}

#map * {
    box-sizing: content-box !important;
}

/* Ensure Google Maps controls are not affected by our custom styles */
.gm-style,
.gm-style * {
    box-sizing: content-box !important;
}

.gm-style-cc {
    display: block !important;
}

/* Don't apply our custom styles to Google Maps elements */
.custom-grid .e-grid .e-row:hover {
    background-color: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Override for Google Maps - don't apply hover effects */
#map .custom-grid .e-grid .e-row:hover,
.gm-style .custom-grid .e-grid .e-row:hover {
    background-color: initial !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Product Search Section */
.product-search-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.product-search-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.product-search-section .upload-header {
    padding: 20px 24px 12px;
}

.product-search-section .upload-title {
    font-size: 18px;
    font-weight: 600;
    color: #405189;
    margin-bottom: 4px;
}

.product-search-section .upload-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 0;
}

.product-search-section .form-control-lg {
    border-radius: 8px;
    border: 2px solid #e3e6f0;
    transition: all 0.3s ease;
    font-size: 15px;
}

.product-search-section .form-control-lg:focus {
    border-color: #405189;
    box-shadow: 0 0 0 0.2rem rgba(64, 81, 137, 0.15);
}

.product-search-section .upload-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.product-search-section .badge {
    font-weight: 500;
}

/* Grid Container Enhancement */
.grid-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.grid-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 2px solid #e9ecef;
}

.grid-title {
    font-size: 18px;
    font-weight: 600;
    color: #405189;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grid-content {
    padding: 0;
}

/* Custom Grid Styles */
.custom-grid .e-grid .e-gridheader {
    background: linear-gradient(135deg, #405189 0%, #5a6c9d 100%);
    border-bottom: 2px solid #e9ecef;
}

.custom-grid .e-grid .e-headercell {
    font-weight: 600;
    color: white !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 12px;
}

.custom-grid .e-grid .e-row {
    transition: all 0.2s ease;
}

.custom-grid .e-grid .e-row:hover {
    background-color: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.custom-grid .e-grid .e-rowcell {
    border-right: 1px solid #f1f3f4;
    padding: 16px 12px;
    vertical-align: middle;
}

/* Product Item Cards */
.product-item-card {
    transition: all 0.3s ease;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.product-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #405189;
}

/* Avatar Styles */
.avatar-xs {
    width: 32px;
    height: 32px;
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* Badge Enhancements */
.badge.bg-soft-primary {
    background-color: rgba(64, 81, 137, 0.1) !important;
    color: #405189 !important;
    border: 1px solid rgba(64, 81, 137, 0.2);
}

.badge.bg-soft-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.badge.bg-soft-info {
    background-color: rgba(23, 162, 184, 0.1) !important;
    color: #17a2b8 !important;
    border: 1px solid rgba(23, 162, 184, 0.2);
}

/* Button Enhancements */
.btn-soft-primary {
    background-color: rgba(64, 81, 137, 0.1);
    border-color: rgba(64, 81, 137, 0.2);
    color: #405189;
    transition: all 0.3s ease;
}

.btn-soft-primary:hover {
    background-color: #405189;
    border-color: #405189;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(64, 81, 137, 0.3);
}

.btn-soft-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    transition: all 0.3s ease;
}

.btn-soft-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Empty State */
.empty-state {
    padding: 60px 20px;
}

.empty-state .avatar-lg {
    margin: 0 auto 20px;
}

/* Card Enhancements */
.card.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.card.shadow-sm:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Header Section */
.products-header {
    background: linear-gradient(135deg, #405189 0%, #5a6c9d 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Tab Navigation Enhancement - Override step-arrow-nav styles */
.step-arrow-nav .nav.custom-nav {
    background-color: transparent !important;
}

.step-arrow-nav .nav.custom-nav .nav-link {
    background: white !important;
    color: #495057 !important;
    border: 2px solid #dee2e6 !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    opacity: 0.6 !important;
}

.step-arrow-nav .nav.custom-nav .nav-link::before {
    display: none !important;
}

.step-arrow-nav .nav.custom-nav .nav-link:hover:not(.active) {
    background: #f1f3f5 !important;
    color: #212529 !important;
    border-color: #adb5bd !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    opacity: 0.85 !important;
}

.step-arrow-nav .nav.custom-nav .nav-link.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    border-color: #28a745 !important;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.5) !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    transform: scale(1.03) !important;
}

.step-arrow-nav .nav.custom-nav .nav-link.active::before {
    display: none !important;
}

.step-arrow-nav .nav.custom-nav .nav-link.active i {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.step-arrow-nav .nav.custom-nav .nav-link:not(.active) i {
    background: rgba(108, 117, 125, 0.15) !important;
    color: #6c757d !important;
}

.step-arrow-nav .nav.custom-nav .nav-link .badge {
    font-size: 11px;
    padding: 4px 8px;
    font-weight: 600;
}

.step-arrow-nav .nav.custom-nav .nav-link.active .badge {
    background: white !important;
    color: #28a745 !important;
    font-weight: 700 !important;
}

/* Empty State Enhancements */
.empty-state-grid {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px dashed #e3e6f0;
}

.empty-content {
    max-width: 500px;
}

/* Grid Action Buttons */
.custom-grid .btn-primary {
    background: linear-gradient(135deg, #405189 0%, #5a6c9d 100%);
    border: none;
    transition: all 0.3s ease;
}

.custom-grid .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 81, 137, 0.3);
}

.custom-grid .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Quantity Badge Enhancement */
.quantity-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.quantity-badge.quantity-error {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* Form Label Enhancement */
.form-label.fw-semibold {
    color: #495057;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-label.fw-semibold i {
    color: #405189;
}

/* Card Header for Map */
.card-header.bg-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 2px solid #dee2e6;
}

/* Create Order Button Enhancement */
.create-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border: none !important;
    color: white !important;
    padding: 12px 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
    transition: all 0.3s ease !important;
}

.create-btn:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
}

.create-btn:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.create-btn .label-icon {
    font-size: 18px !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .custom-grid .e-grid .e-rowcell {
        padding: 12px 8px;
    }

    .product-search-section {
        padding: 16px;
    }

    .badge {
        font-size: 11px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }

    .custom-grid .btn-primary {
        padding: 4px 8px;
        font-size: 11px;
    }

    .custom-grid .btn-primary .me-1 {
        display: none;
    }

    .empty-content {
        padding: 20px;
    }

    .empty-content h4 {
        font-size: 18px;
    }

    .empty-content p {
        font-size: 14px;
    }
}

/* Animation for new items */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-item {
    animation: slideInUp 0.3s ease-out;
}

/* Loading States */
.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Dropdown Enhancements */
.e-dropdownbase .e-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}

.e-dropdownbase .e-list-item:hover {
    background-color: #f8f9ff;
    transform: translateX(4px);
}

.e-dropdownbase .e-list-item:last-child {
    border-bottom: none;
}

/* Focus States */
.form-control:focus,
.e-input-group.e-control-wrapper:not(.e-error) .e-input:focus {
    border-color: #405189;
    box-shadow: 0 0 0 0.2rem rgba(64, 81, 137, 0.15);
}

/* Success States */
.success-highlight {
    background-color: rgba(40, 167, 69, 0.05);
    border-left: 4px solid #28a745;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
