/* =============================================
   Modaliniai langai
   ============================================= */

/* -- Įvykio modalinis langas ------------------- */

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 4, 0.8);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#modal {
    background: #f5f0e0;
    color: #2c1810;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

#modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #d4c9a8;
}

#modal-title {
    font-size: 20px;
    color: #4a3728;
    flex: 1;
    padding-right: 16px;
}

#modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8b7355;
    cursor: pointer;
    line-height: 1;
}

#modal-body {
    padding: 16px 24px;
}

.modal-meta time {
    color: #8b7355;
    font-size: 13px;
}

.modal-description {
    margin-top: 12px;
    line-height: 1.7;
    font-size: 15px;
}

.modal-description p {
    margin-bottom: 12px;
}

.modal-media {
    margin-top: 16px;
}

.modal-media figure {
    margin-bottom: 12px;
}

.modal-media img {
    max-width: 100%;
    border-radius: 6px;
}

.modal-media figcaption {
    font-size: 12px;
    color: #8b7355;
    margin-top: 4px;
}

.external-link {
    display: inline-block;
    color: #8b6914;
    margin: 4px 0;
}

/* -- Komentarai -------------------------------- */

#modal-comments {
    border-top: 1px solid #d4c9a8;
    padding: 16px 24px 20px;
}

#modal-comments h3 {
    font-size: 15px;
    color: #4a3728;
    margin-bottom: 12px;
}

.comment {
    padding: 10px 0;
    border-bottom: 1px solid #e8dcc0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-header strong {
    color: #4a3728;
    font-size: 13px;
}

.comment-header time {
    color: #a89878;
    font-size: 11px;
}

.comment p {
    font-size: 14px;
    line-height: 1.5;
}

.comments-empty {
    color: #a89878;
    font-size: 13px;
}

.comment-login-hint {
    font-size: 13px;
    color: #8b7355;
}

.comment-login-hint a {
    color: #8b6914;
}

#new-comment-form {
    margin-top: 12px;
}

#new-comment-form textarea {
    width: 100%;
    border: 1px solid #d4c9a8;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: #fff;
}

#new-comment-form .btn-primary {
    margin-top: 8px;
}

/* -- 3D peržiūra ------------------------------- */

#viewer3d-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 4, 0.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#viewer3d-container {
    background: #f0ece0;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#viewer3d-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #d4c9a8;
}

#viewer3d-title {
    font-size: 18px;
    color: #4a3728;
}

#viewer3d-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8b7355;
    cursor: pointer;
}

#viewer3d-canvas-wrap {
    flex: 1;
    overflow: hidden;
}

#viewer3d-canvas-wrap canvas {
    width: 100%;
    height: 100%;
}

#viewer3d-timeline {
    display: flex;
    gap: 4px;
    padding: 10px 20px;
    overflow-x: auto;
    border-top: 1px solid #d4c9a8;
}

.viewer3d-step {
    background: #d4c9a8;
    color: #4a3728;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background 0.2s;
}

.viewer3d-step:hover,
.viewer3d-step.active {
    background: #8b6914;
    color: #fff;
}

/* -- Autentifikacija --------------------------- */

#auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 4, 0.8);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

#auth-modal {
    background: #f5f0e0;
    border-radius: 12px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    position: relative;
}

#auth-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    color: #8b7355;
    cursor: pointer;
}

#auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: #e8dcc0;
    color: #6b5a48;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.2s;
}

.auth-tab.active {
    background: #8b6914;
    color: #fff;
}

.auth-form input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #d4c9a8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 10px;
}

.form-error {
    color: #c0392b;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}
