/* ===================================
   Security Desk - Detail Page Styles
   리포트/뉴스 상세 페이지 전용 스타일
   =================================== */

/* Detail Navigation */
.detail-nav {
    padding: 15px 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(11, 17, 32, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 61px; /* 홈페이지 nav 높이(약 61px) 만큼 아래에 고정 */
    z-index: 90; /* 홈페이지 nav(100)보다 낮게 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--primary);
}

/* 네비게이션 제목 */
.nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Content Container */
.container {
    max-width: 800px; /* 읽기 편한 너비 제한 */
    margin: 0 auto;
    padding: 60px 20px 100px;
}

/* Article Header */
.article-header {
    margin-bottom: 50px;
    text-align: center;
}

.category-tag {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 20px 0;
    color: white;
}

.meta {
    color: var(--text-sub);
    font-size: 0.95rem;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.author-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--border);
}

/* Article Body */
.content {
    font-size: 1.1rem;
    color: var(--text-body);
    line-height: 1.75;
}

.content h2 {
    color: white;
    margin-top: 50px;
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.content h3 {
    color: white;
    margin-top: 40px;
    font-size: 1.5rem;
}

.content p {
    margin-bottom: 25px;
}

.content a {
    color: var(--primary);
    text-decoration: underline;
}

.content a:hover {
    color: var(--accent);
}

.content ul,
.content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.content li {
    margin-bottom: 10px;
}

.content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 30px 0;
    color: var(--text-sub);
    font-style: italic;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
}

.content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

/* Mac Terminal Code Block */
.content pre {
    background: #1E293B;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 30px 0;
    overflow: hidden;
    position: relative;
}

.content pre::before {
    content: '';
    display: block;
    background: #0F172A;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.content pre code {
    display: block;
    padding: 20px;
    overflow-x: auto;
    background: transparent;
    color: #E2E8F0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Syntax Highlighting (기본) */
.content pre code .kw {
    color: #C084FC; /* keyword */
}

.content pre code .func {
    color: #60A5FA; /* function */
}

.content pre code .str {
    color: #A3E635; /* string */
}

.content pre code .comment {
    color: #64748B;
    font-style: italic;
}

/* Teaser Content */
.teaser-content {
    position: relative;
    max-height: 600px;
    overflow: hidden;
}

.teaser-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 1) 80%);
    pointer-events: none;
}

/* Paywall (Teaser Effect) */
.paywall-wrapper {
    position: relative;
    margin-top: -150px;
    height: 350px;
    overflow: hidden;
}

.paywall-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 1) 40%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 50px;
    z-index: 10;
}

.lock-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.btn-unlock {
    background: linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    transition: transform 0.2s;
}

.btn-unlock:hover {
    transform: scale(1.05);
}

/* Article Footer */
.article-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-back-list {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.btn-back-list:hover {
    color: var(--primary);
}

/* Origin Link Badge (for News) */
.origin-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 30px;
    transition: all 0.2s;
}

.origin-link-badge:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateX(5px);
}

/* ===================================
   Scrap & Highlight Features
   스크랩 및 형광펜 기능 스타일
   =================================== */

/* Action Buttons (Scrap) */
.action-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-scrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 25px;
    color: var(--text-sub);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-scrap:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
}

.btn-scrap.active {
    background: linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
    border-color: transparent;
    color: white;
}

.btn-scrap .scrap-icon {
    font-size: 1.1rem;
}

/* Highlight Menu */
.highlight-menu {
    position: absolute;
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.highlight-colors {
    padding: 6px;
}

.color-options {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.color-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--bg-body);
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.color-btn.color-yellow {
    background: rgba(255, 235, 59, 0.6);
}

.color-btn.color-green {
    background: rgba(76, 175, 80, 0.6);
}

.color-btn.color-pink {
    background: rgba(233, 30, 99, 0.6);
}

/* Highlight Memo Input */
.highlight-memo-input {
    width: 280px;
    padding: 12px;
}

.memo-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    background: var(--bg-body);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 10px;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: border-color 0.2s;
}

.memo-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.memo-textarea::placeholder {
    color: var(--text-sub);
    opacity: 0.6;
}

