﻿/* ===== ФИНАЛЬНЫЙ СТИЛЬ ДЛЯ СТРАНИЦЫ ДЕТАЛЕЙ СООБЩЕНИЯ ===== */
:root {
    --primary-blue: #2b6cb0;
    --primary-dark: #2c5282;
    --success-green: #38a169;
    --warning-yellow: #d69e2e;
    --bg-light: #f7fafc;
    --card-shadow: 0 8px 24px rgba(0,0,0,0.06);
    --radius: 16px;
    --font: system-ui, -apple-system, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg-light);
}

#dozorDetail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

    /* ===== ШАПКА ===== */
    #dozorDetail h1 {
        font-size: 1.75rem;
        font-weight: 600;
        color: #2d3748;
        margin-top: 34px;
        letter-spacing: -0.01em;
    }

/* ===== КНОПКА ПОДПИСКИ ===== */
.subscribe {
    display: inline-block;
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 40px !important;
    padding: 6px 16px !important;
    font-weight: 500 !important;
    color: var(--primary-blue) !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

    .subscribe:hover {
        background: #edf2f7 !important;
        border-color: var(--primary-blue) !important;
    }

    .subscribe i {
        margin-right: 6px;
        color: var(--primary-blue);
    }

/* ===== ЛЕВАЯ КОЛОНКА ===== */
#dozorDetail .col-md-8 {
    background: white;
    border-radius: var(--radius);
    padding: 24px !important;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

    #dozorDetail .col-md-8 > div:first-child {
        color: #718096;
        font-size: 0.9rem;
    }

.messageFields {
    font-size: 1rem;
    margin-bottom: 6px;
    color: #2d3748;
}

    .messageFields:before {
        content: "• ";
        color: var(--primary-blue);
        font-weight: 700;
    }

#dozorDetail .col-md-8 hr {
    border: none;
    border-top: 1px solid #edf2f7;
    margin: 16px 0;
}

#dozorDetail .col-md-8 > div:last-child {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #2d3748;
    white-space: pre-wrap;
}

/* ===== ПРАВАЯ КОЛОНКА ===== */
#dozorDetail .col-md-4 {
    background: white;
    border-radius: var(--radius);
    padding: 20px !important;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

#detailMwssageMap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

#dozorDetail .col-md-4 > div[class*="responcible"] {
    font-size: 0.95rem;
    color: #2d3748;
}

    #dozorDetail .col-md-4 > div[class*="responcible"] div {
        margin-bottom: 2px;
    }

        #dozorDetail .col-md-4 > div[class*="responcible"] div:first-child {
            font-weight: 600;
            color: var(--primary-blue);
        }

#dozorDetail .col-md-4 a[onclick*="anichange"] {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed #cbd5e0;
}

    #dozorDetail .col-md-4 a[onclick*="anichange"]:hover {
        border-bottom-color: var(--primary-blue);
    }

/* ===== СТАТУСЫ ===== */
.status-list {
    margin: 0 20px;
}

.status-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin: 10px 0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-left: 6px solid transparent;
    transition: all 0.2s ease;
}

    .status-item:hover {
        box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    }

    .status-item i {
        font-size: 2rem;
        width: 2.5rem;
        text-align: center;
        margin-right: 12px;
        flex-shrink: 0;
    }

.status-date {
    font-size: 1rem;
    color: #718096;
    margin-right: 12px;
    font-weight: 500;
}

.status-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

/* ----- Существующие стили (вы их уже использовали) ----- */
.status-new {
    border-left-color: #2D8CEC;
    background: #ebf8ff;
}

    .status-new i {
        color: #2D8CEC;
    }

.status-inprogress {
    border-left-color: #ECBC2D;
    background: #fffff0;
}

    .status-inprogress i {
        color: #ECBC2D;
    }

.status-clarify {
    border-left-color: #EB832E;
    background: #fff5f0;
}

    .status-clarify i {
        color: #EB832E;
    }

.status-resolved {
    border-left-color: #5FBA8C;
    background: #f0fff4;
}

    .status-resolved i {
        color: #5FBA8C;
    }

/* ----- Новые стили для всех остальных статусов ----- */

