/* UIL Service Explorer Master - CSS Styles 2025 */

/* Base styles for service explorer */
.uil-service-explorer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Language switcher */
.uil-language-switcher {
    text-align: center;
    margin-bottom: 20px;
}

.uil-language-switcher .lang-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.uil-language-switcher .lang-btn:hover {
    background: #e9ecef;
}

.uil-language-switcher .lang-btn.active {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Breadcrumb navigation */
.uil-breadcrumb {
    margin-bottom: 20px;
}

.uil-breadcrumb-nav {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.breadcrumb {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 14px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: " > ";
    padding: 0 8px;
    color: #6c757d;
}

.breadcrumb-link {
    color: #007cba;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Navigation controls */
.uil-navigation-controls {
    margin-bottom: 20px;
}

.uil-back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.uil-back-btn:hover {
    background: #5a6268;
}

/* Categories grid */
.uil-categories-grid h2,
.uil-subcategories-grid h2,
.uil-services-grid h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #343a40;
    font-size: 28px;
    font-weight: 600;
}

.categories-container,
.subcategories-container,
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Category/Subcategory cards */
.category-card,
.subcategory-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-card:hover,
.subcategory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: #007cba;
}

.category-card h3,
.subcategory-card h3 {
    margin: 0 0 10px 0;
    color: #007cba;
    font-size: 20px;
    font-weight: 600;
}

.category-card p,
.subcategory-card p {
    margin: 0 0 15px 0;
    color: #6c757d;
    line-height: 1.5;
}

.category-count,
.subcategory-count {
    font-size: 12px;
    color: #868e96;
    text-transform: uppercase;
    font-weight: 500;
}

/* Service cards */
.service-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.service-card h3 {
    margin: 0 0 10px 0;
    color: #343a40;
    font-size: 18px;
    font-weight: 600;
}

.service-description {
    margin: 0 0 15px 0;
    color: #6c757d;
    line-height: 1.5;
    font-size: 14px;
}

.service-type {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.service-card[data-service-type="lab"] .service-type {
    background: #d1ecf1;
    color: #0c5460;
}

.service-price {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-link {
    background: none;
    color: #007cba;
    border: none;
    padding: 5px;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Cart status */
.uil-cart-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #007cba;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    display: none;
    transition: all 0.2s ease;
}

.uil-cart-status:hover {
    background: #0056b3;
    cursor: pointer;
}

.cart-icon {
    margin-right: 5px;
}

.cart-count {
    background: white;
    color: #007cba;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 5px;
    font-weight: 600;
}

/* Modal styles */
.uil-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.uil-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.uil-modal-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: #343a40;
    font-size: 20px;
    font-weight: 600;
}

.uil-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uil-modal-close:hover {
    color: #343a40;
}

.uil-modal-body {
    padding: 20px;
}

.uil-modal-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Lab service modal content */
.service-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.service-info h4 {
    margin: 0 0 10px 0;
    color: #343a40;
}

.pricing-info {
    font-size: 14px;
    color: #6c757d;
}

.parameter-selection,
.method-selection {
    margin-bottom: 20px;
}

.parameter-selection h5,
.method-selection h5 {
    margin: 0 0 10px 0;
    color: #343a40;
    font-size: 16px;
}

.required {
    color: #dc3545;
}

.optional {
    color: #6c757d;
    font-size: 12px;
}

.selection-note {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

.parameter-list,
.method-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.parameter-item,
.method-item {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
}

.parameter-item label,
.method-item label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
}

.parameter-checkbox,
.method-checkbox {
    margin-right: 8px;
}

.validation-message {
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 15px;
}

.validation-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.validation-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Request quotation cart section */
.uil-cart-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.uil-cart-section h3 {
    margin: 0 0 20px 0;
    color: #343a40;
    font-size: 20px;
    font-weight: 600;
}

.cart-service-group {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 15px;
}

.service-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-name {
    margin: 0;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #343a40;
}

.badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.remove-service-btn,
.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-service-btn:hover,
.remove-item-btn:hover {
    background: #f8d7da;
}

.remove-icon {
    font-size: 18px;
    line-height: 1;
}

.service-items {
    padding: 0;
}

.cart-item {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-details {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.item-details strong {
    color: #343a40;
}

.item-details em {
    color: #6c757d;
    font-style: normal;
    font-weight: 500;
}

.item-actions {
    margin-left: 10px;
}

.uil-cart-empty-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.browse-services-link {
    color: #007cba;
    text-decoration: none;
}

.browse-services-link:hover {
    text-decoration: underline;
}

/* Loading and error states */
.uil-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
}

.uil-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 16px;
}

/* Message notifications */
.uil-success-message,
.uil-cart-message,
.uil-quotation-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 14px;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 768px) {
    .uil-service-explorer {
        padding: 10px;
    }
    
    .categories-container,
    .subcategories-container,
    .services-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .parameter-list,
    .method-list {
        grid-template-columns: 1fr;
    }
    
    .uil-modal {
        padding: 10px;
    }
    
    .uil-modal-content {
        max-height: 95vh;
    }
    
    .service-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .item-actions {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .uil-cart-status {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .uil-service-explorer {
        padding: 5px;
    }
    
    .category-card,
    .subcategory-card,
    .service-card {
        padding: 15px;
    }
    
    .uil-modal {
        padding: 5px;
    }
    
    .uil-modal-header,
    .uil-modal-body,
    .uil-modal-footer {
        padding: 15px;
    }
}

/* ========================================
   FLOATING CART BUTTON
   ======================================== */

/* Floating cart button */
.uil-floating-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border-radius: 50px;
    padding: 15px 25px;
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.3);
    cursor: pointer;
    user-select: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    max-width: 220px;
    border: none;
    outline: none;
}

.uil-floating-cart:hover {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 124, 186, 0.4);
}

