/* 
 * Shared News Modal Styles
 * Central source of truth for both Public and Admin
 */

:root {
    --n-bg: #0f1115;
    --n-border: rgba(255, 255, 255, 0.05);
    --n-text: #f8f9fa;
    --n-muted: #a0aab2;
    --n-primary: #fd7e14;
}

/* Enforce Dark Mode Structure */
.modal-content-wrapper, .dark-modal-content {
    position: relative !important;
    background: var(--n-bg) !important;
    color: var(--n-text) !important;
    max-width: 800px !important;
    width: 100% !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    padding: 0 !important;
    z-index: 1;
    border: 1px solid var(--n-border) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6) !important;
    animation: n-modal-pop 0.3s ease-out;
}

#modalHeaderArea, .modal-header-area, .dark-modal-header {
    padding: 40px 40px 10px !important;
    background: var(--n-bg) !important;
    border-bottom: 1px solid var(--n-border) !important;
    flex-shrink: 0;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.modal-body, .dark-modal-body {
    padding: 20px 40px 40px !important;
    overflow-y: auto !important;
    flex: 1;
    color: var(--n-text) !important;
    background: var(--n-bg) !important;
}

.modal-close, .dark-modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    font-size: 2rem !important;
    color: var(--n-muted) !important;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 100;
}

.modal-close:hover, .dark-modal-close:hover {
    color: var(--n-primary) !important;
}

/* Metadata Standard (Premium Look) */
.modal-news-meta {
    color: var(--n-primary) !important;
    font-weight: bold !important;
    margin-bottom: 10px !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    display: block;
}

.modal-header-area h2, .dark-modal-header h2 {
    margin: 0 !important;
    color: #fff !important;
    font-size: 24px !important;
    font-family: 'Outfit', sans-serif !important;
    line-height: 1.2 !important;
}

.modal-body-text {
    line-height: 1.8 !important;
    color: var(--n-text) !important;
    font-size: 1.05rem !important;
}

.modal-img-wrapper {
    position: relative;
    margin-bottom: 5px; /* Reduced to sit closer to subtitle */
}

.modal-img-wrapper img {
    display: block;
    width: 100%;
}

.copyright-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
}

.image-caption {
    font-size: 0.85rem;
    color: var(--n-muted);
    font-style: italic;
    margin-top: 8px;
    margin-bottom: 5px;
    padding-left: 8px;
    border-left: 2px solid var(--n-primary);
    line-height: 1.4;
}

.modal-main-img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin-bottom: 0 !important; /* Spacing handled by wrapper/caption */
    display: block !important;
}

.preview-main-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.news-tags {
    margin-top: 10px;
    margin-bottom: 10px;
}

.badge-tag, .preview-badge-tag {
    background: rgba(253, 126, 20, 0.2) !important;
    color: var(--n-primary) !important;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    font-weight: 600;
    text-decoration: none !important;
    display: inline-block;
    transition: all 0.2s;
    border: 1px solid transparent;
}

a.badge-tag:hover {
    background: var(--n-primary) !important;
    color: #fff !important;
}

.modal-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.modal-img-wrapper img {
    display: block;
    width: 100%;
    border-radius: 8px;
}

.modal-body-text img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
}

@keyframes n-modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Draft Toggle (Admin) */
.modal-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.modal-header-flex h2 {
    margin: 0 !important;
}
.draft-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}
.draft-toggle-label {
    font-size: 12px;
    color: var(--n-muted);
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s;
}
.draft-toggle-label.active {
    color: #fff;
    font-weight: bold;
}
.draft-toggle-container .toggle-switch {
    margin: 0;
}

/* Review Approval Bar */
.review-approval-bar {
    background: rgba(255,255,255,0.05);
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.review-approval-bar span {
    color: var(--n-muted);
    font-size: 14px;
}
.review-approval-actions {
    display: flex;
    gap: 10px;
}

/* Modal Navigation */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--n-muted);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
    font-size: 24px;
}
.modal-nav-btn:hover {
    background: rgba(253, 126, 20, 0.8);
    color: #fff;
}
.modal-nav-btn.nav-prev {
    left: 20px;
}
.modal-nav-btn.nav-next {
    right: 20px;
}
.modal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0,0,0,0.2);
}
@media (max-width: 768px) {
    .modal-nav-btn {
        display: none; /* Hide visual arrows on mobile to save space, swipe/keyboard still possible if applicable */
    }
}

/* Profile Layout overrides */
.modal[data-layout="profile"] .modal-content-wrapper,
.modal[data-layout="profile"] .dark-modal-content {
    max-width: 900px !important;
    border-radius: 20px !important;
    flex-direction: row !important;
    padding: 0 !important;
}

.modal[data-layout="profile"] .modal-body,
.modal[data-layout="profile"] .dark-modal-body {
    padding: 0 !important;
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden; /* Scroll is handled in details */
}

/* Profile specific components */
.profile-layout-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.modal-photo { flex: 0 0 40%; background: #1a1a1a; position: relative; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-photo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 100px; color: rgba(255,255,255,0.05); }

.modal-details { flex: 1; padding: 40px; overflow-y: auto; text-align: left; }
.modal-num { font-size: 3rem; font-weight: 800; color: var(--primary); font-family: 'Outfit', sans-serif; line-height: 1; margin-bottom: 5px; }
.modal-name { font-size: 2.2rem; font-weight: 800; font-family: 'Outfit', sans-serif; text-transform: uppercase; margin-bottom: 5px; line-height: 1.1; }
.modal-unit-tag { font-size: 14px; font-weight: 600; color: #94a3b8; margin-bottom: 20px; display: block; }
.modal-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.modal-bio { font-size: 1.1rem; line-height: 1.6; color: #cbd5e1; white-space: pre-line; }
.modal-bio-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); margin-bottom: 10px; opacity: 0.8; }

/* Move close button into details on desktop */
.modal[data-layout="profile"] .modal-close {
    background: rgba(0,0,0,0.2) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
    top: 15px !important;
    right: 20px !important;
}

@media (max-width: 768px) {
    .modal[data-layout="profile"] .modal-body,
    .modal[data-layout="profile"] .dark-modal-body,
    .profile-layout-wrapper {
        flex-direction: column !important;
        overflow-y: auto;
    }
    .modal[data-layout="profile"] .modal-content-wrapper {
        max-height: 95vh !important;
    }
    .modal-photo { flex: 0 0 350px; }
    .modal-details { padding: 30px; overflow-y: visible; }
    .modal-name { font-size: 1.8rem; }
}