.memo-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.btn-memo-cancel,
.btn-memo-save {
    flex: 1;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-memo-cancel {
    background: var(--bg-body);
    border: 2px solid var(--border);
    color: var(--text-sub);
}

.btn-memo-cancel:hover {
    color: var(--text-main);
    border-color: var(--text-sub);
    transform: translateY(-1px);
}

.btn-memo-save {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-memo-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

/* Highlight Marks in Content */
.highlight-mark {
    cursor: pointer;
    border-radius: 3px;
    padding: 2px 4px;
    margin: 0 -2px;
    transition: all 0.2s;
    position: relative;
}

.highlight-mark:hover {
    filter: brightness(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.highlight-yellow {
    background: linear-gradient(to bottom, rgba(255, 235, 59, 0.5) 0%, rgba(255, 235, 59, 0.3) 100%);
}

.highlight-green {
    background: linear-gradient(to bottom, rgba(76, 175, 80, 0.5) 0%, rgba(76, 175, 80, 0.3) 100%);
}

.highlight-pink {
    background: linear-gradient(to bottom, rgba(233, 30, 99, 0.5) 0%, rgba(233, 30, 99, 0.3) 100%);
}

/* Highlight Action Menu (Delete & Memo Display) */
.highlight-action-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    min-width: 220px;
    max-width: 320px;
    overflow: hidden;
    animation: fadeInUp 0.2s ease;
}

.highlight-memo-display {
    padding: 14px;
    margin: 0;
    background: rgba(56, 189, 248, 0.05);
    border-left: 4px solid var(--primary);
    border-bottom: 1px solid var(--border);
}

.highlight-memo-display .memo-label {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.highlight-memo-display .memo-label::before {
    content: '📝';
    font-size: 0.9rem;
}

.highlight-memo-display .memo-text {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.btn-delete-highlight {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #F87171;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-highlight::before {
    content: '🗑️';
    font-size: 1rem;
}

.btn-delete-highlight:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #EF4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 40px 15px 80px;
    }

    .title {
        font-size: 1.8rem;
    }

    .content {
        font-size: 1rem;
    }

    .content h2 {
        font-size: 1.5rem;
    }

    .btn-scrap {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .highlight-menu {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .highlight-memo-input {
        width: calc(100vw - 40px);
        max-width: 320px;
    }

    .memo-actions {
        flex-direction: column;
    }

    .btn-memo-cancel,
    .btn-memo-save {
        width: 100%;
    }

    .highlight-action-menu {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* ============================================
   Newsletter Widget Styles
   ============================================ */

.newsletter-widget {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(56, 189, 248, 0.05) 100%);
    border-top: 2px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.newsletter-widget.visible {
    transform: translateY(0);
}

.newsletter-widget .newsletter-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.newsletter-widget .newsletter-close:hover {
    color: var(--text-main);
}

.newsletter-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.newsletter-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.newsletter-description {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 16px;
    line-height: 1.5;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 12px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-input[readonly] {
    background: rgba(100, 116, 139, 0.1);
    cursor: not-allowed;
}

.btn-subscribe {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 6px;
}

.btn-subscribe:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.3);
}

.btn-subscribe:active {
    transform: translateY(0);
}

.btn-subscribe:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.newsletter-notice {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.newsletter-message {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    animation: fadeIn 0.3s;
}

.newsletter-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.newsletter-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Newsletter Widget */
@media (max-width: 768px) {
    .newsletter-widget {
        padding: 20px 15px;
    }

    .newsletter-icon {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .newsletter-title {
        font-size: 1.1rem;
    }

    .newsletter-description {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .form-input {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .btn-subscribe {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .newsletter-notice {
        font-size: 0.75rem;
        margin-top: 10px;
    }

    .newsletter-message {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* ============================================
   Consent Checkboxes Styles
   ============================================ */

.consent-group {
    margin: 16px 0;
    text-align: left;
}

.consent-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.consent-item input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.consent-text {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.4;
}

.terms-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-right: 4px;
}

.terms-link:hover {
    text-decoration: underline;
}

/* ============================================
   Terms Modal Styles
   ============================================ */

.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.terms-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.terms-modal-content {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

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

.terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.terms-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.terms-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.terms-modal-close:hover {
    color: var(--text-main);
}

.terms-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-sub);
    line-height: 1.8;
    font-size: 0.9rem;
}

.terms-modal-body h4 {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 12px;
}

.terms-modal-body h4:first-child {
    margin-top: 0;
}

.terms-modal-body p {
    margin: 12px 0;
}

.terms-modal-body ul, .terms-modal-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.terms-modal-body li {
    margin: 8px 0;
}

.terms-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-terms-close {
    padding: 10px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-terms-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-terms-close:active {
    transform: translateY(0);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .consent-group {
        margin: 12px 0;
    }

    .consent-text {
        font-size: 0.8rem;
    }

    .terms-modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .terms-modal-header {
        padding: 16px 20px;
    }

    .terms-modal-header h3 {
        font-size: 1.1rem;
    }

    .terms-modal-body {
        padding: 20px;
        font-size: 0.85rem;
    }

    .terms-modal-body h4 {
        font-size: 1rem;
    }
}
