/**
 * Styles for local_policydocs plugin — Moodle 4.4
 *
 * @package    local_policydocs
 * @copyright  2025 UUDS Training Platform
 */

/* ============================================================
   LOGIN PAGE NOTICE
   ============================================================ */
.local-policydocs-notice {
    max-width: 460px;
    margin: 1.25rem auto 0;
    padding: 0.75rem 1.25rem;
    background: #eef3fd;
    border: 1px solid #b8cef5;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    color: #2d3a4a;
}

.policydocs-notice-text {
    margin: 0;
}

.policydocs-link {
    font-weight: 600;
    color: #1a56db;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.policydocs-link:hover,
.policydocs-link:focus {
    color: #0f3da8;
    text-decoration: none;
}

/* ============================================================
   VIEW PAGE — OUTER WRAPPER
   ============================================================ */
.local-policydocs-container {
    max-width: 860px;
    margin: 2.5rem auto 4rem;
    padding: 0 1.5rem;
}

/* ============================================================
   PAGE TITLE
   ============================================================ */
.policydocs-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.policydocs-title-bar {
    width: 64px;
    height: 4px;
    background: #1a56db;
    border-radius: 2px;
    margin-bottom: 2rem;
}

/* ============================================================
   HTML EDITOR CONTENT BLOCK
   ============================================================ */
.policydocs-html-body {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 2rem 2.5rem;
    font-size: 0.9625rem;
    line-height: 1.75;
    color: #1f2937;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.policydocs-html-body h1,
.policydocs-html-body h2,
.policydocs-html-body h3,
.policydocs-html-body h4 {
    color: #111827;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.policydocs-html-body h1 { font-size: 1.5rem; }
.policydocs-html-body h2 { font-size: 1.25rem; }
.policydocs-html-body h3 { font-size: 1.1rem; }

.policydocs-html-body p {
    margin-bottom: 1rem;
}

.policydocs-html-body ul,
.policydocs-html-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.policydocs-html-body li {
    margin-bottom: 0.35rem;
}

.policydocs-html-body a {
    color: #1a56db;
    text-decoration: underline;
}

.policydocs-html-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
}

.policydocs-html-body th,
.policydocs-html-body td {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.policydocs-html-body th {
    background: #f3f4f6;
    font-weight: 600;
}

/* ============================================================
   FILE INFO BAR
   ============================================================ */
.policydocs-file-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.25rem;
}

.policydocs-file-meta {
    flex: 1;
    min-width: 0;
}

.policydocs-dl-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ============================================================
   PDF EMBED
   ============================================================ */
.policydocs-pdf-wrap {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    background: #525659;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.policydocs-pdf-frame {
    display: block;
    width: 100%;
    height: 78vh;
    min-height: 560px;
    border: none;
}

/* ============================================================
   PLAIN TEXT VIEWER
   ============================================================ */
.policydocs-text-frame {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 72vh;
    overflow-y: auto;
    color: #374151;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ============================================================
   DOCX / DOWNLOAD PROMPT
   ============================================================ */
.policydocs-dl-prompt {
    background: #f9fafb;
    border: 2px dashed #9ca3af;
    border-radius: 12px;
    padding: 3rem 2rem;
}

.policydocs-dl-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 1rem;
}

/* ============================================================
   EMPTY / NO CONTENT NOTICE
   ============================================================ */
.policydocs-empty-notice {
    border-radius: 8px;
    font-size: 0.9375rem;
}

/* ============================================================
   BACK BUTTON ROW
   ============================================================ */
.policydocs-back-wrap {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ============================================================
   RESPONSIVE — SMALL SCREENS
   ============================================================ */
@media (max-width: 600px) {
    .local-policydocs-container {
        padding: 0 0.875rem;
        margin-top: 1.5rem;
    }

    .policydocs-html-body {
        padding: 1.25rem;
    }

    .policydocs-title {
        font-size: 1.5rem;
    }

    .policydocs-pdf-frame {
        height: 60vh;
        min-height: 380px;
    }

    .policydocs-file-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .local-policydocs-notice {
        margin-left: 1rem;
        margin-right: 1rem;
    }
}
