/**
 * UIL Service Explorer - Requirements Compliant Styles 2025
 * 
 * Styles for the enhanced service explorer that follows all requirements:
 * - Service category navigation (1.1, 1.2.1, 1.2.2)
 * - Lab service modal (2.1)
 * - Cart system integration (2.2, 3)
 * - Request quotation form sync (3)
 */

/* ===== SERVICE EXPLORER CONTAINER ===== */
.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: right;
    margin-bottom: 20px;
}

.uil-language-switcher .lang-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    margin: 0 2px;
    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 {
    background: #f8f9fa;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.uil-breadcrumb .breadcrumb-item {
    color: #007cba;
    text-decoration: none;
    cursor: pointer;
}

.uil-breadcrumb .breadcrumb-item:hover {
    text-decoration: underline;
}

.uil-breadcrumb .breadcrumb-item.current {
    color: #6c757d;
    cursor: default;
}

.uil-breadcrumb .breadcrumb-separator {
    margin: 0 8px;
    color: #6c757d;
}

/* ===== NAVIGATION CONTROLS ===== */
.uil-navigation-controls {
    margin-bottom: 20px;
}

.uil-back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.uil-back-btn:hover {
    background: #5a6268;
}

.uil-back-btn .back-icon {
    font-size: 16px;
}

/* ===== LOADING STATE ===== */
.uil-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ERROR STATE ===== */
.uil-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.uil-error h3 {
    color: #dc3545;
    margin-bottom: 16px;
}

/* ===== CATEGORIES GRID ===== */
.uil-categories-grid h2,
.uil-subcategories-grid h2,
.uil-services-grid h2 {
    color: #343a40;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
}

.categories-container,
.subcategories-container,
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.category-card,
.subcategory-card,
.service-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.category-card:hover,
.subcategory-card:hover,
.service-card:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.15);
    transform: translateY(-2px);
}

.category-card h3,
.subcategory-card h3,
.service-card h3 {
    color: #343a40;
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

.category-card p,
.subcategory-card p,
.service-card .service-description {
    color: #6c757d;
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
}

.category-count,
.subcategory-count {
    color: #007cba;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== SERVICE CARDS ===== */
.service-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.service-card[data-service-type="lab"] .service-type {
    background: #e3f2fd;
    color: #1976d2;
}

.service-card[data-service-type="regular"] .service-type {
    background: #f3e5f5;
    color: #7b1fa2;
}

.service-price {
    color: #28a745;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover {
    background: #006ba1;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-link {
    background: transparent;
    color: #007cba;
    border: 1px solid transparent;
    padding: 8px 12px;
}

.btn-link:hover {
    color: #006ba1;
    text-decoration: underline;
}

.uil-select-lab-options,
.uil-add-to-cart {
    width: 100%;
    margin-top: 8px;
}

/* ===== LAB SERVICE MODAL ===== */
.uil-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.uil-modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    margin: 5% auto;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.uil-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    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: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uil-modal-close:hover {
    color: #343a40;
}

.uil-modal-body {
    padding: 24px;
}

.uil-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===== LAB SERVICE FORM ===== */
.service-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
}

.pricing-mode-info {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.selection-section {
    margin-bottom: 24px;
}

.selection-section h4 {
    color: #343a40;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
}

.required-indicator {
    color: #dc3545;
    margin-left: 4px;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.selection-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.selection-item:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.selection-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.selection-item input[type="checkbox"]:checked + .checkmark + .item-text {
    font-weight: 600;
    color: #007cba;
}

.item-text {
    font-size: 14px;
    color: #495057;
}

.requirements-info {
    margin-bottom: 20px;
}

.info-box {
    background: #e7f3ff;
    border: 1px solid #007cba;
    border-radius: 4px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.info-icon {
    color: #007cba;
    font-weight: bold;
    flex-shrink: 0;
}

.info-box p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.validation-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.validation-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.validation-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ===== CART STATUS ===== */
.uil-cart-status {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    margin-top: 20px;
}

.cart-summary h4 {
    margin: 0 0 12px 0;
    color: #343a40;
    font-size: 16px;
}

.cart-count {
    color: #007cba;
    font-weight: 600;
}

/* ===== REQUEST QUOTATION CART SYNC ===== */
.uil-cart-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.cart-section-title {
    color: #343a40;
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
}

.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;
}

.cart-service-group {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.service-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.service-name {
    margin: 0;
    color: #343a40;
    font-size: 16px;
    font-weight: 600;
}

.service-type.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.service-type.badge.lab {
    background: #e3f2fd;
    color: #1976d2;
}

.service-type.badge.regular {
    background: #f3e5f5;
    color: #7b1fa2;
}

.remove-service-btn {
    color: #dc3545;
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
}

.remove-service-btn:hover {
    background: #f8d7da;
    border-radius: 4px;
}

.service-items {
    padding: 0;
}

.cart-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-name {
    color: #343a40;
    font-weight: 500;
    margin-bottom: 4px;
}

.item-details {
    font-size: 12px;
    color: #6c757d;
}

.item-detail {
    margin-bottom: 2px;
}

.item-detail strong {
    color: #495057;
}

.item-actions {
    margin-left: 12px;
}

.remove-item-btn {
    color: #dc3545;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item-btn:hover {
    background: #f8d7da;
    border-radius: 4px;
}

.uil-cart-summary {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 12px 16px;
    margin-top: 16px;
}

.cart-total-items {
    color: #495057;
    font-size: 14px;
}

.item-count {
    color: #007cba;
    font-weight: 600;
}

.cart-message {
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.cart-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cart-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .uil-service-explorer {
        padding: 16px;
    }
    
    .categories-container,
    .subcategories-container,
    .services-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .uil-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 90vh;
    }
    
    .uil-modal-header,
    .uil-modal-body,
    .uil-modal-footer {
        padding: 16px;
    }
    
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .service-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-actions {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .uil-modal {
        display: none !important;
    }
    
    .uil-navigation-controls,
    .uil-language-switcher,
    .btn,
    .remove-service-btn,
    .remove-item-btn {
        display: none !important;
    }
}
