/*
 * 통합 스타일시트 (style.css)
 * 기존 CSS 파일들을 병합하고 디자인을 개선했습니다.
 */

/* ------------------- */
/* # 기본 및 폰트 설정 */
/* ------------------- */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&family=Noto+Sans+JP:wght@400;700&family=Noto+Sans:wght@400;700&family=Do+Hyeon&display=swap');

:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --card-color: #1e1e1e;
    --primary-text: #e0e0e0;
    --secondary-text: #b3b3b3;
    --text-muted: #b3b3b3;
    --accent-color: #e6c300;
    --primary-color: #e6c300;
    --secondary-color: #f0db4f;
    --glow-color: rgba(230, 195, 0, 0.4);
    --hover-color: #2a2a2a;
    --border-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--bg-color);
    color: var(--primary-text);
	font-family: 'Noto Sans', 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
	overflow-y: scroll;
	overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
	-webkit-user-select: none;
	-moz-user-select: -moz-none;
	-ms-user-select: none;
	user-select: none;
}

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

a:hover {
    color: var(--accent-color);
}

img {
	-webkit-user-drag: none;
    max-width: 100%;
    height: auto;
}
img[src*="open.svg"] {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

.copyright::after {
	content: "© 2018-2025 HungBok All Rights Reserved.";
}

/* 스크롤바 디자인 */
body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background-color: var(--bg-color); }
body::-webkit-scrollbar-thumb { background-color: #4f4f4f; border-radius: 4px; }
body::-webkit-scrollbar-thumb:hover { background-color: #6f6f6f; }


/* ------------------- */
/* # 헤더 및 프로필 */
/* ------------------- */

.profile-header {
    position: relative;
    text-align: center;
    padding: 80px 20px;
    overflow: hidden;
}

.profile-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("/image/new_profile_background.png");
    background-repeat: repeat;
    background-attachment: fixed;
    filter: blur(4px) brightness(0.5);
    transform: scale(1.1);
    z-index: -2;
}

.profile-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, var(--bg-color), transparent);
    z-index: -1;
}

.profile-identity {
    position: relative;
    z-index: 1;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(230, 195, 0, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease;
}
.profile-picture:hover {
    transform: scale(1.05) rotate(5deg);
}

.profile-name {
    color: #ffffff;
    font-size: 4rem;
    font-family: 'Do Hyeon', sans-serif;
    margin: 10px 0;
    text-shadow: 0 2px 10px var(--shadow-color);
}

.profile-realnames .realname {
    display: none;
    color: var(--secondary-text);
    font-weight: bold;
    margin: 2px 8px;
    padding: 4px 10px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.profile-realnames .realname.active {
    display: inline-block;
}
.profile-realnames .realname:hover {
    color: #ffffff;
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(230, 195, 0, 0.3);
}

/* ------------------- */
/* # 언어 선택 (수정됨) */
/* ------------------- */
.language-select {
    position: fixed; /* 화면에 고정 */
    top: 20px;
    right: 20px;
    z-index: 1001; /* 다른 요소들 위에 오도록 z-index 조정 */
}
.lang-dropdown {
    position: relative;
    display: inline-block;
}
.lang-dropbtn {
    background-color: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(5px);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}
.lang-dropbtn:hover {
    background-color: rgba(40, 40, 40, 0.9);
}
.lang-dropbtn img {
    width: 16px;
}
.lang-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--surface-color);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px var(--shadow-color);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
    right: 0;
    margin-top: 5px;
}
.lang-dropdown-content.active {
    display: block;
}
.lang-dropdown-content a {
    color: var(--primary-text);
    padding: 10px 15px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.lang-dropdown-content a img {
    width: 20px;
}
.lang-dropdown-content a:hover {
    background-color: var(--hover-color);
}


/* ------------------- */
/* # 메인 컨텐츠 및 섹션 */
/* ------------------- */

.profile-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-section {
    margin-bottom: 60px;
}

/* NEW Section Title Style */
.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 30px;
    padding-left: 15px;
    border-left: 4px solid var(--accent-color);
}


/* 정보 박스 그리드 */
.profile-card-integrated {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    padding-top: 5rem;
    text-align: center;
    position: relative;
    margin-top: 60px;
    backdrop-filter: blur(5px);
}
.profile-image-wrapper {
    height: 100px;
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--border-color);
    padding: 0 40px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bolder;

}
.profile-image {
    height: 100%;
    max-height: 40px;
    object-fit: cover;
    filter: brightness(10);
}

