/* =================== 메모 상세 페이지 스타일 =================== */

/* 건강/AI 테마 색상 변수 오버라이드 */
:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary-color: #3b82f6;
    --secondary-dark: #2563eb;
    --accent-purple: #8b5cf6;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --light-bg: #f8fafc;
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-card: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.memo-detail-page {
    padding: 40px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    min-height: 100vh;
}

.page-navigation {
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 16px;
    border-radius: 12px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.back-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.back-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateX(-5px);
    text-decoration: none;
}

.memo-container {
    margin-bottom: 40px;
}

/* 메인 콘텐츠 영역 */
.memo-detail-card {
    background: var(--gradient-card);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 36px;
    margin-bottom: 30px;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.memo-header {
    margin-bottom: 32px;
}

.memo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.memo-date {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.memo-date::before {
    content: '📅';
    margin-right: 8px;
}

.memo-actions {
    display: flex;
}

.memo-action {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-left: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
}

.memo-action:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: scale(1.1);
}

.memo-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
    word-break: break-word;
    line-height: 1.3;
}

/* 메모 이미지 스타일 */
.memo-image-container {
    width: 100%;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
    border: 3px solid white;
}

.memo-image {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    background-color: #f8f9fa;
    display: block;
    transition: transform 0.3s ease;
}

.memo-image:hover {
    transform: scale(1.02);
}

.memo-issue {
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 500;
    word-break: break-word;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 24px;
}

/* 메모 콘텐츠 */
.memo-content {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
}

.section-title i {
    color: var(--primary-color);
    margin-right: 12px;
    font-size: 1.4rem;
}

.content-section {
    margin-bottom: 32px;
}

.content-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-line;
    word-break: break-word;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

/* 예문 섹션 */
.examples-section {
    margin-bottom: 32px;
}

.examples-list {
    margin-bottom: 24px;
}

.example-item {
    padding: 24px;
    background: white;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.example-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.example-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
}

.example-item:hover::before {
    opacity: 1;
}

.example-number {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.example-sentence {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 12px;
    word-break: break-word;
    line-height: 1.6;
}

.example-interpretation {
    font-size: 1rem;
    color: var(--text-light);
    word-break: break-word;
    white-space: pre-line;
    line-height: 1.7;
}

/* 링크 섹션 스타일 */
.links-section {
    margin-bottom: 32px;
}

.section-title.links-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 10px;
}

.section-title .fa-link {
    margin-right: 8px;
}

.links-toggle-icon {
    margin-left: 10px;
}

.section-title-text {
    display: flex;
    align-items: center;
}

.section-title-text i {
    margin-right: 8px;
}

.links-list {
    margin-bottom: 24px;
}

.link-item {
    position: relative;
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.link-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.15);
    transform: translateY(-3px);
}

.link-preview {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.link-preview:hover {
    text-decoration: none;
}

.link-preview-image-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.link-preview-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(16, 185, 129, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.link-preview-image-container:hover::after {
    opacity: 1;
}

.link-preview-image-container:hover .image-zoom-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.image-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.image-zoom-icon i {
    color: var(--primary-color);
    font-size: 22px;
}

.link-preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f1f5f9;
}

.default-preview-image {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e0f2fe 100%);
    color: #94a3b8;
    font-size: 24px;
}

.default-preview-image .site-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.link-preview-content {
    padding: 18px;
}