/* 3 – Продление срока */
.status-extension {
    border-left-color: #805AD5;
    background: #faf5ff;
}

    .status-extension i {
        color: #805AD5;
    }

/* 6 – Не прошло проверку */
.status-failed {
    border-left-color: #E53E3E;
    background: #fff5f5;
}

    .status-failed i {
        color: #E53E3E;
    }

/* 101 – Черновик */
.status-draft {
    border-left-color: #A0AEC0;
    background: #f7fafc;
}

    .status-draft i {
        color: #A0AEC0;
    }

/* 201 – На проверке */
.status-review {
    border-left-color: #ED64A6;
    background: #fff5f7;
}

    .status-review i {
        color: #ED64A6;
    }

/* 202 – Прошла модерацию контролером */
.status-moderated {
    border-left-color: #38B2AC;
    background: #e6fffa;
}

    .status-moderated i {
        color: #38B2AC;
    }

/* 203 – Назначена */
.status-assigned {
    border-left-color: #48BB78;
    background: #f0fff4;
}

    .status-assigned i {
        color: #48BB78;
    }

/* 401 – Результат не соответствует действительности */
.status-invalid {
    border-left-color: #9B2C2C;
    background: #fff5f5;
}

    .status-invalid i {
        color: #9B2C2C;
    }

/* 402 – Перезапущена (доработка) */
.status-restarted {
    border-left-color: #D69E2E;
    background: #fffff0;
}

    .status-restarted i {
        color: #D69E2E;
    }

/* Резерв */
.status-default {
    border-left-color: #718096;
    background: #edf2f7;
}

    .status-default i {
        color: #718096;
    }

/* ===== ГАЛЕРЕЯ ФОТО (ОСНОВНАЯ) ===== */
#dozorDetail .image-row {
    display: block !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto 20px auto !important;
    padding: 0 !important;
}

#dozorDetail .photo_wrap {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 100% !important; /* 1:1 */
    background: #edf2f7 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    transition: box-shadow 0.3s ease !important;
}

    #dozorDetail .photo_wrap:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,0.10) !important;
    }

    /* Ссылка в основной галерее — абсолютная (здесь нужна) */
    #dozorDetail .photo_wrap .r-image-link {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        text-decoration: none !important;
    }

#dozorDetail .dozor-img-thumbnail {
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center center !important;
    background-color: #edf2f7 !important;
    transition: none !important;
}

/* ===== ОТВЕТЫ ИСПОЛНИТЕЛЕЙ ===== */
#dozorDetail .btnAnswerItem {
    background: white;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border-left: 6px solid var(--primary-blue);
    transition: box-shadow 0.2s ease;
}

    #dozorDetail .btnAnswerItem:hover {
        box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    }

    #dozorDetail .btnAnswerItem > div:first-child {
        font-weight: 600;
        color: #2d3748;
        margin-bottom: 8px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
    }

        #dozorDetail .btnAnswerItem > div:first-child span {
            background: #edf2f7;
            padding: 2px 12px;
            border-radius: 20px;
            font-size: 0.85rem;
            color: #2d3748;
        }

            #dozorDetail .btnAnswerItem > div:first-child span:last-of-type {
                background: #ebf8ff;
                color: var(--primary-blue);
            }

    #dozorDetail .btnAnswerItem > div:nth-child(2) {
        font-size: 1rem;
        line-height: 1.6;
        color: #4a5568;
        white-space: pre-wrap;
        margin-bottom: 12px;
    }

    /* Миниатюры в ответах – БЕЗ АБСОЛЮТНОГО ПОЗИЦИОНИРОВАНИЯ */
    #dozorDetail .btnAnswerItem .image-line {
        display: inline-block !important;
        width: 80px !important;
        height: 80px !important;
        margin: 8px 8px 0 0 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
        transition: box-shadow 0.2s ease !important;
        vertical-align: top !important;
        background: #edf2f7 !important;
        /* позиционирование не требуется, так как ссылка внутри — блочная */
    }

        #dozorDetail .btnAnswerItem .image-line:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.10) !important;
        }

        /* Переопределяем ссылку внутри миниатюры ответа – убираем absolute */
        #dozorDetail .btnAnswerItem .image-line .r-image-link {
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            /* position: static;  или вообще убираем – наследуется от родителя, но перекрываем */
            position: static !important; /* отменяем absolute */
            text-decoration: none !important;
        }

        #dozorDetail .btnAnswerItem .image-line .dozor-img-thumbnail {
            width: 100% !important;
            height: 100% !important;
            background-size: cover !important;
            background-position: center !important;
            transition: none !important;
        }

        /* убираем псевдоэлементы, если они могли быть */
        #dozorDetail .btnAnswerItem .image-line::before,
        #dozorDetail .btnAnswerItem .image-line::after {
            display: none !important;
        }

    #dozorDetail .btnAnswerItem hr {
        border: none;
        border-top: 1px solid #edf2f7;
        margin: 16px 0 0 0;
    }

