/* Daily SNS Module - 일상 탭 전용 스타일 */
/* 완전히 독립적인 CSS - 다른 모듈에 영향 없음 */

/* ================================ */
/* 일상 메인 섹션 */
/* ================================ */

.daily-main-section {
    display: none;
    padding: 20px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-bottom: 100px !important; /* 하단 네비게이션 공간 확보 */
    background: var(--bg-secondary) !important;
    min-height: calc(100vh - 160px) !important;
}

.daily-main-section.active {
    display: block;
}

/* ================================ */
/* 게시물 작성 섹션 헤더 */
/* ================================ */

.compose-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.compose-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-post-btn {
    padding: 8px 16px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.quick-post-btn:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
}

.quick-post-btn .btn-icon {
    font-size: 14px;
}

.quick-post-btn .btn-text {
    font-size: 12px;
}

/* ================================ */
/* 게시물 작성 영역 */
/* ================================ */

.daily-compose-section {
    background: white;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
}

.compose-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    overflow: hidden;
}

.user-avatar .profile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1428A0, #2B4CB8);
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.user-avatar img.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.compose-input-wrapper {
    flex: 1;
    position: relative;
}

.compose-input {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    background: var(--bg-light);
    transition: border-color 0.2s ease;
}

.compose-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: white;
}

.compose-input::placeholder {
    color: var(--text-secondary);
}

.compose-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    background: white;
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.compose-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.compose-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 6px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.tag-btn:hover {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
}

.tag-btn.selected {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.compose-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.compose-actions-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compose-photo-btn,
.compose-location-btn {
    padding: 8px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.compose-photo-btn:hover,
.compose-location-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.compose-submit-btn {
    padding: 8px 20px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compose-submit-btn:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
}

.compose-submit-btn:disabled {
    background: var(--border-light);
    cursor: not-allowed;
    transform: none;
}

/* 사진 미리보기 */
.compose-preview {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.preview-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 200px;
}

.preview-image-wrapper img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.preview-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================ */
/* 피드 섹션 */
/* ================================ */

.daily-feed-section {
    /* 메인 섹션에서 margin 처리됨 */
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.feed-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.feed-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 14px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

/* ================================ */
/* 게시물 목록 */
/* ================================ */

.daily-posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.daily-post {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.2s ease;
}

.daily-post:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 게시물 헤더 */
.post-header {
    padding: 16px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.post-author {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    overflow: hidden;
}

.author-avatar .profile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1428A0, #2B4CB8);
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.author-avatar img.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.post-time {
    color: var(--text-secondary);
}

.post-location {
    color: var(--brand-primary);
}

.post-category {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.post-category.work {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
}

.post-category.safety {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
}

.post-category.food {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.post-category.daily {
    background: rgba(156, 39, 176, 0.1);
    color: #9C27B0;
}

.post-category.tip {
    background: rgba(255, 193, 7, 0.1);
    color: #FFC107;
}

.post-actions {
    display: flex;
    align-items: center;
}

.post-menu-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.post-menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* 게시물 내용 */
.post-content {
    padding: 0 20px 16px;
}

.post-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
    word-break: break-word;
}

.post-image {
    margin-top: 12px;
    position: relative;
    width: 100%;
    aspect-ratio: 1; /* 정사각형 비율 */
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

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


/* 좋아요 버튼 활성화 상태 */
.like-btn.liked {
    color: var(--brand-primary);
    font-weight: 600;
}

/* 게시물 푸터 */
.post-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

/* ================================ */
/* 인라인 댓글 섹션 (인스타그램 스타일) */
/* ================================ */

.post-comments-section {
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
    padding: 12px 20px;
}

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

.comment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    border-bottom: none;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-primary);
    flex-shrink: 0;
    overflow: hidden;
}

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

.comment-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 6px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.comment-like-btn,
.comment-reply-btn {
    font-size: 12px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    color: var(--text-primary);
}

/* 댓글 입력 섹션 */
.comment-input-section {
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: var(--bg-light);
    transition: all 0.2s ease;
}

.comment-input:focus {
    border-color: var(--brand-primary);
    background: white;
}

.comment-submit {
    padding: 8px 16px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-submit:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
}

.comment-submit:disabled {
    background: var(--border-light);
    cursor: not-allowed;
    transform: none;
}

/* 댓글 상태 메시지 */
.no-comments {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 16px;
}

.comment-error {
    text-align: center;
    padding: 20px;
    color: var(--danger);
    font-size: 14px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* 게시물 메뉴 스타일 */
.post-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.post-menu-content {
    background: white;
    border-radius: 12px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.post-menu-item {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post-menu-item:hover {
    background: var(--bg-light);
}

.post-menu-item.danger {
    color: #dc3545;
}

.post-menu-item.danger:hover {
    background: #fff5f5;
}

.menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.menu-text {
    font-weight: 500;
}

/* 게시물 메뉴 버튼 */
.post-menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.post-menu-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.post-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.post-interactions {
    display: flex;
    gap: 16px;
}

.like-btn,
.comment-btn,
.share-btn {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.like-btn:hover,
.comment-btn:hover,
.share-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--brand-primary);
}

.like-btn.liked {
    background: rgba(244, 67, 54, 0.1);
    color: #F44336;
    border-color: #F44336;
}

/* ================================ */
/* 로딩 및 상태 */
/* ================================ */

.daily-loading {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 16px;
    margin: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.daily-load-more {
    text-align: center;
    padding: 20px;
}

.load-more-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: var(--brand-primary);
    color: white;
    transform: translateY(-1px);
}

/* 빈 상태 */
.daily-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.daily-empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--text-primary);
}

.daily-empty-state p {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.empty-action-btn {
    padding: 10px 20px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.empty-action-btn:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
}

/* 오류 상태 */
.daily-error-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.daily-error-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--text-primary);
}

.daily-error-state p {
    margin: 0 0 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.retry-btn {
    padding: 10px 20px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: var(--brand-secondary);
    transform: translateY(-1px);
}

/* ================================ */
/* 반응형 디자인 */
/* ================================ */

@media (max-width: 768px) {
    .daily-main-section {
        min-height: calc(100vh - 140px);
        padding: 16px !important;
    }
    
    .daily-compose-section {
        padding: 16px;
    }
    
    .compose-options {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .compose-tags {
        justify-content: center;
    }
    
    .compose-actions {
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .compose-actions-left {
        gap: 4px;
    }
    
    .feed-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .feed-filters {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .filter-btn {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }
    
    .daily-posts-container {
        gap: 16px;
    }
    
    .post-header {
        padding: 14px 16px 10px;
    }
    
    .post-content {
        padding: 0 16px 14px;
    }
    
    .post-footer {
        padding: 10px 16px 14px;
    }
    
    .post-interactions {
        gap: 12px;
    }
    
    .like-btn,
    .comment-btn,
    .share-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .daily-loading,
    .daily-empty-state,
    .daily-error-state {
        padding: 40px 16px;
    }
}

@media (max-width: 480px) {
    .compose-input {
        min-height: 60px;
        font-size: 13px;
    }
    
    .tag-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .compose-photo-btn,
    .compose-location-btn {
        font-size: 11px;
        padding: 6px 8px;
    }
    
    .compose-submit-btn {
        font-size: 12px;
        padding: 6px 16px;
    }
    
    .filter-btn {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    
    .post-text {
        font-size: 13px;
    }
    
    .post-meta {
        font-size: 11px;
    }
}