.uil-floating-cart.cart-clicked {
    transform: scale(0.95) translateY(-3px);
}

/* Cart icon */
.floating-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.floating-cart-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Cart badge */
.cart-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cart-badge.cart-updated {
    animation: cartPulse 0.6s ease-in-out;
}

/* Badge states for better visibility */
.cart-badge.empty {
    opacity: 0.6;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.cart-badge.has-items {
    opacity: 1;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Cart content */
.floating-cart-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.cart-text {
    font-weight: 600;
    font-size: 14px;
}

.cart-action {
    font-size: 11px;
    opacity: 0.9;
}

/* Animations */
@keyframes cartPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    }
    50% { 
        transform: scale(1.3); 
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.5);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    }
}

@keyframes cartSlideIn {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Show animation for cart */
.uil-floating-cart.cart-visible {
    animation: cartSlideIn 0.4s ease-out;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .uil-floating-cart {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        border-radius: 40px;
        max-width: 180px;
        font-size: 13px;
        gap: 10px;
    }
    
    .floating-cart-icon {
        min-width: 24px;
        height: 24px;
    }
    
    .floating-cart-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .cart-badge {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
        top: -8px;
        right: -8px;
        border: 2px solid white;
    }
    
    .cart-text {
        font-size: 13px;
    }
    
    .cart-action {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .uil-floating-cart {
        bottom: 15px;
        right: 15px;
        padding: 10px 15px;
        max-width: 160px;
        font-size: 12px;
        gap: 8px;
    }
    
    .floating-cart-icon {
        min-width: 22px;
        height: 22px;
    }
    
    .floating-cart-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .cart-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }
    
    .floating-cart-content {
        gap: 1px;
    }
    
    .cart-text {
        font-size: 12px;
    }
    
    .cart-action {
        font-size: 9px;
    }
}

/* Hide on very small screens when content is too narrow */
@media (max-width: 360px) {
    .floating-cart-content {
        display: none;
    }
    
    .uil-floating-cart {
        padding: 10px;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        justify-content: center;
    }
}

/* Khmer font support */
.uil-floating-cart[data-language="km"] .floating-cart-content {
    font-family: "Khmer OS Battambang", "Battambang Regular", Arial, sans-serif;
}

/* Print styles - hide floating cart */
@media print {
    .uil-floating-cart {
        display: none !important;
    }
}
