/* General Reset & Typography */
:root {
    --primary-color: #F67C38; /* 경쟁사 포인트 컬러 */
    --text-primary: #212529;
    --text-secondary: #808086; /* 경쟁사 보조 텍스트 컬러 */
    --text-tertiary: #adb5bd;
    --bg-main: #F2F5F9; /* 경쟁사 메인 배경 */
    --bg-content: #ffffff;
    --border-color: #E6E6E9; /* 경쟁사 보더 컬러 */
    --warning-color: #ffc107;
    --success-color: #198754;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.wrapper {
    display: flex;
}

.sidebar {
    width: 260px;
    background-color: #ffffff; /* 모바일에서 투명해 보이는 이슈 방지 */
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto; /* 사이드바 전체 스크롤 적용 */
}

/* 스크롤할 때만 스크롤바가 보이도록 설정 */
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0); /* 평소에는 투명 */
    border-radius: 4px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.3); /* 호버 시 반투명 회색 */
}

.sidebar-header, .sidebar-user, .sidebar-footer, .sidebar-divider, .platform-selector {
    flex-shrink: 0;
}

.sidebar-nav {
    /* 기존의 flex-grow, overflow-y 속성 제거 */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* 기존 .sidebar-nav의 스크롤 관련 규칙들 제거 */


.sidebar-header {
    padding: 0.01rem 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 160px;
    height: auto;
    filter: none;
}

/* 스크롤바 스타일 수정: 사이드바 영역에 호버 시 보이도록 */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent; /* 트랙을 투명하게 설정 */
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0); /* 평소에는 투명 */
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out; /* 부드러운 전환 효과 */
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.4); /* 호버 시 더 진하게 표시 */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: background-color 0.15s, color 0.15s;
    will-change: background-color, color;
    transform: translateZ(0);
}

.nav-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.nav-item.active {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    font-weight: 700;
    border-left-color: var(--primary-color);
    transition: background-color 0.15s, color 0.15s;
}

.nav-item.active:hover {
    background-color: var(--primary-color);
    color: white;
}

.nav-icon {
    font-size: 1.25rem;
}

.request-new-link {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    transition: background-color 0.15s, color 0.15s !important;
    will-change: background-color, color;
    transform: translateZ(0);
}
.request-new-link:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.beta-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.request-link {
    display: block;
    padding: 1rem;
    margin: 0 1rem;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background-color 0.2s;
}

.request-link:hover {
    background-color: #e9ecef;
}

.request-link i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.request-link span {
    font-size: 0.9rem;
}

/* Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: #e55a2b; /* 주황색 호버 */
}

.btn-primary-inverted {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 700;
}
.btn-primary-inverted:hover {
    background-color: #e9f2ff;
}

.btn-secondary {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: #e9ecef;
}

.btn-danger {
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}
.btn-danger:hover {
    background-color: #f8d7da;
}

.btn-unlink {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-unlink:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-icon {
    padding: 0.6rem;
    font-size: 1.25rem;
    background-color: transparent;
    color: var(--text-secondary);
}
.btn-icon:hover {
    background-color: var(--bg-main);
    color: var(--text-primary);
}


/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background-color: var(--bg-content);
    border: none; /* border 제거 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* box-shadow 추가 */
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 2rem;
    color: var(--text-secondary);
}
.card-icon.warning { color: var(--warning-color); }
.card-icon.success { color: var(--success-color); }

.card-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.card-value {
    font-size: 2rem;
    font-weight: 700;
}
.card-value.warning-text { color: var(--warning-color); }

/* Table */
.review-table-section {
    background-color: var(--bg-content);
    border: none; /* border 제거 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* box-shadow 추가 */
    border-radius: 12px; /* 좀 더 둥글게 */
    overflow: hidden; /* 내부 요소가 radius를 벗어나지 않도록 */
}

.table-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.table-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.tabs {
    display: flex;
    gap: 0; /* 갭 제거 */
    border-bottom: 1px solid var(--border-color); /* 탭 전체에 하단 라인 */
}
.tab-btn {
    padding: 1rem 1.5rem; /* 패딩 조정 */
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    border-radius: 0; /* radius 제거 */
}
.tab-btn.active {
    color: var(--primary-color);
    font-weight: 700;
    border-bottom-color: var(--primary-color);
}

