/* ========================================
   MODEL PAGE - model.php
   ======================================== */

/* -------------- BREADCRUMB -------------- */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px 0;
    font-size: 0.82rem;
    color: #999;
    flex-wrap: wrap;
    max-width: 1800px;
    margin: 0 auto;
    width: 98%;
}

.breadcrumb-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-nav a:hover {
    color: #a049cc;
}

.breadcrumb-sep {
    font-size: 1rem;
    color: #ccc;
}

.breadcrumb-current {
    color: #1a1a2e;
    font-weight: 500;
}

/* -------------- LAYOUT -------------- */
#page-container {
    width: 98%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0.5rem 0 0;
    display: flex;
    flex-direction: row-reverse;
    gap: 20px;
}

/* -------------- MAIN COLUMN (left: canvas + description) -------------- */
.main-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* -------------- SIDEBAR (right) -------------- */
.top-block {
    display: flex;
    gap: 12px;
    flex-direction: column;
    max-width: 340px;
    min-width: 300px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-bottom: 20px;
}

.top-block::-webkit-scrollbar {
    width: 0;
}

.media-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.left-image img {
    width: 100%;
    height: auto;
    max-height: 220px;
    display: block;
    object-fit: cover;
    border-radius: 10px;
}

.right-video video {
    display: block;
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 10px;
}

/* -------------- 3D VIEWER -------------- */
#canvas-container {
    width: 100%;
    margin-bottom: 0;
    max-height: 65vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f0f0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    background: #e8e8e8;
    cursor: grab;
}

/* -------------- MODEL INFO OVERLAY -------------- */
#model-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 12px 14px;
    font-size: 13px;
    border-radius: 10px;
    line-height: 1.6;
    z-index: 2;
    max-width: 220px;
    backdrop-filter: blur(6px);
}

#model-info b {
    font-weight: 600;
    color: #ddd;
}

#model-info .button,
#model-info button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 6px;
    margin-bottom: 0;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    transition: background 0.2s;
}

#model-info .button:hover,
#model-info button:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

#model-info #toggle-model-version {
    background: #a049cc !important;
    color: #fff !important;
    font-weight: 600;
    margin-top: 8px;
}

#model-info #toggle-model-version:hover {
    background: #8a3aad !important;
}

#model-info button.active {
    background: rgba(130, 220, 110, 0.35) !important;
    color: #fff !important;
}

/* -------------- MODEL TITLE -------------- */
.model-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* -------------- DOWNLOAD PANEL -------------- */
.download-panel {
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    gap: 0;
}

.dl-separator {
    height: 1px;
    background: #eee;
    margin: 10px 0;
}

.dl-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.dl-header i {
    font-size: 1.1rem;
    color: #a049cc;
}

.dl-license {
    margin-bottom: 10px;
}

.dl-license-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
}

.dl-license-label input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #a049cc;
}

.dl-license-label a {
    color: #a049cc;
}

.dl-links {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.dl-section {
    background: #fafbfc;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.dl-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dl-section-title i {
    color: #a049cc;
    font-size: 0.95rem;
}

.dl-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: #a049cc;
    color: #fff;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.dl-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(160, 73, 204, 0.3);
    opacity: 0.9;
}

.dl-btn i {
    font-size: 0.85rem;
}

.dl-btn-outline {
    background: #fff;
    color: #a049cc;
    border: 1px solid #a049cc;
}

.dl-btn-outline:hover {
    background: #a049cc;
    color: #fff;
}

