/* ============================================
   Shared Modal System · Move Records
   ใช้ร่วมกันทุกหน้า · ไม่กระทบ header/nav
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 18, 32, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 30px 16px;
}

.modal-overlay.show {
    display: flex;
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal-box {
    background: linear-gradient(135deg, #1A2138 0%, #15192C 100%);
    border: 1px solid var(--border-default, rgba(255,255,255,0.12));
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    padding: 28px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 auto;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 12px;
    color: #6B7280;
    font-style: italic;
}

.modal-body {
    font-size: 14px;
    line-height: 1.8;
    color: #B0B8D4;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.modal-body h4 {
    color: #F59E0B;
    margin: 16px 0 8px;
    font-size: 14px;
}

.modal-body h5 {
    color: #A78BFA;
    margin: 12px 0 6px;
    font-size: 13px;
}

.modal-body ul {
    padding-left: 22px;
    margin: 6px 0 12px;
}

.modal-body li {
    margin-bottom: 6px;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 16px;
    font-size: 12px;
}

.modal-body th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    color: #F59E0B;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #B0B8D4;
}

.modal-body strong { color: #fff; }
.modal-body code {
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #C4B5FD;
}

.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.4); border-radius: 3px; }

.source-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 16px;
    font-size: 12px;
}

.source-box .source-label {
    color: #A78BFA;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-size: 10px;
}

/* Detail button */
.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: #A78BFA;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    margin-top: 10px;
}

.btn-detail:hover {
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    color: #fff;
    border-color: transparent;
    transform: translateX(2px);
}