.table-content {
    display: none;
}
.table-content.active {
    display: block;
}

/* New Review Card System */
.review-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.review-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #fcfcfc;
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}
.review-info .review-author {
    font-weight: 700;
}
.review-info .review-meta {
    margin-left: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.review-rating {
    font-size: 1.1rem;
    color: var(--warning-color);
}
.review-card-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}
.review-card-body p {
    margin: 0 0 0.5rem 0;
}
.review-card-body small {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.review-card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 1rem;
}
.review-card-footer .reply-component {
    margin-top: 1rem;
}

/* Replied Review Card Styles */
.my-reply-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}
.my-reply-card .reply-text {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.my-reply-card .reply-text p {
    margin: 0.25rem 0 0 0;
    line-height: 1.6;
}
.my-reply-card .card-actions {
    margin-top: 1rem;
    padding-left: calc(2rem + 0.75rem); /* Align with reply text */
    font-size: 0.9rem;
}
.my-reply-card .card-actions a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 1.5rem;
    font-weight: 500;
}
.my-reply-card .card-actions a:hover {
    text-decoration: underline;
}

/* Edit mode for replied card */
.my-reply-card .edit-form { display: none; }
.my-reply-card.edit-mode .reply-text,
.my-reply-card.edit-mode .card-actions { display: none; }
.my-reply-card.edit-mode .edit-form { display: block; }


/* Table (Legacy - will be phased out) */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    vertical-align: middle;
}

thead {
    background-color: var(--bg-main);
}

th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

th.action { text-align: right; }
th.review-content { width: 45%; }

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}
tbody tr:hover {
    background-color: #fafafa;
}
/* 리뷰 내용과 답글 영역 사이의 경계선 제거 */
tbody tr.review-item {
    border-bottom: none;
}

tbody tr:last-child,
tbody tr.reply-row:last-of-type {
    border-bottom: none;
}

td small {
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

td .stars { color: var(--warning-color); }
td i.success { color: var(--success-color); }
td i.warning { color: var(--warning-color); }
td .status { font-size: 1.5rem; }

td .my-reply {
    margin-top: 1rem;
    padding: 1rem;
    border-left: 3px solid var(--primary-color);
    background-color: #f8f9fa;
    border-radius: 0 8px 8px 0;
}
.my-reply .reply-meta-actions {
    margin-top: 0.75rem;
    font-size: 0.85rem;
}
.my-reply .reply-meta-actions a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 1rem;
    font-weight: 500;
}
.my-reply .reply-meta-actions a:hover {
    text-decoration: underline;
}

/* 수정 모드 */
.my-reply .edit-form { display: none !important; }
.my-reply.edit-mode .reply-text,
.my-reply.edit-mode .reply-meta-actions { display: none !important; }
.my-reply.edit-mode .edit-form { display: block !important; }
/* .edit-actions and .edit-form .char-counter are now handled by .reply-actions-wrapper */

/* Summary Cards Grid */
.summary-cards-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.summary-card.main-summary {
    flex-direction: row;
    justify-content: space-around;
    padding: 1rem;
    text-align: center;
}
.main-summary-item .card-title { font-size: 1rem; }
.main-summary-item .card-value { font-size: 2.2rem; }

.summary-card.star-distribution {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}
.star-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}
.star-row span:first-child { color: #ffc107; }
.star-row .star-count { font-weight: 500; }


/* Table Filters */
.table-filters {
    display: flex;
    gap: 0.75rem;
}
.table-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-content);
}


