/**
 * Product Details Modal CSS
 * Comprehensive tabbed modal for displaying detailed product information
 * Fully responsive and accessible
 */

/* Modal Overlay */
.ta-product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ta-product-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.ta-product-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ta-product-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.ta-product-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    flex-shrink: 0;
}

.ta-product-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ta-product-modal-title-icon {
    font-size: 24px;
    color: #E94141;
}

.ta-product-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.ta-product-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.ta-product-modal-close:active {
    transform: scale(0.95);
}

/* Tab Navigation – scrollable, responsive; active indicator below text (no overlap) */
.ta-product-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    scrollbar-width: thin;
    padding: 0 4px 0 0;
}

.ta-product-tabs-nav::-webkit-scrollbar {
    height: 6px;
}

.ta-product-tabs-nav::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 3px;
}

.ta-product-tabs-nav::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

.ta-product-tabs-nav::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.ta-product-tab-btn {
    flex: 0 0 auto;
    padding: 14px 18px 16px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
    border-radius: 8px 8px 0 0;
    margin-right: 3px;

}

.ta-product-tab-btn::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
    transition: background 0.2s ease;
}

.ta-product-tab-btn span {
    margin-right: 6px;
}

.ta-product-tab-btn:hover {
    color: #1f2937;
    background: #fff;
}

.ta-product-tab-btn.active {
    color: #E94141;
    background: #fff;
    z-index: 1;
}

.ta-product-tab-btn.active::after {
    background: #E94141;
}

.ta-product-tab-btn:focus {
    outline: 2px solid #E94141;
    outline-offset: 2px;
}

.ta-product-tab-btn:focus:not(:focus-visible) {
    outline: none;
}

.ta-product-tab-btn:focus-visible {
    outline: 2px solid #E94141;
    outline-offset: 2px;
}