.info-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    text-align: left;
}
.info-item {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}
.info-item:hover {
    transform: translateY(-3px);
    background: rgba(0,0,0,0.4);
}
.info-item strong { display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.25rem;}
.info-item span, .info-grid-detailed .info-item a { font-weight: 500; font-size: 1rem; }
.profile-country {
    width: 24px;
    margin: 0 3px;
    vertical-align: middle;
}
.color-chip {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: var(--accent-color);
    border-radius: 50%;
    vertical-align: middle;
    cursor: pointer;
}

/* ------------------- */
/* # 신규 섹션: 프로젝트 & 컴퓨터 사양 */
/* ------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.project-card {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--primary-text);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.project-card h3 { margin-top: 0; color: #fff; }
.project-card p { color: var(--text-muted); }
.project-card img { height: 100px; max-width: 200px; object-fit: contain; filter: brightness(10); }

.specs-grid {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.spec-item {
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
}
.spec-item strong {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}
.spec-item span { font-weight: 500; font-size: 1rem; }

/* ------------------- */
/* # 계정 탭 */
/* ------------------- */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 10px;
}
.tab-link {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
}
.tab-link.active, .tab-link:hover {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* 링크 박스 그리드 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.link-box {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}
.link-box:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.link-box .link-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain; /* 아이콘 비율 유지 */
    transition: transform 0.3s;
}
.link-box:hover .link-icon img {
    transform: scale(1.1);
}
.link-box .link-details { flex-grow: 1; }
.link-box .link-name {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
}
.link-box .link-id {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.9rem;
    word-break: break-all;
}
.link-box .qr-code {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-left: auto;
}
.link-box .qr-code:hover { opacity: 1; }


/* ------------------- */
/* # 즐겨찾기 섹션 */
/* ------------------- */

.favorite-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.favorite-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    display: block;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}
.favorite-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    border-color: var(--primary-color);
}
.favorite-card .thumbnail {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}
.favorite-card .title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 60%;
    text-align: center;
}
.favorite-card .logo {
    max-width: 80%;
    max-height: 60px;
    transition: transform 0.3s;
}
.favorite-card:hover .logo {
    transform: scale(1.1);
}
.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
}


/* ------------------- */
/* # 푸터 및 기타 */
/* ------------------- */

.profile-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    background-color: #0a0a0a;
    color: var(--secondary-text);
}

.guideline {
    color: #666;
    margin: 50px auto 0;
    font-size: 0.8rem;
    max-width: 800px;
    line-height: 1.6;
    text-align: center;
}

#topBtn {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 40px;
	height: 40px;
	background: var(--accent-color);
	color: #000;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: none;
    z-index: 1000;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    transition: opacity 0.3s, transform 0.3s;
}
#topBtn:hover {
    opacity: 0.8;
}

/* 툴팁 */
[data-tooltip-text]:hover { position: relative; }
[data-tooltip-text]::after {
	content: attr(data-tooltip-text);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1001;
}
[data-tooltip-text]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 복사 알림 (토스트) */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.toast {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: fadeInOut 3s forwards;
    opacity: 0;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-20px); }
  15%, 85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}

/* QR 코드 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s;
}
.modal.active { display: flex; align-items: center; justify-content: center; }

.modal-content {
    position: relative;
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    width: 90%;
    max-width: 300px;
    box-shadow: 0 5px 25px var(--shadow-color);
    animation: slideIn 0.4s;
    transition: background-color 0.4s ease; /* For smooth color change */
}

/* QR Modal with background color */
.modal-content.has-color {
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.modal-content.has-color #qr-modal-name {
    color: #fff;
}
.modal-content.has-color .close-btn {
    color: rgba(255,255,255,0.8);
}
.modal-content.has-color .close-btn:hover {
    color: #fff;
}


@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--secondary-text);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}
.close-btn:hover { color: var(--primary-text); }

#qr-modal-name {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    color: #fff;
}
#qr-modal-img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 250px;
    border-radius: 10px;
    background-color: #fff;
    padding: 10px;
}

/* ------------------- */
/* # 반응형 디자인 */
/* ------------------- */

@media(max-width: 768px) {
    .profile-name { font-size: 3rem; }
    .section-title { font-size: 1.5rem; }
    .info-grid-detailed { grid-template-columns: 1fr; }
    .profile-header { padding: 60px 15px; }
    .profile-main { padding: 0 15px; }
    .tabs { justify-content: flex-start; overflow-x: auto; padding-bottom: 10px; }
}

@media(max-width: 480px) {
    .profile-name { font-size: 2.5rem; }
    .profile-realnames .realname { margin: 2px 4px; font-size: 0.9rem; }
    .links-grid { grid-template-columns: 1fr; }
    .profile-section { margin-bottom: 40px; }
    #topBtn { bottom: 15px; right: 15px; }
    .tab-link { padding: 8px 12px; font-size: 0.9rem; }
    .favorite-grid { grid-template-columns: 1fr; }
}