/**
 * OnlyOne Cafe - Main Stylesheet
 * @version 2.0.0
 */

/* 기본 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #3730A3;
}

/* 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand .logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-menu a {
    font-weight: 500;
}

.navbar-user,
.navbar-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 메인 컨텐츠 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3730A3;
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 폼 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 알림 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

/* 홈 페이지 */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7C3AED 100%);
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 기능 섹션 */
.features {
    padding: 4rem 0;
    background-color: var(--bg-primary);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    text-align: center;
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* 카페 그리드 */
.popular-cafes {
    padding: 4rem 0;
}

.popular-cafes h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* 혼합형 그리드 레이아웃 (리스트 형태) */
.cafe-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

/* 카페 카드 - 가로 배치 */
.cafe-card {
    display: flex;
    flex-direction: row;
    background-color: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 140px;
}

.cafe-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 카페 썸네일 - 정사각형 */
.cafe-cover {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    background-color: var(--primary-color);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* 카페 정보 - 오른쪽 영역 */
.cafe-info {
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cafe-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.cafe-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cafe-stats {
    display: flex;
    gap: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: auto;
}

.cafe-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 카테고리 배지 */
.cafe-category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* 카페 헤더 (제목 + 북마크) */
.cafe-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cafe-header h3 {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    margin: 0;
}

/* 북마크 버튼 */
.btn-bookmark {
    flex-shrink: 0;
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
    color: #ffd700;
}

.btn-bookmark:hover {
    transform: scale(1.2);
}

.btn-bookmark.bookmarked {
    animation: bookmarkPop 0.3s ease;
}

@keyframes bookmarkPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* 액션 버튼 영역 */
.cafe-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.cafe-actions button {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cafe-actions .btn-enter {
    background: var(--primary-color);
    color: white;
}

.cafe-actions .btn-enter:hover {
    background: var(--primary-dark, #5b21b6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cafe-actions .btn-more {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-primary);
    border: 1px solid var(--border-color, #e5e7eb);
}

.cafe-actions .btn-more:hover {
    background: var(--bg-tertiary, #e5e7eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 이미지 호버 오버레이 */
.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cafe-cover:hover .cover-overlay {
    opacity: 1;
}

/* 이미지 변경 버튼 */
.btn-change-cover {
    background: white;
    color: var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-change-cover:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 혼합형 그리드 반응형 */
@media (max-width: 768px) {
    .cafe-card {
        min-height: 120px;
    }
    
    .cafe-cover {
        width: 120px;
        height: 120px;
    }
    
    .cafe-info {
        padding: 0.75rem 1rem;
    }
    
    .cafe-header h3 {
        font-size: 1.05rem;
    }
    
    .cafe-info p {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        margin-bottom: 0.5rem;
    }
    
    .cafe-stats {
        font-size: 0.8rem;
        gap: 1rem;
    }
    
    .cafe-actions {
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .cafe-actions button {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-bookmark {
        font-size: 1.1rem;
    }
    
    .cafe-category {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.25rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .btn-change-cover {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .cafe-grid {
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .cafe-card {
        min-height: 100px;
    }
    
    .cafe-cover {
        width: 100px;
        height: 100px;
    }
    
    .cafe-info {
        padding: 0.75rem;
    }
    
    .cafe-header h3 {
        font-size: 1rem;
    }
    
    .cafe-info p {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        margin-bottom: 0.4rem;
    }
    
    .cafe-stats {
        font-size: 0.75rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .cafe-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .cafe-actions button {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .btn-bookmark {
        font-size: 1rem;
    }
    
    .cafe-category {
        top: 0.4rem;
        left: 0.4rem;
        padding: 0.2rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .btn-change-cover {
        padding: 0.5rem 0.85rem;
        font-size: 0.75rem;
    }
}

@media (min-width: 1200px) {
    /* 데스크톱에서는 리스트 형태 유지 */
    .cafe-grid {
        gap: 1.25rem;
    }
    
    .cafe-cover {
        width: 160px;
        height: 160px;
    }
    
    .cafe-info h3 {
        font-size: 1.3rem;
    }
    
    .cafe-info p {
        font-size: 0.95rem;
        -webkit-line-clamp: 3; /* 데스크톱에서는 3줄 */
    }
}

/* 인증 페이지 */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 300px);
    padding: 2rem 0;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* 404 페이지 */
.not-found {
    text-align: center;
    padding: 4rem 0;
}

.not-found h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.not-found p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* 푸터 */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* 반응형 */
@media (max-width: 768px) {
    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .feature-grid,
    .cafe-grid {
        grid-template-columns: 1fr;
    }
}

/* 프로필 페이지 */
.profile-page {
    padding: 2rem 0;
}

.profile-content {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-placeholder {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.profile-info h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.profile-info .nickname {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.profile-info .email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-actions {
        flex-direction: column;
    }
}

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

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.post-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.post-item .post-content {
    flex: 1;
    min-width: 0;
}

.post-item .post-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-item h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.post-item p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-form {
    max-width: 800px;
    margin: 0 auto;
}

.post-form .form-group {
    margin-bottom: 1.5rem;
}

.post-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.post-form input,
.post-form select,
.post-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.post-form textarea {
    resize: vertical;
}

.post-form .form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .posts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .post-form .form-actions {
        flex-direction: column;
    }
}

/* 플랫폼 통계 섹션 */
.platform-stats {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.platform-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.platform-stats .stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.platform-stats .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.platform-stats .stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.platform-stats .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.platform-stats .stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 992px) {
    .platform-stats .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .platform-stats .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 카페 목록 페이지 */
.cafes-page {
    padding: 2rem 0;
}

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

.cafes-page .page-header h1 {
    margin: 0;
}

.search-filters {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-box .form-control {
    flex: 1;
}

.filters-row {
    display: flex;
    gap: 1rem;
}

.filters-row .form-control {
    flex: 1;
}

.results-info {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.cafe-list .cafe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.cafe-list .cafe-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cafe-list .cafe-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.cafe-list .cafe-cover {
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}

.cafe-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
}

.cafe-list .cafe-info {
    padding: 1.5rem;
}

.cafe-list .cafe-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.cafe-list .cafe-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cafe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.cafe-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.cafe-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.page-info {
    font-weight: 500;
    color: var(--text-primary);
}

.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
    .cafe-list .cafe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .cafes-page .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .cafe-list .cafe-grid {
        grid-template-columns: 1fr;
    }
}

/* AI 카페 생성 페이지 */
.create-cafe-page {
    padding: 2rem 0;
}

.create-cafe-page .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.creation-modes {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.mode-btn {
    padding: 1rem 2rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

.ai-mode, .manual-mode {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-control-lg {
    font-size: 1.1rem;
    padding: 0.875rem 1rem;
}

.ai-result {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

.ai-result h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.name-suggestions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.suggestion-btn:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

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

.boards-preview {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
}

.boards-preview h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.board-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.board-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.board-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.board-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 768px) {
    .creation-modes {
        flex-direction: column;
    }
    
    .board-list {
        grid-template-columns: 1fr;
    }
}

/* 게시글 상세 페이지 */
.post-detail-page {
    padding: 2rem 0;
    background: var(--bg-secondary);
    min-height: calc(100vh - 200px);
}

.post-detail {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.post-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.cafe-name {
    color: var(--primary-color);
    font-weight: 600;
}

.board-name {
    color: var(--text-secondary);
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.post-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-info .author {
    font-weight: 600;
    color: var(--text-primary);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 2rem;
    min-height: 200px;
}

.post-content p {
    margin-bottom: 1rem;
}

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

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.post-tags .tag {
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

.post-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* 댓글 섹션 */
.comments-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.comments-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.login-prompt {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.comment-author {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-author strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

.comment-content {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.comment-actions-small {
    display: flex;
    gap: 1rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0;
}

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

.empty-comments {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
}

.post-item {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .post-detail {
        padding: 1.5rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .comments-section {
        padding: 1.5rem;
    }
    
    .post-info {
        flex-wrap: wrap;
    }
    
    .post-meta {
        flex-wrap: wrap;
    }
}

/* ===================================
   프로필 페이지 스타일
   =================================== */
.profile-page {
    padding: 2rem 0;
}

.profile-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    flex-shrink: 0;
}

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

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
}

.profile-info h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.profile-info .nickname {
    color: var(--text-secondary);
    margin: 0 0 0.25rem 0;
}

.profile-info .email {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin: 0;
}

.admin-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.profile-details {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-details h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.admin-section {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.admin-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea22 0%, #764ba222 100%);
    border-radius: 8px;
}

.admin-actions {
    display: flex;
    gap: 1rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    padding-top: 2rem;
}

@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats,
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .profile-actions,
    .admin-actions {
        flex-direction: column;
    }
    
    .detail-item {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* 인기 카페 목록 */
.popular-cafes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.cafe-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.cafe-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.cafe-rank {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.cafe-info {
    flex: 1;
}

.cafe-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cafe-stats-mini {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-mini {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-mini:hover {
    background: #3730A3;
    transform: scale(1.05);
}

/* 관리자 섹션 제목 */
.admin-section h4 {
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .cafe-item {
        flex-wrap: wrap;
    }
    
    .cafe-rank {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .cafe-stats-mini {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-mini {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* AI 자동 생성 섹션 */
.ai-generate-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
}

.ai-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: white;
}

.ai-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.ai-input-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.ai-topic-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.ai-topic-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.ai-topic-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
}

.btn-ai {
    padding: 0.75rem 2rem;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-ai:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.15);
    border-left: 4px solid #ff6b6b;
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .ai-input-group {
        flex-direction: column;
    }
    
    .btn-ai {
        width: 100%;
    }
}

/* 카페 커버 이미지 개선 */
.cafe-cover {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* 그라데이션 배경에 패턴 추가 */
.cafe-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.03) 10px,
            rgba(255, 255, 255, 0.03) 20px
        );
    pointer-events: none;
}

/* 카페 카테고리 배지 개선 */
.cafe-category {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 카페 카드 호버 효과 강화 */
.cafe-card:hover .cafe-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.3)
    );
    z-index: 1;
}

/* 내 카페 페이지는 카페 목록과 동일한 스타일 사용 */
/* .my-cafes-page .cafe-cover 스타일은 기본 .cafe-cover 스타일을 사용 */

/* 내 카페 페이지 헤더 */
.my-cafes-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.my-cafes-page .page-header h1 {
    margin: 0;
}

/* 그라데이션 애니메이션 효과 (옵션) */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.cafe-card:hover .cafe-cover {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   게시물 이미지 스타일
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.post-images {
    margin: 30px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.post-image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-image-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-image-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.image-credit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    padding: 10px 15px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-image-item:hover .image-credit {
    opacity: 1;
}

.image-credit a {
    color: #60A5FA;
    text-decoration: none;
}

.image-credit a:hover {
    text-decoration: underline;
}

/* 단일 이미지일 경우 */
.post-images .post-image-item:only-child {
    grid-column: 1 / -1;
    max-width: 800px;
    margin: 0 auto;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .post-images {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .post-image-item img {
        border-radius: 8px;
    }
    
    /* 게시물 리스트 모바일 반응형 */
    .post-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .post-item .post-thumbnail {
        width: 100%;
        height: 180px;
        order: -1; /* 이미지를 상단으로 */
    }
}

/* About 페이지 스타일 */
.about-page {
    padding: 2rem 0;
}

.about-page .page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.about-page .page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.about-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.about-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.about-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.about-section a:hover {
    text-decoration: underline;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* About 페이지 모바일 대응 */
@media (max-width: 768px) {
    .about-page .page-header h1 {
        font-size: 2rem;
    }
    
    .about-section {
        padding: 1.5rem;
    }
    
    .about-section h2 {
        font-size: 1.5rem;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
}
