/* Global Styles */
:root {
    --primary-color: #fff;
    --text-color: #000;
    --accent-color: #666;
    --card-bg-color: #f0f0f0;
    --card-bg-dark: #1a1a1a;
    --transition-speed: 0.3s;
    --flip-duration: 0.6s;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Paperlogy', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    display: flex;
    position: relative;
    min-height: 100vh;
}

/* 왼쪽 사이드 네비게이션 바 */
.sidebar {
    width: 250px;
    height: 100vh;
    background-color: #fff;
    position: sticky;
    top: 0;
    left: 0;
    padding: 30px 0;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    
    /* 스크롤바 숨기기 */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Webkit 브라우저 (Chrome, Safari 등)에서 스크롤바 숨기기 */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.sidebar-logo img {
    height: 40px;
    display: block;
}

.sidebar-menu {
    padding: 0 20px;
}

.sidebar-menu-item {
    margin-bottom: 25px;
}

.sidebar-menu-title {
    color: #000;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-menu-title::after {
    content: '+';
    font-size: 20px;
    transition: transform 0.3s ease;
}

.sidebar-menu-title.open::after {
    transform: rotate(45deg);
}

.sidebar-submenu {
    margin-left: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* 데스크톱에서는 기본적으로 열려있도록 설정 */
@media (min-width: 992px) {
    /* 초기 상태에서 서브메뉴 열려있음 */
    .sidebar-submenu {
        max-height: 0;
    }
    
    .sidebar-submenu.open {
        max-height: 300px;
    }
    
    /* + 버튼 유지 */
    .sidebar-menu-title::after {
        content: '+';
        display: block;
    }
}

.sidebar-submenu.open {
    max-height: 300px;
}

.sidebar-submenu-item {
    margin: 8px 0;
}

.sidebar-submenu-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.sidebar-submenu-link:hover {
    color: #000;
}

/* 햄버거 메뉴 버튼 (모바일용) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 30px;
    height: 30px;
    z-index: 2000;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #000;
    margin: 6px 0;
    transition: 0.3s;
}

/* Main Content */
.main-wrapper {
    width: calc(100% - 250px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.frame {
    position: relative;
    width: 100%;
    max-width: 1100px;
    box-sizing: border-box;
    padding: 40px 0;
}

/* Section headers for major/minor titles */
.section-header {
    margin: 40px 0 16px;
}

.section-header .major {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.section-header .minor {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

@media (max-width: 1400px) {
    .frame {
        margin-right: 20px;
    }
}

@media (max-width: 992px) {
    body {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        background-color: #fff;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        width: 100%;
        display: block;
    }
    
    .frame {
        max-width: 100%;
        padding: 20px 10px;
    }
}

/* Project Header */
.project-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 20px;
}

.project-header h1 {
    font-size: 48px;
    font-weight: 900;
    margin: 0 0 16px;
    color: var(--text-color);
    font-family: 'Paperlogy', sans-serif;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.project-header p {
    font-size: 18px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 60px;
}

.category-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 12px 32px;
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-family: 'Paperlogy', sans-serif;
    font-size: 16px;
    font-weight: 500;
}

.category-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.category-btn.active {
    background-color: var(--text-color);
    color: var(--primary-color);
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

/* Project Cards with Flip Effect */
.project-card {
    position: relative;
    perspective: 1000px;
    border-radius: 24px;
    aspect-ratio: 16/9;
    width: 100%;
    display: none; /* Initially hidden */
}

.project-card.visible {
    display: block;
}

.project-card.fade-in {
    opacity: 1;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform var(--flip-duration) ease;
}

.flip-card .card-inner {
    transform: rotateX(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
}

.card-front {
    background-color: #000;
    transform: rotateX(0deg);
}

.card-back {
    background-color: #000;
    transform: rotateX(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.project-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.project-info p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.back-content {
    text-align: center;
    color: #fff;
}

.back-content h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}

/* 카드 뒷면 제목 숨김 */
.card-back .back-content h3 {
    display: none;
}

.back-content p {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.5;
}

.back-content .description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 24px;
}

/* Style for placeholder cards */
.project-card.placeholder {
    background-color: var(--card-bg-color);
}

/* Glass Morphism Card */
.project-card.glass .card-inner {
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: url('../models/glass.svg#liquid-glass') blur(12px) brightness(1.08) saturate(1.2);
    backdrop-filter: url('../models/glass.svg#liquid-glass') blur(12px) brightness(1.08) saturate(1.2);
}

.project-card.glass img {
    opacity: 0.7;
}

.project-card.glass .card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--text-color);
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card.glass:hover .card-content {
    opacity: 1;
}

/* Apply glassmorphism to all project cards while preserving flip */
.project-card {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    -webkit-backdrop-filter: url('../models/glass.svg#liquid-glass') blur(10px) brightness(1.05) saturate(1.1);
    backdrop-filter: url('../models/glass.svg#liquid-glass') blur(10px) brightness(1.05) saturate(1.1);
}

.project-card .card-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.0) 35%, rgba(0,0,0,0.25) 100%);
    pointer-events: none;
}

.project-card .card-front,
.project-card .card-back {
    border: none;
}

.project-card .card-back {
    background: rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(10px) brightness(1.05);
    backdrop-filter: blur(10px) brightness(1.05);
}

/* Card Content */
.card-content h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: var(--text-color);
}

.card-content p {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
}

/* Tags */
.project-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: var(--text-color);
}

/* Fade Animation */
.fade-animation {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-animation.show {
    opacity: 1;
    transform: translateY(0);
}

/* Floating Button */
.floating-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 99;
}

.floating-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    main {
        margin-top: 15px;
        padding: 0 16px;
    }

    .project-header {
        margin-bottom: 40px;
        padding-top: 5px;
        margin-top: 0;
    }

    .project-header h1 {
        font-size: 36px;
    }

    .project-header p {
        font-size: 16px;
    }

    .categories {
        gap: 8px;
        margin-bottom: 40px;
        flex-wrap: wrap;
    }

    .category-btn {
        padding: 10px 24px;
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .back-content h3 {
        font-size: 20px;
    }
    
    .back-content p {
        font-size: 14px;
    }
    
    .back-content .description {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .project-header {
        margin-bottom: 30px;
        padding-top: 5px;
        margin-top: 0;
    }

    .project-header h1 {
        font-size: 32px;
    }

    .categories {
        flex-wrap: wrap;
    }

    .project-info {
        padding: 20px;
    }

    .project-info h3 {
        font-size: 18px;
    }

    .project-info p {
        font-size: 14px;
    }
    
    .card-back {
        padding: 16px;
    }
}

@media (max-width: 992px) {
    body {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        background-color: #fff;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
        width: 30px;
        height: 30px;
        top: 20px;
        left: 20px;
        z-index: 2000;
        background-color: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }
    
    /* 햄버거 메뉴 아이콘 선 스타일 */
    .menu-toggle span {
        width: 100%;
        height: 3px;
        margin: 6px 0;
        background-color: #000;
        border-radius: 0;
    }
    
    /* 모바일 메뉴 폰트 크기 유지 */
    .sidebar-menu-title {
        font-size: 18px;
    }
    
    .sidebar-submenu-link {
        font-size: 14px;
    }
    
    .sidebar-menu-link {
        font-size: 18px;
    }
}

.sidebar-menu-link {
    color: #000;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.sidebar-menu-link:hover {
    color: #666;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
        background-color: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }
    
    /* 햄버거 메뉴 토글 애니메이션 */
    .menu-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
} 