/* -------------- LIKE / DISLIKE -------------- */
.like-dislike-container {
    margin: 6px 0;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.like-btn,
.dislike-btn {
    border-radius: 8px;
    font-size: 14px;
    min-width: 60px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.like-btn {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.like-btn:hover {
    background: #c8e6c9;
    transform: translateY(-1px);
}

.dislike-btn {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

.dislike-btn:hover {
    background: #ffcdd2;
    transform: translateY(-1px);
}

.selectedLike {
    background: #2e7d32 !important;
    color: #fff !important;
    border-color: #2e7d32 !important;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.selectedDislike {
    background: #c62828 !important;
    color: #fff !important;
    border-color: #c62828 !important;
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.3);
}

/* -------------- DESCRIPTION -------------- */
.description-container {
    border: 1px solid #e8ecf1;
    padding: 20px 24px;
    border-radius: 12px;
    background-color: #fafbfc;
    margin-top: 0;
}

.description-container h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.description-container p {
    color: #555;
    line-height: 1.7;
    font-size: 0.9rem;
}

.model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
    margin: 12px 0;
}

.model-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #f0f0f0;
    color: #555;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

.model-tag i {
    font-size: 0.85rem;
    color: #888;
}

.model-tag-free {
    background: #e8f5e9;
    color: #2e7d32;
}

.model-tag-free i {
    color: #2e7d32;
}

.model-seo-text {
    color: #777 !important;
    font-size: 0.82rem !important;
    line-height: 1.6 !important;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.model-seo-text strong {
    color: #555;
    font-weight: 600;
}

/* -------------- FEATURED SECTION -------------- */
.model-featured {
    padding-bottom: 30px;
}

.model-featured-inner {
    text-align: center;
}

.model-featured .section-title {
    padding: 0;
    margin-bottom: 20px;
    margin-top: 10px;
    display: block;
    text-align: center;
}

.model-featured .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

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

/* -------------- LAPTOP (< 1100px) -------------- */
@media (max-width: 1100px) {
    .top-block {
        max-width: 300px;
        min-width: 260px;
    }

    .left-image img {
        max-height: 180px;
    }
}

/* -------------- TABLET (< 900px) -------------- */
@media (max-width: 900px) {
    .breadcrumb-nav {
        padding: 8px 12px 0;
        width: auto;
    }

    #page-container {
        flex-direction: column;
        padding: 0.5rem 12px 0;
        gap: 14px;
        width: auto;
    }

    /* Canvas + description first on mobile */
    .main-column {
        order: -1;
    }

    /* 3D viewer */
    #canvas-container {
        margin: 0;
        max-height: unset;
        overflow: visible;
        border-radius: 10px 10px 0 0;
        flex-direction: column;
    }

    #canvas-container canvas {
        height: 45vh !important;
        border-radius: 10px 10px 0 0;
    }

    /* Model info bar below canvas */
    #model-info {
        position: static;
        max-width: unset;
        width: 100%;
        background: #1a1a2e;
        border-radius: 0;
        backdrop-filter: none;
        padding: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        line-height: 1.4;
        box-sizing: border-box;
    }

    #model-info br {
        display: none;
    }

    #model-info b {
        color: #aaa;
        font-size: 11px;
    }

    #model-info button {
        flex: 1;
        min-width: 80px;
        padding: 8px 8px;
        font-size: 0.75rem;
    }

    #model-info #toggle-model-version {
        flex-basis: 100%;
    }

    /* Title + description */
    .model-title {
        font-size: 1.15rem;
        text-align: left;
    }

    .description-container {
        border-radius: 10px;
        padding: 16px;
    }

    /* Sidebar becomes full-width section below */
    .top-block {
        width: 100%;
        max-width: unset;
        min-width: unset;
        position: static;
        max-height: unset;
        overflow-y: visible;
        margin-bottom: 0;
        padding-bottom: 0;
        flex-direction: column;
        gap: 12px;
        box-sizing: border-box;
    }

    /* Image + video side by side */
    .media-row {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .left-image {
        flex: 1;
        min-width: 0;
    }

    .left-image img {
        max-height: 180px;
        width: 100%;
        border-radius: 10px;
    }

    .right-video {
        flex: 1;
        min-width: 0;
    }

    .right-video video {
        max-height: 180px;
        width: 100%;
        border-radius: 10px;
    }

    /* Download panel takes full width */
    .download-panel {
        width: 100%;
        padding: 14px;
        border-radius: 10px;
        box-sizing: border-box;
    }
}

/* -------------- MOBILE (< 600px) -------------- */
@media (max-width: 600px) {
    .breadcrumb-nav {
        padding: 6px 10px 0;
        font-size: 0.78rem;
    }

    #page-container {
        padding: 0.5rem 8px 0;
        gap: 10px;
    }

    #canvas-container canvas {
        height: 35vh !important;
    }

    #model-info {
        font-size: 11px;
        padding: 10px;
        gap: 4px;
    }

    #model-info button {
        min-width: 70px;
        padding: 7px 6px;
        font-size: 0.72rem;
    }

    .model-title {
        font-size: 1.05rem;
    }

    .description-container {
        padding: 12px;
    }

    .description-container p {
        font-size: 0.85rem;
    }

    .top-block {
        flex-direction: column;
    }

    .media-row {
        flex-direction: column;
        gap: 8px;
    }

    .left-image img {
        max-height: 200px;
    }

    .like-btn,
    .dislike-btn {
        min-width: 55px;
        padding: 7px 10px;
        font-size: 13px;
    }

    .dl-section {
        padding: 8px 10px;
    }

    .dl-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
}

/* -------------- ADMIN REGEN PANEL -------------- */
.admin-regen-panel {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 100%);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(160, 73, 204, 0.2);
}

.admin-regen-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.admin-regen-label i {
    font-size: 0.8rem;
}

.admin-regen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: #a049cc;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(160, 73, 204, 0.3);
}

.admin-regen-btn:hover {
    background: #b35de0;
    box-shadow: 0 4px 16px rgba(160, 73, 204, 0.5);
    transform: translateY(-1px);
}

.admin-regen-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(160, 73, 204, 0.3);
}

.admin-regen-btn:disabled {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    cursor: wait;
    box-shadow: none;
    transform: none;
}

.admin-regen-btn i {
    font-size: 1.05rem;
}

.admin-regen-status {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
}

.regen-success {
    background: rgba(46, 125, 50, 0.15);
    color: #81c784;
    border: 1px solid rgba(46, 125, 50, 0.3);
}

.regen-error {
    background: rgba(198, 40, 40, 0.15);
    color: #ef9a9a;
    border: 1px solid rgba(198, 40, 40, 0.3);
}

@keyframes ri-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ri-spin {
    animation: ri-spin 1s linear infinite;
}
