/* --- 1. 기본 설정 --- */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- 2. 사이드바 --- */
.sidebar {
    width: 240px;
    background-color: #000000;
    padding: 24px;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #282828;
}

.sidebar .logo {
    display: block; /* [수정] <a> 태그를 블록 요소로 변경 */
    color: white;
    text-align: left;
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: 60px; /* [수정] 여백 80px로 적용 */
}

.sidebar .main-nav,
.sidebar .footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    color: #b3b3b3;
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background-color: #282828;
    color: white;
}

.sidebar .footer-nav {
    margin-top: auto;
}

/* --- 3. 메인 콘텐츠 --- */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    height: 100vh;
    box-sizing: border-box;
}

/* [추가] 언어 버튼을 담는 최상단 컨테이너 */
.top-bar-container {
    padding: 10px 40px 0 40px;
    display: flex;
    justify-content: flex-end; /* 오른쪽 정렬 */
}

/* [추가] 언어 변경 버튼 */
.lang-switcher {
    display: flex;
    border: 1px solid #555;
    border-radius: 5px;
    overflow: hidden;
}

.lang-switcher .lang-btn {
    padding: 8px 12px;
    text-decoration: none;
    color: #888;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.lang-switcher .lang-btn.active {
    background-color: #333;
    color: white;
}

.lang-switcher .lang-btn:hover:not(.active) {
    background-color: #222;
}

/* [정리] 메인 헤더 (중복 제거) */
.main-content header {
    position: relative;
    display: flex;
    justify-content: flex-end; /* 버튼 영역을 오른쪽으로 보냄 */
    align-items: center;
    /* [수정] 언어 버튼과 간격을 맞추기 위해 상단 마진 축소 */
    margin: 10px 40px 40px 40px;
    padding-bottom: 20px;
}

.main-content header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5em;
    font-weight: bold;
    color: white;
    letter-spacing: 2px;
    margin: 0;
}

/* [정리] 헤더 버튼 전체 영역 (세로 배치) */
.header-actions {
    display: flex;
    flex-direction: column; /* [수정] 위아래(세로)로 쌓기 */
    align-items: flex-end; /* 오른쪽 정렬 */
    gap: 10px; /* 버튼 '그룹' 간의 세로 간격 */
    z-index: 2;
}

/* [정리] 각 버튼 그룹 (로그인+회원가입)은 가로로 배치 */
.header-actions > div {
    display: flex;
    gap: 10px;
}

/* --- 4. 헤더 버튼 스타일 (정리) --- */

/* [정리] 헤더의 모든 버튼(a, button)에 공통 스타일 적용 */
.header-actions .btn-login,
.header-actions .btn-logout,
.header-actions .admin-button {
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s;

    /* [핵심] 버튼 글자 세로 줄바꿈 방지 */
    white-space: nowrap;
}

/* 로그인/로그아웃/관리자 (고스트 버튼) */
.header-actions .btn-secondary,
.header-actions .admin-button {
    background-color: transparent;
    color: white;
    border: 1px solid #555;
}

/* 회원가입 (솔리드 버튼) */
.header-actions .btn-primary {
    background-color: #ffffff;
    color: #121212;
    border: none;
    font-weight: bold;
}

/* [요청] 호버(hover) 스타일: 배경 #e0e0e0, 글씨 #121212 */
.header-actions .btn-secondary:hover,
.header-actions .admin-button:hover,
.header-actions .btn-primary:hover {
    background-color: #e0e0e0;
    color: #121212;
}


/* --- 5. 카드 그리드 --- */
.fashion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 0 40px 50px 40px; /* 헤더의 margin과 좌우 패딩 맞춤 */
}

.fashion-card {
    position: relative; /* 찜하기 버튼 기준점 */
    background-color: #1c1c1c;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid #282828;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.fashion-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.fashion-card .card-link-area {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fashion-card .card-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: top;
    display: block;
}

.fashion-card .card-content {
    padding: 20px;
}

.fashion-card .content-title {
    font-size: 1em;
    font-weight: 500;
    color: #e0e0e0;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fashion-card .celeb-name {
    font-size: 0.9em;
    font-weight: normal;
    color: #b3b3b3;
    margin: 0 0 10px 0;
}

.fashion-card .item-count {
    font-size: 0.9em;
    color: #b3b3b3;
}

/* --- 6. 찜하기(Like) 버튼 (SVG 하트) --- */

.fashion-card .like-button,
.image-section .like-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #555;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.8;
    transition: all 0.2s ease;
    z-index: 10;
}

.fashion-card:hover .like-button,
.image-section:hover .like-button {
    opacity: 1;
}

.fashion-card .like-button:hover,
.image-section .like-button:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
}

.like-button .icon-heart {
    width: 20px;
    height: 20px;
    background-color: transparent;
    /* 기본 (빈 하트): 흰색 테두리 SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

/* '찜한' 상태(.active)일 때: 꽉 찬 빨간색 SVG */
.fashion-card .like-button.active .icon-heart,
.image-section .like-button.active .icon-heart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e53e3e'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

/* ::before 가상 요소는 더 이상 필요 없음 */
.like-button .icon-heart::before {
    content: none;
}