/* Tab Content */
.ta-product-tabs-content {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ta-product-tabs-content::-webkit-scrollbar {
    width: 8px;
}

.ta-product-tabs-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.ta-product-tabs-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.ta-product-tabs-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.ta-product-tab-pane {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.ta-product-tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Information Grid */
.ta-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.ta-info-item {
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ta-info-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ta-info-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.ta-info-value {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
    line-height: 1.5;
}

.ta-info-value.empty {
    color: #9ca3af;
    font-style: italic;
}

/* Attribute List */
.ta-attribute-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ta-attribute-item {
    padding: 14px 16px;
    background: #f9fafb;
    border-left: 4px solid #E94141;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ta-attribute-item:hover {
    background: #fff5f5;
    box-shadow: 0 4px 12px rgba(233, 65, 65, 0.1);
}

.ta-attribute-name {
    font-size: 13px;
    font-weight: 700;
    color: #E94141;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ta-attribute-value {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    word-break: break-word;
}

/* Vehicle Linkage Table */
.ta-vehicle-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.ta-vehicle-table thead {
    background: #f3f4f6;
}

.ta-vehicle-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.ta-vehicle-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
}

.ta-vehicle-table tbody tr:hover {
    background: #f9fafb;
}

.ta-vehicle-table tbody tr:last-child td {
    border-bottom: none;
}

/* Package Information */
.ta-package-item {
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.ta-package-item:last-child {
    margin-bottom: 0;
}

.ta-package-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.ta-package-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.ta-package-detail {
    display: flex;
    flex-direction: column;
}

.ta-package-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ta-package-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

/* Empty State */
.ta-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.ta-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ta-empty-state-text {
    font-size: 16px;
    color: #6b7280;
}

/* Loading State */
.ta-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 300px;
}

.ta-modal-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #E94141;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.ta-modal-error {
    padding: 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    margin: 20px;
}

.ta-modal-error-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.ta-modal-error-message {
    font-size: 14px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ta-product-modal {
        max-width: 95%;
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .ta-product-modal-header {
        padding: 16px 20px;
    }

    .ta-product-modal-title {
        font-size: 18px;
        gap: 8px;
    }

    .ta-product-modal-title-icon {
        font-size: 20px;
    }

    .ta-product-tab-btn {
        padding: 14px 16px;
        font-size: 13px;
    }

    .ta-product-tab-pane {
        padding: 16px;
    }

    .ta-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ta-info-item {
        padding: 12px;
    }

    .ta-info-label {
        font-size: 11px;
    }

    .ta-info-value {
        font-size: 14px;
    }

    .ta-vehicle-table th,
    .ta-vehicle-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .ta-package-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ta-product-modal {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        top: auto;
        bottom: 0;
        transform: translate(-50%, 100%);
    }

    .ta-product-modal.active {
        transform: translate(-50%, 0);
    }

    .ta-product-modal-header {
        padding: 14px 16px;
    }

    .ta-product-modal-title {
        font-size: 16px;
    }

    .ta-product-modal-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .ta-product-tabs-nav {
        overflow-x: auto;
    }

    .ta-product-tabs-nav {
        padding: 0 2px 0 0;
    }

    .ta-product-tab-btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .ta-product-tab-pane {
        padding: 12px;
    }

    .ta-product-tabs-content {
        min-height: 180px;
    }

    .ta-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ta-info-item {
        padding: 10px;
    }

    .ta-info-label {
        font-size: 10px;
    }

    .ta-info-value {
        font-size: 13px;
    }

    .ta-attribute-item {
        padding: 10px 12px;
    }

    .ta-attribute-name {
        font-size: 11px;
    }

    .ta-attribute-value {
        font-size: 13px;
    }

    .ta-vehicle-table th,
    .ta-vehicle-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .ta-package-details {
        grid-template-columns: 1fr;
    }

    .ta-empty-state {
        padding: 30px 16px;
    }

    .ta-empty-state-icon {
        font-size: 40px;
    }

    .ta-empty-state-text {
        font-size: 14px;
    }
}

/* Accessibility */
.ta-product-modal:focus {
    outline: 2px solid #E94141;
    outline-offset: 2px;
}

.ta-product-tab-btn:focus-visible {
    outline: 2px solid #E94141;
    outline-offset: -2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ta-product-modal,
    .ta-product-modal-overlay,
    .ta-product-tab-btn,
    .ta-info-item,
    .ta-attribute-item {
        transition: none !important;
        animation: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ta-product-modal {
        border: 2px solid #000;
    }

    .ta-info-item,
    .ta-attribute-item,
    .ta-package-item {
        border: 2px solid #000;
    }

    .ta-product-tab-btn.active::after {
        background: #000;
    }
}

/* Print Styles */
@media print {
    .ta-product-modal-overlay,
    .ta-product-modal {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ta-product-modal {
        background: #1f2937;
        color: #f3f4f6;
    }

    .ta-product-modal-header {
        background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
        border-bottom-color: #374151;
    }

    .ta-product-modal-title {
        color: #f3f4f6 !important;
    }

    .ta-product-modal-close {
        color: #9ca3af;
    }

    .ta-product-modal-close:hover {
        background: #374151;
        color: #f3f4f6;
    }

    .ta-product-tabs-nav {
        background: #1f2937;
        border-bottom-color: #374151;
    }

    .ta-product-tab-btn {
        color: #9ca3af;
    }

    .ta-product-tab-btn:hover {
        color: #f3f4f6;
        background: #374151;
    }

    .ta-product-tab-btn.active {
        color: #E94141;
    }

    .ta-info-item,
    .ta-attribute-item,
    .ta-package-item {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }

    .ta-info-item:hover,
    .ta-attribute-item:hover,
    .ta-package-item:hover {
        background: #4b5563;
        border-color: #6b7280;
    }

    .ta-info-label,
    .ta-attribute-name,
    .ta-package-detail-label {
        color: #d1d5db;
    }

    .ta-info-value,
    .ta-attribute-value,
    .ta-package-detail-value {
        color: #f3f4f6;
    }

    .ta-vehicle-table thead {
        background: #374151;
    }

    .ta-vehicle-table th {
        color: #d1d5db;
        border-bottom-color: #4b5563;
    }

    .ta-vehicle-table td {
        color: #f3f4f6;
        border-bottom-color: #374151;
    }

    .ta-vehicle-table tbody tr:hover {
        background: #4b5563;
    }
}