/* ===== БЛОК "НЕТ ОТВЕТОВ" ===== */
.answers-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 20px;
    margin-bottom: 16px;
}

.no-answers-message {
    background: white;
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 2px dashed #e2e8f0;
    margin-bottom: 20px;
}

.no-answers-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.no-answers-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.no-answers-text {
    font-size: 1rem;
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 6px;
}

.no-answers-hint {
    font-size: 0.9rem;
    color: #718096;
}

/* ===== КОММЕНТАРИИ ===== */
#dozorDetail > div:has(.commentArea) {
    background: white;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}

#dozorDetail .commentArea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

    #dozorDetail .commentArea:focus {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
        outline: none;
    }

#dozorDetail .greenButton {
    background: var(--success-green) !important;
    border: none !important;
    border-radius: 40px !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(56,161,105,0.35) !important;
    transition: all 0.2s ease;
    display: inline-block;
    width: auto;
    margin: 12px 0 0;
}

    #dozorDetail .greenButton:hover {
        background: #2f855a !important;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(56,161,105,0.4) !important;
    }

/* Список комментариев */
#dozorDetail > div:has(.commentArea) + div,
#dozorDetail > div:has(> div:contains("комментарии:")) {
    background: white;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--card-shadow);
    margin-top: 16px;
}

    #dozorDetail > div:has(> div:contains("комментарии:")) > div:first-child {
        font-weight: 600;
        color: #2d3748;
        margin-bottom: 12px;
    }

    #dozorDetail > div:has(> div:contains("комментарии:")) > div:not(:first-child) {
        padding: 10px 0;
        border-bottom: 1px solid #edf2f7;
    }

        #dozorDetail > div:has(> div:contains("комментарии:")) > div:not(:first-child):last-child {
            border-bottom: none;
        }

        #dozorDetail > div:has(> div:contains("комментарии:")) > div:not(:first-child) span:first-child {
            font-weight: 500;
            color: var(--primary-blue);
            margin-right: 12px;
        }

        #dozorDetail > div:has(> div:contains("комментарии:")) > div:not(:first-child) span:last-child {
            color: #4a5568;
        }

/* ===== МОДАЛЬНОЕ ОКНО ===== */
#ModalMessageForm .modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

#ModalMessageForm .modal-header {
    border-bottom: 1px solid #edf2f7;
}

#ModalMessageForm .modal-footer {
    border-top: 1px solid #edf2f7;
}

#ModalMessageForm .modal-title {
    font-weight: 600;
    color: #2d3748;
}


footer {
    background: #1e4e5d;
    color: #D3D8E9;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    #dozorDetail .col-md-8,
    #dozorDetail .col-md-4 {
        padding: 16px !important;
    }

    #dozorDetail .col-md-8 {
        margin-right: 0;
    }

    #dozorDetail .btnAnswerItem .image-line {
        width: 60px !important;
        height: 60px !important;
    }

    #dozorDetail h1 {
        font-size: 1.4rem;
    }

    .subscribe {
        font-size: 0.8rem;
        padding: 4px 12px;
    }

    .status-item {
        padding: 10px 14px;
        margin: 8px 0;
    }

        .status-item i {
            font-size: 1.5rem;
            width: 2rem;
        }

    .status-date, .status-name {
        font-size: 0.9rem;
    }

    .no-answers-message {
        padding: 24px 16px;
    }

    .no-answers-icon {
        font-size: 2.5rem;
    }

    .no-answers-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 640px) {
    #dozorDetail .image-row {
        max-width: 100% !important;
    }
}
