/* Apple Style Design - Net View Modules */

/* 로컬 폰트 설정 (fonts 폴더에 파일을 넣으세요) */
@font-face {
    font-family: 'NVM-Custom-Font';
    src: url('fonts/CustomFont.woff2') format('woff2'),
         url('fonts/CustomFont.woff') format('woff'),
         url('fonts/CustomFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --nvm-apple-font: 'NVM-Custom-Font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --nvm-bg-glass: rgba(255, 255, 255, 0.7);
    --nvm-border-glass: rgba(255, 255, 255, 0.5);
    --nvm-shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
    --nvm-shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.12);
    --nvm-radius-xl: 24px;
    --nvm-radius-lg: 18px;
    --nvm-radius-md: 12px;
}

.nvm-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    padding: 40px 0;
    justify-content: flex-start;
}

/* Module Box: Apple Glassmorphism */
.nvm-module-box {
    font-family: var(--nvm-apple-font);
    background: var(--nvm-base-bg, var(--nvm-bg-glass));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--nvm-border-glass);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--nvm-global-radius, var(--nvm-radius-xl));
    box-shadow: var(--nvm-shadow-soft);
    
    width: 280px;
    height: 320px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    overflow: visible;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
}

.nvm-module-box:hover {
    transform: translateY(calc(-8px * var(--nvm-global-hover-enabled, 1))) scale(1.02);
    box-shadow: var(--nvm-shadow-hover);
    background: var(--nvm-hover-bg, rgba(255, 255, 255, 0.8)) !important;
}

.nvm-module-header {
    padding: 24px 24px 12px 24px;
    border-bottom: none;
    transition: all 0.3s ease;
}

.nvm-module-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.01em;
    opacity: 0.9;
}

.nvm-module-body {
    padding: 0 24px 24px 24px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

.nvm-module-body::-webkit-scrollbar {
    display: none;
}

/* News Item */
.nvm-news-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease;
}

.nvm-news-item:last-child {
    border-bottom: none;
}

.nvm-news-item.has-image {
    flex-direction: row;
    align-items: center;
}

.nvm-news-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--nvm-radius-md);
    overflow: hidden;
    background: #f5f5f7;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nvm-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nvm-news-item:hover .nvm-news-thumb img {
    transform: scale(1.1);
}

.nvm-news-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.nvm-news-desc {
    font-size: 0.85rem;
    color: #86868b;
    line-height: 1.5;
    word-break: break-all;
}

/* Modal: High-End Glassmorphism */
.nvm-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--nvm-modal-overlay-w, 100%);
    height: var(--nvm-modal-overlay-h, 100%);
    overflow: hidden;
    background-color: var(--nvm-modal-overlay-bg, rgba(0, 0, 0, 0.4)) !important;
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: var(--nvm-modal-overlay-radius, 0);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nvm-modal.is-active {
    opacity: 1;
}

.nvm-modal-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    background: var(--nvm-modal-bg, rgba(255, 255, 255, 0.8)) !important;
    border-radius: var(--nvm-modal-radius, 40px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 30px 40px;
    box-shadow: 0 50px 100px rgba(0,0,0,0.25);
    width: var(--nvm-modal-w, 90%);
    height: var(--nvm-modal-h, 85vh);
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nvm-modal-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

#nvm-modal-title {
    font-weight: 800;
    font-size: 2rem; /* 크기를 약간 줄여서 수평 배치에 맞춤 */
    letter-spacing: -0.04em;
    color: #1d1d1f;
    margin: 0;
    flex-grow: 1;
    word-break: break-all;
    line-height: 1.1;
    padding-right: 20px;
}

.nvm-modal.is-active .nvm-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

#nvm-modal-body {
    flex-grow: 1;
    overflow: hidden; /* 자식인 .nvm-news-list가 스크롤을 담당하도록 함 */
    margin-right: -15px;
}

