/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    word-break: keep-all;
    word-wrap: break-word;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: left;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 50px;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    font-size: 4rem;
}

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

.profile-img:hover {
    transform: scale(1.05);
}

.header-text h1.name {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-text .title {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 5px;
    opacity: 0.9;
}

.header-text .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.8;
}

/* Header 반응형 스타일 */
@media (max-width: 768px) {
    .header {
        text-align: center;
        padding: 60px 0 40px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
    
    .header-text h1.name {
        font-size: 2.5rem;
    }
}

/* Navigation Styles */
.navigation {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation .container {
    position: relative;
}

/* 햄버거 메뉴 버튼 (기본적으로 숨김) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.hamburger-line {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #333;
    margin: 6px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* 햄버거 메뉴 애니메이션 */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.nav-list li {
    margin: 0 30px;
}

.nav-list a {
    display: block;
    padding: 20px 0;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-list a:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Section Styles */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* About Section */
.about-section {
    background: white;
}

.about-content {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.education {
    width: 100%;
    text-align: center;
}

.about-content h3 {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 25px;
    font-weight: 600;
}

.career-list,
.education-list {
    list-style: none;
}

.education-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.education-list li {
    max-width: 450px;
    width: 100%;
}

.career-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.education-list li {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.year {
    font-weight: 600;
    color: #667eea;
    min-width: 70px;
    margin-right: 15px;
    text-align: left;
}

.description {
    flex: 1;
    color: #555;
    text-align: left;
}

/* Books Section */
.books-section {
    background: #f8f9fa;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 450px;
    cursor: pointer;
}

@media (hover: hover) {
    .book-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

.book-cover {
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    pointer-events: none;
}

.cover-placeholder {
    font-size: 3.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.3s ease;
    background: #f8f9fa;
}

@media (hover: hover) {
    .book-card:hover .book-cover-img {
        transform: scale(1.05);
    }
}

.book-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 20px 20px;
    z-index: 2;
}

.book-title-overlay .book-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.book-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    visibility: hidden; /* 완전히 숨김 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: -1; /* 뒤로 보냄 */
    pointer-events: none;
}

/* 활성화 시에만 표시하고 클릭 가능 */
.book-card.active .book-info-overlay {
    opacity: 1;
    visibility: visible;
    z-index: 3;
    pointer-events: auto;
}

/* 호버 시에도 표시하고 클릭 가능 (데스크탑 전용) */
@media (hover: hover) {
    .book-card:hover:not(.closing) .book-info-overlay {
        opacity: 1;
        visibility: visible;
        z-index: 3;
        pointer-events: auto;
    }
}

/* 닫히는 중일 때는 즉시 숨김 */
.book-card.closing .book-info-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: -1 !important;
    pointer-events: none !important;
    transition: none !important; /* 즉시 적용 */
}

/* X 버튼 스타일링 (모바일 전용) */
.close-overlay {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    z-index: 50;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    line-height: 1;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    pointer-events: auto;
    align-items: center;
    justify-content: center;
    /* 모바일 최적화 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
}

/* 모바일에서만 X 버튼 표시 */
@media (hover: none) {
    .book-card.active .close-overlay {
        display: flex;
    }
}

.close-overlay:hover {
    background: white;
    transform: scale(1.1);
}

/* 모바일에서 비활성화된 카드의 구매 버튼은 완전히 차단 */
@media (hover: none) {
    .book-card:not(.active) .purchase-btn {
        pointer-events: none !important;
        cursor: default !important;
    }
}

/* 데스크탑에서는 호버나 활성화 상태가 아니면 구매 버튼 차단 */
@media (hover: hover) {
    .book-card:not(.active):not(:hover) .purchase-btn {
        pointer-events: none !important;
        cursor: default !important;
    }
}

/* 닫히는 중인 카드의 구매 버튼도 완전히 차단 */
.book-card.closing .purchase-btn {
    pointer-events: none !important;
    cursor: default !important;
}



/* 모바일에서 책 제목을 항상 표시 */
@media (hover: none) {
    .book-title-overlay {
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
        padding: 40px 20px 25px;
    }
}



.book-info-overlay .book-author {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.book-info-overlay .book-publisher {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.book-info-overlay .book-description {
    color: #e0e0e0;
    line-height: 1.5;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Purchase Buttons */
.purchase-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.purchase-btn {
    display: inline-block;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 75px;
    text-align: center;
    position: relative;
    z-index: 25;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: pointer;
    touch-action: manipulation;
}

/* 모바일에서 터치 시 추가 하이라이트 제거 */
.purchase-btn:active,
.purchase-btn:focus {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* iOS Safari에서 터치 시 회색 배경 제거 */
@media (hover: none) {
    .purchase-btn:active {
        background: rgba(255, 255, 255, 0.95);
    }
}

.purchase-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.purchase-btn.kyobo:hover {
    border-color: #4caf50;
    color: #4caf50;
}

.purchase-btn.yes24:hover {
    border-color: #5dade2;
    color: #5dade2;
}

.purchase-btn.aladin:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}



/* Contact Section */
.contact-section {
    background: white;
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

/* 데스크탑에서만 2열로 표시 */
@media (min-width: 769px) {
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-2px);
}

.contact-icon {
    font-size: 2rem;
    margin-right: 20px;
}

.contact-details h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 5px;
}

.contact-details a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-details a:hover {
    color: #764ba2;
}

.social-links {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-block;
    padding: 3px 0;
    white-space: nowrap;
}



/* Contact Form */
.contact-form {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.contact-form h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.email-button-container {
    text-align: center;
    padding: 10px 20px;
}

.email-btn {
    font-size: 1.1rem;
    padding: 18px 35px;
    border-radius: 10px;
    font-weight: 500;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.email-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}


/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding-bottom: 20px;
    }
    
    .header-content {
        gap: 20px;
        padding: 0 15px;
    }
    
    .header-text h1.name {
        font-size: 2.2rem;
    }
    
    /* 모바일에서 햄버거 메뉴 버튼 보이기 */
    .mobile-menu-btn {
        display: block;
    }
    
    /* 모바일에서 네비게이션 높이 조정 */
    .navigation {
        min-height: 60px;
    }
    
    .navigation .container {
        min-height: 60px;
        display: flex;
        align-items: center;
    }
    
    /* 모바일에서 네비게이션 메뉴 숨기기 */
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
    }
    
    /* 메뉴가 열렸을 때 */
    .nav-list.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }
    
    .nav-list li {
        margin: 5px 0;
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
    }
    
    .nav-list a {
        padding: 15px 30px;
        border-bottom: none;
        border-radius: 5px;
        text-align: center;
        display: block;
        min-width: 120px;
        font-weight: 500;
    }
    
    .nav-list a:hover {
        background-color: #f8f9fa;
        border-bottom: none;
    }
    
    /* 슬라이드 다운 애니메이션 */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .about-content {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .contact-content {
        gap: 40px;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-item {
        margin-bottom: 20px;
    }
    
    .education-list li {
        max-width: 100%;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .book-card {
        height: 320px;
        cursor: pointer;
        /* 터치 디바이스에서 탭 하이라이트 제거 */
        -webkit-tap-highlight-color: transparent;
    }
    
    .book-title-overlay .book-title {
        font-size: 1rem;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* 매우 작은 모바일 화면용 */
@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .mobile-menu-btn {
        right: 10px;
        padding: 18px;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .book-card {
        height: 400px;
        margin-bottom: 10px;
    }
    
    .book-title-overlay .book-title {
        font-size: 1.1rem;
    }
}

/* 맨 위로 가기 버튼 */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.scroll-to-top:active {
    transform: translateY(0);
}

/* 모바일에서 버튼 크기 조정 */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