/* Statistics Page */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.stats-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
}
.stats-card {
    background-color: var(--bg-content);
    border: none; /* border 제거 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* box-shadow 추가 */
    border-radius: 8px;
    padding: 1.5rem;
}
.stats-card.kpi {
    text-align: center;
}
.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
}
.kpi-unit {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}
.kpi-comparison {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.kpi-comparison.positive { color: #198754; }
.kpi-comparison.negative { color: #dc3545; }

.stats-card.large-card {
    grid-column: 1 / -1; /* 가로 전체 차지 */
}

.stats-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}
.chart-container {
    height: 250px;
}
.line-chart {
    position: relative;
}
.chart-legend {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 1rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.legend-item::before {
    content: '';
    display: block;
    width: 1rem;
    height: 0.25rem;
}
.legend-item.blue::before { background-color: #0d6efd; }
.legend-item.green::before { background-color: #198754; }

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    border-left: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0 0 1rem;
}
.bar-chart .bar {
    flex-grow: 1;
    background-color: var(--primary-color);
    border-radius: 4px 4px 0 0;
    position: relative;
    text-align: center;
    color: white;
    font-weight: 500;
}
.bar .label {
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

/* Pie Chart */
.pie-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    height: 100%;
}
.pie-chart-viz {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        #0d6efd 0% 60%, 
        #198754 60% 90%, 
        #6c757d 90% 100%
    );
}
.pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.pie-chart-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.pie-chart-legend .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.pie-chart-legend .dot.blue { background-color: #0d6efd; }
.pie-chart-legend .dot.green { background-color: #198754; }
.pie-chart-legend .dot.gray { background-color: #6c757d; }


/* Topic Analysis */
.topic-analysis {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.topic-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 1rem;
}
.topic-name {
    font-weight: 500;
}
.topic-bar {
    height: 20px;
    color: white;
    text-align: center;
    font-size: 0.8rem;
    line-height: 20px;
}
.topic-bar.positive { background-color: #0d6efd; border-radius: 4px 0 0 4px;}
.topic-bar.negative { background-color: #dc3545; border-radius: 0 4px 4px 0;}

/* Menu Sold Out Page */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.menu-category h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.menu-item + .menu-item {
    margin-top: 1rem;
}
.menu-info h4 {
    margin: 0 0 0.25rem 0;
}
.menu-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.toggle-switch input {
  height: 0;
  width: 0;
  visibility: hidden;
}
.toggle-switch label {
  cursor: pointer;
  text-indent: -9999px;
  width: 50px;
  height: 28px;
  background: #e9ecef;
  display: block;
  border-radius: 100px;
  position: relative;
}
.toggle-switch label:after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 90px;
  transition: 0.3s;
}
.toggle-switch input:checked + label {
  background: var(--primary-color);
}
.toggle-switch input:checked + label:after {
  left: calc(100% - 3px);
  transform: translateX(-100%);
}


/* Platform Filter */
.platform-filter {
    display: flex;
    background-color: #e9ecef;
    border-radius: 8px;
    padding: 4px;
}
.filter-btn {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn.active {
    background-color: var(--bg-content);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


/* Schedule Display */
.schedule-display-area {
    background-color: var(--bg-content);
    border: none; /* border 제거 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* box-shadow 추가 */
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.schedule-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.schedule-tag-display {
    background-color: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.no-schedule {
    color: var(--text-secondary);
    font-style: italic;
}

/* Schedule Modal */
.schedule-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.schedule-input-group select {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.schedule-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    min-height: 50px;
}
.schedule-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}
.schedule-tag button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}
.schedule-tag button:hover {
    color: var(--text-primary);
}


/* 답글 컴포넌트 */
.reply-row td {
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}
.reply-component {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.reply-input-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.profile-icon {
    font-size: 2rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}
.reply-textarea {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.reply-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}
.register-btn {
    align-self: flex-start;
}
.reply-actions-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: calc(2rem + 0.75rem); /* 아이콘 크기 + 갭 */
}
.char-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.action-buttons {
    display: flex;
    gap: 0.5rem;
}
.gpt-action-btn .spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}
@keyframes spinner-border {
  to { transform: rotate(360deg); }
}


/* Reply Form (Old) - Keep for compatibility if needed or remove */
.reply-form-row td {
    background-color: #f8f9fa;
    padding: 1.5rem;
}
.reply-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.reply-form-wrapper textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
}
.reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Placeholder for unconnected state */
.placeholder-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
    text-align: center;
}
.placeholder-content i {
    font-size: 4rem;
    color: var(--text-tertiary);
}
.placeholder-content h2 {
    margin-top: 1.5rem;
    color: var(--text-primary);
}
.placeholder-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-box {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modal-pop 0.2s ease-out;
}
@keyframes modal-pop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}
.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-secondary);
}
.modal-body {
    padding: 1.5rem;
}
.modal-body p {
    margin-top: 0;
    color: var(--text-secondary);
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}
.modal-footer button.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}
.modal-footer button.btn-danger:hover {
    background-color: #c82333;
}

/* Success flash animation */
@keyframes success-flash-kf {
    0% { background-color: transparent; }
    50% { background-color: #d1e7dd; }
    100% { background-color: transparent; }
}
.success-flash {
    animation: success-flash-kf 1s ease-out;
}

/* AI Persona Page */
.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

.ai-persona-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.ai-persona-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    height: 244px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.ai-persona-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.07);
    border-color: var(--primary-color);
}

.ai-persona-card.active {
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.persona-card-header {
    padding: 1.5rem;
    display: flex;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.persona-card-header .tag {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    font-weight: 500;
}

.persona-card-header .tag.active-tag {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.persona-card-header .tag.recommend-tag {
    background: linear-gradient(90deg, #FF5000, #FFB800);
    color: white;
    border: none;
}

.persona-card-content {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 10;
}

.persona-card-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.persona-card-content .hashtags {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.persona-card-content .hashtags span {
    color: var(--text-secondary);
}

.persona-card-bg {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 240px;
    z-index: 1;
}

.persona-card-bg i {
    position: absolute;
    font-size: 10rem;
    bottom: 1rem;
    right: 1rem;
    color: rgba(0,0,0,0.04);
}

.persona-card-bg.mong { background-color: #f0f6ff; }
.persona-card-bg.seoyeon { background-color: #fff4f0; }
.persona-card-bg.jihoon { background-color: #eef9f2; }
.persona-card-bg.younghee { background-color: #f5f3ff; }


/* AI Settings Tabs */
.tabs-container {
    margin-top: 2rem;
}
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.tab-link {
    padding: 0 0.5rem 1rem 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.tab-link:hover {
    color: var(--text-primary);
}
.tab-link.active {
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Promotion Settings Page */
.promotion-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.settings-panel, .preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
}
.form-group select, .promo-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    font-size: 1rem;
}
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.promo-type-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.promo-type-tabs button {
    padding: 0.5rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    cursor: pointer;
}
.promo-type-tabs button.active {
    background-color: #FFF1E5;
    color: var(--primary-color);
    border-color: #FBC09F;
    font-weight: 600;
}
.char-counter-dark {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.form-actions {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}
.form-actions button {
    flex: 1;
}

/* Preview Panel */
.preview-box {
    background-color: var(--bg-content);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.preview-header i { font-size: 1.5rem; }
.preview-header h4 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.preview-tag {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    font-weight: 600;
}

.preview-content {
    margin-top: 1rem;
}

.promo-placeholder-top, .promo-placeholder-bottom {
    border: 1px dashed #FBC09F;
    border-radius: 12px;
    padding: 1.25rem;
    color: #a3a3a8;
    background-color: #fff;
    display: none;
}
.promo-placeholder-top.active, .promo-placeholder-bottom.active {
    display: block;
}

.promo-placeholder-top b, .promo-placeholder-bottom b {
    color: var(--primary-color);
    font-weight: 600;
}
.review-placeholder {
    margin: 1.25rem 0;
    color: var(--text-secondary);
}

.preview-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}
.preview-actions .btn-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
}
.preview-actions .action-buttons {
    display: flex;
    flex: 1;
    gap: 0.5rem;
}
.preview-actions .action-buttons button {
    flex: 1;
}

.preview-notice {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-align: center;
}


/* Mobile Responsiveness */
.mobile-header {
    display: none;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 2rem;
}

.content-wrapper {
    max-width: 1200px;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s ease-out;
        background-color: #ffffff; /* 모바일에서도 확실히 흰 배경 유지 */
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-top: 70px; /* 헤더 높이만큼 */
    }
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-actions {
        flex-wrap: wrap;
    }
    .table-header {
        flex-direction: column;
        gap: 1rem;
    }
    .review-list {
        padding: 0.5rem;
    }
    .review-card-header, .review-card-body, .review-card-footer {
        padding: 1rem;
    }
    .reply-actions-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding-left: 0; /* 모바일에서 패딩 제거 */
    }
    .reply-actions-wrapper button, .reply-actions button {
        font-size: 13px !important;
        padding: 8px 12px !important;
        flex: 0 1 auto;
    }
    .reply-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    /* 모바일 계약관리 개선 - 데스크톱 스타일 덮어쓰기 */
    .user-contract-item {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 20px !important;
        grid-template-columns: unset !important;
    }
    .user-contract-item-info {
        display: flex !important;
        flex-direction: row !important;
        gap: 0 !important;
        align-items: center !important;
        padding: 12px 0 !important;
        padding-left: 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
        justify-content: flex-start !important;
    }
    .user-contract-item-info strong {
        color: #64748b !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        text-align: left !important;
        min-width: 65px !important;
        width: 65px !important;
        flex-shrink: 0 !important;
        margin-right: 12px !important;
    }
    .user-contract-item-info span {
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #1e293b !important;
        text-align: left !important;
        flex: 1 !important;
    }
    .contract-grade-wrapper,
    .contract-date-wrapper,
    .contract-save-wrapper {
        width: 100% !important;
        margin-top: 16px !important;
    }
    .contract-grade-wrapper select,
    .contract-date-wrapper input {
        width: 100% !important;
        font-size: 15px !important;
        padding: 14px !important;
        border: 1px solid #d1d5db !important;
        border-radius: 8px !important;
        background: white !important;
        box-sizing: border-box !important;
    }
    .contract-save-wrapper {
        margin-top: 20px !important;
    }
    .contract-save-wrapper button {
        width: 100% !important;
        padding: 14px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        justify-content: center !important;
    }
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: var(--bg-content);
        border-bottom: 1px solid var(--border-color);
        padding: 0 1rem;
        z-index: 1002;
    }
    .hamburger-btn {
        font-size: 1.5rem;
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        z-index: 1002;
        position: absolute;
        left: 1rem;
        padding: 0.5rem;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        font-weight: 700;
        flex: 1;
    }
    .summary-cards-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid-v2 {
        grid-template-columns: 1fr;
    }
    .ai-persona-grid {
        grid-template-columns: 1fr;
    }
    .promotion-settings-grid {
        grid-template-columns: 1fr;
    }
}

.sidebar.open {
    transform: translateX(0);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-overlay.open {
    display: block;
}

/* Plan Page Styles */
.plan-page-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.plan-card {
    background-color: var(--bg-content);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.plan-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
}
.my-subscription-content {
    display: grid;
    grid-template-columns: 240px 1fr 200px;
    align-items: center;
    gap: 2rem;
}
.my-subscription-illust {
    width: 242px;
    height: 125px;
    background-image: url('../images/plan_free.png'); /* Add a placeholder image */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.my-subscription-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-left: 1px solid var(--border-color);
    padding-left: 2rem;
}
.detail-item {
    display: flex;
    gap: 1rem;
}
.detail-item span:first-child {
    color: var(--text-secondary);
    width: 120px;
    flex-shrink: 0;
}
.detail-item span:last-child {
    font-weight: 600;
}
.alarm-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alarm-setting a {
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 0.9rem;
}

/* Simple toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(18px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.my-subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Platform Connection List in My Info */
.platform-connection-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.platform-connection-list h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.connection-item {
    background-color: #F6F8FD;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.connection-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.connection-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Pricing Table */
.pricing-table {
    display: flex;
    flex-direction: column;
}
.plan-header-row, .plan-feature-row {
    display: grid;
    grid-template-columns: 2fr 3fr 3fr 3fr 3fr;
    border-bottom: 1px solid var(--border-color);
}
.plan-cell {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.plan-feature-row .plan-cell {
    min-height: 68px;
    background-color: #F6F8FD;
}
.plan-feature-row .plan-cell.feature-col {
    background-color: #FBFCFD;
    align-items: flex-start;
    font-weight: 500;
    color: var(--text-secondary);
}
.plan-header-row .plan-cell {
    gap: 0.5rem;
    padding-bottom: 1.5rem;
}
.plan-header-row .plan-cell h4 { font-size: 1.2rem; font-weight: 700; margin:0; }
.plan-header-row .plan-cell p { margin:0; font-weight: 500; }
.plan-header-row .plan-cell button { width: 100%; max-width: 160px; margin-top: 1rem;}

.plan-tag { font-size: 0.8rem; padding: 0.25rem 0.75rem; border-radius: 99px; font-weight: 600; min-height: 28px; }
.plan-tag.current { background-color: var(--primary-color-light); color: var(--primary-color); }
.plan-tag.recommend { background-color: #FFE7D9; color: #F05600; }

.plan-header-row .plan-cell.recommended {
    background-color: #FFF5F0CC;
    border-radius: 12px 12px 0 0;
    position: relative;
}
.plan-feature-row .plan-cell:nth-child(4) {
    background-color: #FEF2EC;
}

.plan-cell .bi-check-lg {
    color: var(--primary-color);
    font-size: 1.5rem;
}
.plan-cell.special-feature {
    background-color: #F6F8FD;
    color: var(--text-secondary);
    font-size: 0.9rem;
    gap: 0.5rem;
}
.plan-cell.special-feature b { color: var(--text-primary); }
.plan-cell .bi-gem { color: var(--primary-color); font-size: 0.8rem; margin-left: 0.25rem; }

@media (max-width: 1200px) {
    .my-subscription-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .my-subscription-details {
        border-left: none;
        padding-left: 0;
        align-items: center;
    }
     .detail-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    .my-subscription-actions {
        flex-direction: row;
    }
    .my-subscription-actions button {
        flex: 1;
    }
    .pricing-table {
        font-size: 0.9rem;
    }
    .plan-header-row, .plan-feature-row {
        grid-template-columns: 1.5fr 2fr 2fr 2fr 2fr;
    }
}

/* Platform Connect View */
#platform-connect-view {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 120px); /* Adjust height as needed */
}

.connect-form-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.connect-form-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.connect-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.connect-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.connect-form .form-group {
    text-align: left;
}

.connect-form .form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.connect-form .form-group input {
    margin-top: 0.5rem;
    height: 50px;
}

.btn-full {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    justify-content: center;
}


@media (max-width: 768px) {
    .pricing-table {
        /* On small screens, we might need a more drastic change like a horizontal scroll or card-based layout */
        /* For now, let's just make it scrollable */
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
     .plan-header-row, .plan-feature-row {
        display: inline-grid;
        min-width: 800px; /* Force scrolling */
    }
}

/* 데스크톱 계약관리 스타일 (모바일 미디어쿼리 밖에 정의) */
@media (min-width: 769px) {
    .user-contract-item {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr 120px 160px 80px !important;
        gap: 15px !important;
        align-items: center !important;
        flex-direction: unset !important;
        padding: 20px !important;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .user-contract-item-info {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        padding: 0 !important;
        border-bottom: none !important;
        justify-content: flex-start !important;
    }

    .user-contract-item-info strong {
        font-size: 12px !important;
        color: #64748b !important;
        font-weight: 600 !important;
    }

    .user-contract-item-info span {
        font-size: 14px !important;
        color: #1e293b !important;
        font-weight: 500 !important;
    }

    .contract-grade-wrapper select,
    .contract-date-wrapper input {
        padding: 8px !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        width: 100% !important;
        font-size: 14px !important;
    }

    .contract-save-wrapper {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .contract-save-wrapper button {
        width: 100% !important;
        padding: 8px 12px !important;
        white-space: nowrap !important;
        text-align: center !important;
        margin-top: 0 !important;
        justify-content: center !important;
    }
}