/* Controls - 복구 및 강화 */
.nvm-modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nvm-modal-auto-refresh {
    background: var(--nvm-modal-btn-bg, rgba(0, 0, 0, 0.05)) !important;
    color: var(--nvm-modal-btn-color, #86868b) !important;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    position: relative; /* 사선 표시를 위해 추가 */
    overflow: hidden;
}

/* 실시간 업데이트 OFF 상태의 사선 효과 */
.nvm-modal-auto-refresh:not(.is-active)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1.5px;
    background-color: currentColor;
    transform: rotate(-12deg); /* 사선 각도 */
    opacity: 0.7;
    pointer-events: none;
}

.nvm-modal-auto-refresh.is-active {
    background: var(--nvm-modal-btn-bg, rgba(0, 0, 0, 0.05)) !important;
    color: var(--nvm-modal-btn-color, #1d1d1f) !important;
}

/* 활성화 상태일 때는 사선 제거 */
.nvm-modal-auto-refresh.is-active::after {
    display: none;
}

.nvm-modal-close, .nvm-modal-refresh {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--nvm-modal-btn-bg, rgba(0, 0, 0, 0.05)) !important;
    color: var(--nvm-modal-btn-color, #1d1d1f) !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nvm-modal-close:hover, .nvm-modal-refresh:hover, .nvm-modal-auto-refresh:hover {
    background: var(--nvm-modal-btn-hover-bg, var(--nvm-modal-btn-bg)) !important;
    filter: var(--nvm-modal-btn-hover-bg) ? none : brightness(0.9); /* 색상이 지정된 경우 필터 제거 */
    transform: scale(1.05);
}

/* CSS 변수 체크를 위한 추가 로직: 변수가 비어있지 않을 때만 필터 제거 */
.nvm-modal-close:hover, .nvm-modal-refresh:hover, .nvm-modal-auto-refresh:hover {
    filter: brightness(0.9); /* 기본값 */
}
[style*="--nvm-modal-btn-hover-bg: #"] .nvm-modal-close:hover,
[style*="--nvm-modal-btn-hover-bg: #"] .nvm-modal-refresh:hover,
[style*="--nvm-modal-btn-hover-bg: #"] .nvm-modal-auto-refresh:hover,
[style*="--nvm-modal-btn-hover-bg:rgba"] .nvm-modal-close:hover,
[style*="--nvm-modal-btn-hover-bg:rgba"] .nvm-modal-refresh:hover,
[style*="--nvm-modal-btn-hover-bg:rgba"] .nvm-modal-auto-refresh:hover {
    filter: none; /* 배경색이 명시적으로 설정된 경우 필터 무시 */
}

.nvm-modal-close svg, .nvm-modal-refresh svg {
    stroke: currentColor;
    width: 20px;
    height: 20px;
}

.nvm-render-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.nvm-news-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
}

.nvm-news-list::-webkit-scrollbar {
    width: 6px;
}

.nvm-news-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Pagination: Fixed at bottom of the wrapper */
.nvm-pagination {
    margin-top: 0;
    padding: 20px 0 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.nvm-page-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nvm-page-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
}

/* Skeleton UI */
.nvm-skeleton-line {
    height: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f2f2f7 25%, #e5e5ea 50%, #f2f2f7 75%);
    background-size: 200% 100%;
    animation: nvm-skeleton-loading 1.5s infinite;
}

@keyframes nvm-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modern Resize Handle */
.nvm-resize-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nvm-module-box:hover .nvm-resize-handle {
    opacity: 0.6;
}

.nvm-resize-handle:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.nvm-resize-handle::before {
    content: var(--nvm-handle-symbol, "┘");
    font-size: calc(var(--nvm-handle-thickness, 2px) * 8);
    line-height: 1;
    font-weight: bold;
}

/* Resize Tooltip */
.nvm-resize-tooltip {
    position: absolute;
    top: -35px; /* 마우스 위쪽으로 변경 */
    right: 0;
    background: var(--nvm-tooltip-bg-color, rgba(0, 0, 0, 0.8));
    color: var(--nvm-tooltip-font-color, #ffffff);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    display: none;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


.nvm-module-box.resizing .nvm-resize-tooltip {
    display: block;
}
