/* memday — 모던 다크 테마 (Style C) */

:root {
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-elevated: #242424;
    --text: #f5f5f5;
    --text-sub: #999;
    --text-light: #666;
    --accent: #ff4757;
    --accent-glow: rgba(255, 71, 87, 0.3);
    --cyan: #00d2d3;
    --purple: #a55eea;
    --yellow: #feca57;
    --border: #2a2a2a;
    --radius: 16px;
}

html {
    scroll-behavior: smooth;
}

/* 앱 컨테이너 */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

@media (min-width: 481px) {
    .app-container {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* 그라디언트 텍스트 */
.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 로그인 화면 ===== */
.screen-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 24px;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0f0f0f 70%);
}

.login-glow {
    position: relative;
    margin-bottom: 32px;
}

.login-glow::before {
    content: '';
    position: absolute;
    top: -20px; left: -20px; right: -20px; bottom: -20px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    z-index: 0;
    filter: blur(20px);
}

.login-icon {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(255, 71, 87, 0.4);
}

.login-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 40px;
}

.login-toggle-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 340px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(255, 71, 87, 0.08);
}

.login-form {
    width: 100%;
    max-width: 340px;
}

.input-wrap {
    margin-bottom: 16px;
}

.input-wrap label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.input-wrap input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.3s;
}

.input-wrap input:focus {
    border-color: var(--accent);
}

.input-wrap input::placeholder {
    color: var(--text-light);
}

.signup-row {
    display: none;
}

.btn-glow {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #ff6b81);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--accent-glow);
}

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

.login-alt {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-sub);
}

.login-alt a {
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

/* ===== 피드 헤더 ===== */
.feed-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(15, 15, 15, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.header-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.header-icon:hover {
    background: var(--border);
}

/* ===== 게시물 카드 ===== */
.feed-list {
    padding: 4px 0 80px;
}

.post-card {
    background: var(--bg-card);
    margin-bottom: 8px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.post-actions {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-sub);
    padding: 4px 0;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--text);
}

.action-btn.liked {
    color: var(--accent);
}

.action-btn.liked svg {
    fill: var(--accent);
    stroke: var(--accent);
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: 90px;
    right: calc(50% - 220px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px var(--accent-glow);
    z-index: 15;
    transition: transform 0.2s;
    text-decoration: none;
}

.fab:hover {
    transform: scale(1.08);
}

@media (max-width: 480px) {
    .fab {
        right: 20px;
    }
}

/* ===== 하단 네비게이션 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 20;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0 8px;
    cursor: pointer;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--text);
}

.nav-item.active svg {
    fill: var(--text);
}

.nav-item svg {
    margin-bottom: 3px;
    fill: var(--text-light);
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.nav-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 4px;
}

/* ===== 이미지 ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== 비밀 메시지 섹션 ===== */
.secret-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.secret-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--purple);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.secret-toggle:hover {
    background: rgba(165, 94, 234, 0.08);
}

.secret-chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.secret-chevron-open {
    transform: rotate(180deg);
}

.secret-panel {
    padding: 0 16px 16px;
}

.secret-panel.hidden {
    display: none;
}

.secret-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border: 2px solid rgba(165, 94, 234, 0.3);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.secret-textarea:focus {
    border-color: var(--purple);
}

.secret-textarea::placeholder {
    color: var(--text-light);
}

.secret-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
}

.secret-counter {
    color: var(--purple);
    font-weight: 600;
}

.secret-capacity {
    color: var(--text-sub);
}

.secret-hint {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
}

/* ===== 비밀 네비 아이템 (제스처로 표시/숨김) ===== */
.secret-nav-item.hidden {
    display: none;
}

/* ===== 알림 뱃지 ===== */
.notif-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* ===== 자동 로그아웃 설정 바 ===== */
.secret-settings-bar {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.secret-settings-bar.hidden {
    display: none;
}

.auto-logout-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auto-logout-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-sub);
    border-radius: 50%;
    transition: all 0.2s;
}

.auto-logout-toggle input:checked + .toggle-slider {
    background: #2d4a7a;
}

.auto-logout-toggle input:checked + .toggle-slider::after {
    left: 18px;
    background: #fff;
}

/* ===== 프로필 사진 =====  */
.profile-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    cursor: pointer;
}

.profile-avatar-wrap .avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-wrap .avatar-initial {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 30px;
}

.profile-avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.profile-avatar-overlay svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

/* 게시물 카드 아바타 이미지 */
.avatar-image {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ===== 사진 크롭 모달 ===== */
.crop-modal.hidden { display: none; }

.crop-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
}

.crop-modal-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-elevated);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    z-index: 210;
    animation: slideUp 0.2s ease-out;
}

.crop-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    touch-action: none;
}

.crop-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.crop-circle {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* ===== 좋아요 & 댓글 ===== */

/* 좋아요 영역 */
.like-area {
    display: inline-flex;
    align-items: center;
}

.like-count {
    font-size: 13px;
    font-weight: 600;
    margin-left: 2px;
}

/* 좋아요 버튼 애니메이션 */
.action-btn.liked svg {
    animation: likeScale 0.3s ease;
}

@keyframes likeScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* 댓글 영역 */
.comment-section {
    margin-top: 4px;
}

.comment-list {
    margin-bottom: 8px;
}

.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0;
}

.comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.comment-avatar-img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.comment-nickname {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-right: 6px;
}

.comment-text {
    font-size: 13px;
    color: var(--text-sub);
    word-break: break-word;
}

.comment-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.comment-show-all {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 4px;
    display: block;
    transition: color 0.2s;
}

.comment-show-all:hover {
    color: var(--text-sub);
}

/* 댓글 입력 폼 */
.comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

.comment-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    outline: none;
    color: var(--text);
    font-size: 13px;
    padding: 8px 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comment-input:focus {
    border-color: var(--cyan);
}

.comment-input::placeholder {
    color: var(--text-light);
}

.comment-submit {
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 4px;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.comment-submit:hover {
    opacity: 0.8;
}

/* ===== 공지글 스타일 ===== */
.post-announcement {
    border-top: 2px solid var(--cyan);
    position: relative;
}

.announcement-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin: 10px 16px 0;
    background: rgba(0, 210, 211, 0.12);
    color: var(--cyan);
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    width: fit-content;
}

.announcement-toggle-btn.active {
    color: var(--cyan);
}

.announcement-toggle-btn.active svg {
    stroke: var(--cyan);
}

/* date/time input 아이콘 밝게 (다크 테마) */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8);
    cursor: pointer;
}

/* ===== 캘린더 ===== */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-nav-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-sub);
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.calendar-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-weekdays {
    margin-bottom: 4px;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    padding: 6px 0;
}

.calendar-day {
    min-height: 56px;
    padding: 4px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day.today {
    border-color: var(--cyan);
    background: rgba(0, 210, 211, 0.06);
}

.calendar-day.today .day-number {
    background: var(--cyan);
    color: #000;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.day-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    display: block;
}

.calendar-event {
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 3px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.birthday-event {
    background: rgba(254, 202, 87, 0.15);
    color: var(--yellow);
    font-weight: 600;
}

.custom-event {
    background: rgba(0, 210, 211, 0.12);
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 2px;
}

.event-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-delete-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.custom-event:hover .event-delete-btn {
    opacity: 1;
}

.event-delete-btn:hover {
    color: var(--accent);
}
