/* ============================================ */
/* MODEL INFO MODULE - CONTAINER */
/* ============================================ */

[data-name="-- THE MODEL INFO"],
.model-info-container-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    touch-action: auto !important;
}

.model-info-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    background: white;
    pointer-events: auto !important;
    box-sizing: border-box;
}

/* ============================================ */
/* HEADER */
/* ============================================ */

.model-info-header {
    flex-shrink: 0;
    background: #422118;
    padding: 20px;
    border-bottom: 3px solid #EACB32;
    pointer-events: auto !important;
    position: relative;
}

.model-info-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #EACB32;
    text-align: center;
    line-height: 1.4;
}

/* ============================================ */
/* CONTENT AREA - LAYOUT MỚI */
/* ============================================ */

.model-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto !important;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

/* ============================================ */
/* DESCRIPTION - Ở TRÊN, CÓ SCROLLBAR */
/* ============================================ */

.model-info-description {
    order: 1;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 10px 20px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
    white-space: pre-wrap;
    font-family: Arial, sans-serif;
}

.model-info-no-description {
    order: 1;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 10px 20px;
    font-size: 16px;
    color: #999;
    font-style: italic;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Scrollbar cho Description */
.model-info-description::-webkit-scrollbar,
.model-info-no-description::-webkit-scrollbar {
    width: 12px;
}

.model-info-description::-webkit-scrollbar-track,
.model-info-no-description::-webkit-scrollbar-track {
    background: rgba(234, 203, 50, 0.15);
    border-radius: 6px;
    margin: 5px;
}

.model-info-description::-webkit-scrollbar-thumb,
.model-info-no-description::-webkit-scrollbar-thumb {
    background: rgba(234, 203, 50, 0.7);
    border-radius: 6px;
    border: 2px solid white;
    transition: background 0.3s ease;
}

.model-info-description::-webkit-scrollbar-thumb:hover,
.model-info-no-description::-webkit-scrollbar-thumb:hover {
    background: rgba(234, 203, 50, 0.9);
}

.model-info-description::-webkit-scrollbar-thumb:active,
.model-info-no-description::-webkit-scrollbar-thumb:active {
    background: #EACB32;
}

/* Firefox Scrollbar */
.model-info-description,
.model-info-no-description {
    scrollbar-width: thin;
    scrollbar-color: rgba(234, 203, 50, 0.7) rgba(234, 203, 50, 0.15);
}

/* ============================================ */
/* IMAGE GALLERY - Ở DƯỚI */
/* ============================================ */

.model-info-gallery {
    order: 2;
    flex: 0 0 auto;
    padding: 0 20px 10px 20px;
    position: relative;
    max-height: 45%;
}

.model-info-gallery-label {
    font-size: 18px;
    font-weight: bold;
    color: #422118;
    margin-bottom: 15px;
    /* display: block; */
    display: none;
}

.model-info-gallery-container {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    min-height: 250px;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-info-gallery-image {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.model-info-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(66, 33, 24, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 15px 12px;
    transition: all 0.3s ease;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    z-index: 10;
    user-select: none;
}

.model-info-gallery-nav:hover {
    background: rgba(234, 203, 50, 0.5);
    color: #422118;
    transform: translateY(-50%) scale(1.1);
}

.model-info-gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.model-info-gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.model-info-gallery-nav.prev {
    left: 0px;
}

.model-info-gallery-nav.next {
    right: 0px;
}

.model-info-gallery-counter {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(66, 33, 24, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    user-select: none;
}

.model-info-no-images {
    order: 2;
    flex: 0 0 auto;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* ============================================ */
/* LOADING STATE */
/* ============================================ */

.model-info-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

.model-info-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================ */
/* ERROR STATE */
/* ============================================ */

.model-info-error {
    text-align: center;
    padding: 60px 20px;
    color: #e74c3c;
    font-size: 16px;
}

.model-info-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */

@media (max-width: 768px) {
    .model-info-wrapper {
        max-width: 100%;
    }

    .model-info-header {
        padding: 15px;
    }

    .model-info-title {
        font-size: 20px;
    }

    .model-info-description,
    .model-info-no-description {
        padding: 20px;
        font-size: 15px;
        line-height: 1.6;
    }

    .model-info-description::-webkit-scrollbar,
    .model-info-no-description::-webkit-scrollbar {
        width: 8px;
    }

    .model-info-description::-webkit-scrollbar-thumb,
    .model-info-no-description::-webkit-scrollbar-thumb {
        border: 1px solid white;
    }

    .model-info-gallery {
        padding: 0 20px 20px 20px;
        max-height: 50%;
    }

    .model-info-gallery-label {
        font-size: 16px;
    }

    .model-info-gallery-container {
        min-height: 200px;
    }

    .model-info-gallery-image {
        max-height: 350px;
    }

    .model-info-gallery-nav {
        padding: 12px 10px;
        font-size: 20px;
    }

    .model-info-gallery-counter {
        font-size: 13px;
        padding: 6px 14px;
    }
}

@media (max-width: 480px) {
    .model-info-header {
        padding: 12px;
    }

    .model-info-title {
        font-size: 18px;
    }

    .model-info-description,
    .model-info-no-description {
        padding: 15px;
        font-size: 14px;
    }

    .model-info-description::-webkit-scrollbar,
    .model-info-no-description::-webkit-scrollbar {
        width: 6px;
    }

    .model-info-gallery {
        padding: 0 15px 15px 15px;
        max-height: 55%;
    }

    .model-info-gallery-label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .model-info-gallery-container {
        min-height: 180px;
    }

    .model-info-gallery-image {
        max-height: 250px;
    }

    .model-info-gallery-nav {
        padding: 10px 8px;
        font-size: 18px;
    }

    .model-info-gallery-nav.prev {
        left: 5px;
    }

    .model-info-gallery-nav.next {
        right: 5px;
    }

    .model-info-gallery-counter {
        font-size: 12px;
        padding: 5px 12px;
        bottom: 10px;
    }
}

/* ============================================ */
/* ANIMATIONS */
/* ============================================ */

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

.model-info-container-wrapper {
    animation: fadeIn 0.3s ease;
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

.model-info-gallery-nav:focus {
    outline: 0px solid #EACB32;
    outline-offset: 2px;
}

/* ============================================ */
/* TOUCH DEVICES */
/* ============================================ */

@media (hover: none) {
    .model-info-gallery-nav:hover {
        background: rgba(66, 33, 24, 0.7);
        color: white;
        transform: translateY(-50%);
    }
}