.link-preview-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.link-preview-description {
    font-size: 14px;
    color: #334155;
    margin-bottom: 10px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.link-preview-site {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.link-preview-user-title {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    font-style: italic;
}

/* 비디오 썸네일 컨테이너 스타일 */
.video-thumbnail-container {
    position: relative;
    width: 100%;
    height: 200px;
    background-color: #0f172a;
}

.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
}

.play-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.video-thumbnail-container:hover .play-button {
    transform: scale(1.1);
    background-color: rgba(16, 185, 129, 1);
}

.play-icon {
    color: white;
    margin-left: 4px;
    font-size: 24px;
}

/* 소셜 미디어 스타일 */
.link-preview-social {
    display: flex;
    padding: 18px;
    background-color: #f8fafc;
    border-left-width: 4px;
    align-items: center;
}

.platform-icon-container {
    width: 48px;
    height: 48px;
    margin-right: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 플랫폼별 스타일 */
.youtube-preview { border-left-color: #FF0000; }
.twitter-preview { border-left-color: #1da1f2; }
.instagram-preview { border-left-color: #C13584; }
.facebook-preview { border-left-color: #3b5998; }
.tiktok-preview { border-left-color: #000000; }
.vimeo-preview { border-left-color: #1ab7ea; }
.spotify-preview { border-left-color: #1DB954; }
.soundcloud-preview { border-left-color: #ff7700; }
.github-preview { border-left-color: #333; }
.medium-preview { border-left-color: #000000; }
.naver-preview { border-left-color: #03C75A; }

.github-stats {
    display: flex;
    flex-wrap: wrap;
    margin-top: 8px;
    margin-bottom: 10px;
}

.github-stat {
    font-size: 13px;
    color: #64748b;
    margin-right: 12px;
    margin-bottom: 8px;
    background-color: white;
    padding: 6px 12px;
    border-radius: 16px;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

/* 메모 작성자 정보 */
.memo-author {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    background: white;
    border-radius: 16px;
    margin-bottom: 32px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.memo-author:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
}

.author-avatar {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 24px;
    border: 3px solid var(--primary-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.author-details {
    display: flex;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.author-details span {
    margin-right: 16px;
}

.author-description {
    color: var(--text-light);
    line-height: 1.7;
    word-break: break-word;
}

/* 광고 배너 (모바일) */
.ad-banner-mobile {
    margin: 32px 0;
    display: none;
    border-radius: 16px;
    overflow: hidden;
}

/* 댓글 섹션 */
.comments-section {
    margin-top: 48px;
}

.comments-list {
    margin-bottom: 32px;
}

.comment-item {
    padding: 24px 0;
    border-bottom: 2px solid var(--border-color);
}

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

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.comment-avatar {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    border: 2px solid var(--primary-light);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-author-info {
    flex: 1;
}

.comment-author-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
    font-size: 1.05rem;
}

.comment-author-details {
    display: flex;
    font-size: 0.9rem;
    color: var(--text-light);
}

.comment-author-details span {
    margin-right: 12px;
}

.comment-content {
    padding-left: 62px;
}

.comment-text {
    line-height: 1.7;
    margin-bottom: 12px;
    color: var(--text-color);
    word-break: break-word;
    padding: 16px;
    background-color: white;
    border-radius: 12px;
}

.comment-date {
    font-size: 0.9rem;
    color: var(--text-light);
}

.no-comments {
    text-align: center;
    padding: 40px 0;
    color: var(--text-light);
    font-size: 1.05rem;
}

.comment-form-notice {
    text-align: center;
    padding: 40px 24px;
    background: white;
    border-radius: 16px;
    border: 2px dashed var(--border-color);
}

.comment-form-notice p {
    margin-bottom: 24px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.05rem;
}

.app-download-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-download-comment {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-download-comment i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.btn-download-comment.android {
    background-color: #a4c639;
    color: white;
}

.btn-download-comment.ios {
    background-color: #000;
    color: white;
}

.btn-download-comment:hover {
    opacity: 0.9;
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 사이드바 영역 */
.sidebar-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 28px;
    margin-bottom: 32px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
}

.sidebar-card:hover {
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.15);
    border-color: var(--primary-color);
}

.sidebar-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.sidebar-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 앱 다운로드 카드 */
.app-download-card {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.btn-download-sidebar {
    display: flex;
    align-items: center;
    padding: 14px 22px;
    border-radius: 50px;
    margin-bottom: 12px;
    width: 100%;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.btn-download-sidebar i {
    margin-right: 12px;
    font-size: 1.3rem;
}

.btn-download-sidebar.android {
    background-color: #a4c639;
    color: white;
}

.btn-download-sidebar.ios {
    background-color: #000;
    color: white;
}

.btn-download-sidebar:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 관련 메모 카드 */
.related-memos-list {
    margin-top: 16px;
}

.related-memo-item {
    display: block;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.related-memo-item:last-child {
    border-bottom: none;
}

.related-memo-item:hover {
    background-color: var(--light-bg);
    transform: translateX(5px);
}

.related-memo-title {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-color);
    font-size: 1.05rem;
}

.related-memo-author {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 기능 카드 */
.features-card {
    border-left: 4px solid var(--secondary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
}

.features-list {
    padding-left: 0;
}

.features-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li:hover {
    padding-left: 8px;
    color: var(--secondary-color);
}

.features-list li i {
    color: var(--secondary-color);
    margin-right: 12px;
    font-size: 1.1rem;
}

/* 광고 배너 (사이드바) */
.ad-banner-sidebar {
    margin-bottom: 32px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 반응형 디자인 */
@media (max-width: 992px) {
    .memo-title {
        font-size: 1.9rem;
    }

    .memo-issue {
        font-size: 1.2rem;
    }

    .content-text {
        font-size: 1.05rem;
    }

    .sidebar-card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .memo-detail-page {
        padding: 30px 0;
    }

    .memo-detail-card {
        padding: 24px;
        border-radius: 16px;
    }

    .memo-title {
        font-size: 1.7rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .ad-banner-mobile {
        display: block;
    }

    .comment-content {
        padding-left: 0;
        margin-top: 12px;
    }

    .social-share-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-social {
        margin: 0;
    }

    .author-avatar {
        width: 70px;
        height: 70px;
        margin-right: 16px;
    }

    .author-name {
        font-size: 1.2rem;
    }

    .link-preview-image,
    .video-thumbnail-container,
    .default-preview-image {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .memo-detail-card {
        padding: 20px;
    }

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

    .memo-image {
        max-height: 350px;
    }

    .app-download-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn-download-comment {
        width: 100%;
        justify-content: center;
    }

    .play-button {
        width: 52px;
        height: 52px;
    }

    .play-icon {
        font-size: 20px;
    }
}
