/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

/* Header styles */
.header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    height: 120px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

.header-left {
    width: 220px; 
    height: 100%;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.3);
}

.header-center {
    flex: 1;
    padding: 0 50px;
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    height: 100%;
    display: flex;
    align-items: center;
}

.title {
    font-size: 48px;
    font-weight: 800;
    color: #000000;
    line-height: 40px;
}

.description {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.5);
    line-height: 1.5;
    max-width: 500px;
    font-weight: 500;
    font-size: 14px;
}

.header-right {
    height: 100%;
}

.navigation {
    display: flex;
    flex-direction: row;
    height: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 250px;
    text-decoration: none;
    color: #000000;
    padding: 0 20px;
    transition: color 0.2s ease;
    border-right: 1px solid rgba(0, 0, 0, 0.3);
    height: 100%;
}

.nav-item-row1 {
    display: flex;
    align-items: center;
}

.nav-item-row2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-item:hover {
    color: #333333;
}

.nav-title {
    font-size: 16px;
    font-weight: 500;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: rgba(0, 0, 0, 0.5);
}

.nav-subtitle-container {
    position: relative;
    height: 22px;
    width: 100px;
    overflow: hidden;
}

.nav-subtitle {
    font-size: 18px;
    font-weight: 500;
    color: #000000;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;
    line-height: 22px;
    transition: transform 0.3s ease;
}

.nav-subtitle-1 {
    transform: translateY(0);
}

.nav-subtitle-2 {
    transform: translateY(100%);
}

.nav-item:hover .nav-subtitle-1 {
    transform: translateY(-100%);
}

.nav-item:hover .nav-subtitle-2 {
    transform: translateY(0);
}

.nav-arrow-container {
    position: relative;
    width: 40px;
    height: 40px;
    overflow: hidden;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
}

.nav-arrow-1 {
    transform: translateX(0);
}

.nav-arrow-2 {
    transform: translateX(-100%);
}

.nav-item:hover .nav-arrow-1 {
    transform: translateX(100%);
}

.nav-item:hover .nav-arrow-2 {
    transform: translateX(0);
}

/* Main content */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px 60px;
}

.main-about {
    margin: 0 auto;
    background-color: #000000;
}

/* Categories section */
.categories {
    text-align: center;
    margin: 40px;
}

.categories-title {
    font-size: 16px;
    font-weight: 800;
    color: #000000;
    margin-bottom: 20px;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 20px;
}   

.category {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.category:hover {
    color: #000000;
}

.category.active {
    color: #000000;    
    font-weight: 600;
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    row-gap: 50px;
    column-gap: 20px;
    margin-top: 40px;
}

.project-item {
    display: flex;
    flex-direction: column;
}

.project-thumbnail {
    background-color: #f5f5f5;
    margin-bottom: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 1;
    width: 100%;
}

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

.project-title {
    font-size: 18px;
    font-weight: 400;
    color: #000000;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Thumbnail image styles */
.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.thumbnail-image:hover {
    transform: scale(1.05);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    max-height: 800px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background-color: #000000;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-title-container {
    height: 100%;
    padding: 30px 0px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-title {
    font-size: 40px;
    font-weight: 600;
    padding: 0 30px;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.modal-body {
    display: flex;
    height: calc(100% - 80px);
}

.modal-left {
    width: 460px;
    background-color: #000000;
    color: #ffffff;
    padding: 30px;
    overflow-y: auto;
}

.project-description h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #ffffff;
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.project-description p {
    font-size: 16px;
    line-height: 1.6;
    color: #cccccc;
    margin: 0;
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.modal-right {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
}

.tab-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flex;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    background-color: #000000;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Wix Madefor Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tab-button.active {
    background-color: #ffffff;
    color: #000000;
}

.tab-button:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.5);
}

.tab-icon {
    width: 40px;
    height: 40px;
    transition: opacity 0.2s ease;
    filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

.tab-button.active .tab-icon {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%);
}

.tab-button:hover:not(.active) .tab-icon {
    filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
    opacity: 0.8;
}

.tab-content {
    flex: 1;
    position: relative;
    background-color: #f8f8f8;
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: block;
}

.preview-container {
    height: 100%;
    width: 100%;
}

#previewFrame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #ffffff;
}

.code-container {
    height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    background-color: #f8f8f8;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: #cccccc #f8f8f8;
}

.code-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-container::-webkit-scrollbar-track {
    background: #f8f8f8;
}

.code-container::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}

.code-container::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

#codeContent {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#codeContent pre {
    margin: 0;
    padding: 0;
    background: transparent;
}

#codeContent code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    padding: 0;
    margin: 0;
    display: block;
    white-space: pre;
    overflow: visible;
    word-wrap: normal;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 10;
    padding: 0;
}

.modal-close:hover {
    background-color: #333333;
}

.close-icon {
    width: 34px;
    height: 34px;
    transition: opacity 0.2s ease;
}

.modal-close:hover .close-icon {
    opacity: 0.8;
}

/* About Me Section */
.about-container {
    display: flex;
    min-height: calc(100vh - 120px);
    width: 100%;
}

.about-left {
    flex: 1;
    background-color: #fff;
    padding: 60px;
    display: flex;
    justify-content: center;
}

.about-right {
    flex: 2;
    background-color: #000;
    color: #fff;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-left img {
    max-width: 500px;
    max-height: 500px;
    width: 100%;
    height: auto;
    object-fit: cover;
}



.text-content {
    width: 100%;
    position: relative;
}

.about-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #fff;
}

#lined-text {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 16px;
    line-height: 1.6;
    color: #fff;
}

.text-paragraph {
    margin-bottom: 20px;
}

.text-line {
    display: flex;
    margin-bottom: 2px;
    min-height: 1.6em;
}

.line-number {
    width: 40px;
    text-align: right;
    padding-right: 15px;
    color: #666;
    font-size: 14px;
    font-weight: 300;
    border-right: 1px solid #333;
    margin-right: 15px;
    flex-shrink: 0;
    user-select: none;
}

.line-content {
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* About section responsive design - already handled in main responsive section */


/* Responsive design */
@media (max-width: 1200px) {
    .header-content {
        max-width: 100%;
        padding: 0 40px;
    }
    
    .header-left {
        width: 180px;
        padding: 0 30px;
    }
    
    .nav-item {
        width: 200px;
        padding: 0 15px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .header {
        height: 100px;
    }
    
    .header-content {
        padding: 0 30px;
    }
    
    .header-left {
        width: 150px;
        padding: 0 20px;
    }
    
    .header-center {
        padding: 0 30px;
    }
    
    .nav-item {
        width: 180px;
        padding: 0 12px;
    }
    
    .title {
        font-size: 36px;
    }
    
    .description {
        font-size: 13px;
    }
    
    .nav-title {
        font-size: 14px;
    }
    
    .nav-subtitle-container {
        height: 20px;
        width: 80px;
    }
    
    .nav-subtitle {
        font-size: 16px;
        height: 20px;
        line-height: 20px;
    }
    
    .main {
        padding: 0 40px 50px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .about-container {
        flex-direction: column;
    }
    
    .about-left {
        padding: 40px 30px;
    }
    
    .about-right {
        padding: 40px 30px;
        flex: 1;
    }
    
    .about-left img {
        position: static;
        max-width: 100%;
        max-height: 300px;
        width: 100%;
        height: auto;
        object-fit: cover;
        margin-bottom: 20px;
    }
    
    .about-title {
        font-size: 28px;
        margin-bottom: 25px;
    }
    
    #lined-text {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .line-number {
        width: 35px;
        font-size: 12px;
        padding-right: 10px;
        margin-right: 10px;
    }
    
    .text-line {
        margin-bottom: 1px;
        min-height: 1.6em;
    }
}

@media (max-width: 768px) {
    .header {
        height: auto;
        padding: 20px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }
    
    .header-left {
        width: 100%;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.3);
        height: auto;
        padding-bottom: 20px;
    }
    
    .header-center {
        width: 100%;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.3);
        height: auto;
        padding-bottom: 20px;
    }
    
    .header-right {
        width: 100%;
        height: auto;
    }
    
    .navigation {
        flex-direction: row;
        justify-content: space-around;
        height: auto;
    }
    
    .nav-item {
        width: auto;
        flex: 1;
        padding: 15px 10px;
        border-right: 1px solid rgba(0, 0, 0, 0.3);
    }
    
    .nav-item:last-child {
        border-right: none;
    }
    
    .title {
        font-size: 32px;
        text-align: center;
    }
    
    .description {
        font-size: 12px;
        text-align: center;
    }
    
    .nav-title {
        font-size: 12px;
    }
    
    .nav-subtitle-container {
        height: 18px;
        width: 70px;
    }
    
    .nav-subtitle {
        font-size: 14px;
        height: 18px;
        line-height: 18px;
    }
    
    .nav-arrow-container {
        width: 30px;
        height: 30px;
    }
    
    .nav-arrow {
        width: 30px;
        height: 30px;
    }
    
    .main {
        padding: 0 20px 40px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .about-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .about-left {
        padding: 30px 20px;
    }
    
    .about-right {
        padding: 30px 20px;
        flex: 1;
    }
    
    .about-left img {
        position: static;
        max-width: 100%;
        max-height: 200px;
        width: 100%;
        height: auto;
        object-fit: cover;
        margin-bottom: 15px;
    }
    
    .about-title {
        font-size: 26px;
        margin-bottom: 20px;
    }
    
    #lined-text {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .line-number {
        display: none;
    }
    
    .text-line {
        margin-bottom: 1px;
        min-height: 1.5em;
    }
    
    .line-content {
        margin-left: 0;
    }
    
    /* 모바일에서 파라그래프 단위로 표시 */
    #lined-text {
        white-space: normal;
    }
    
    .text-line {
        display: inline;
    }
    
    .text-line:not(:last-child) {
        margin-bottom: 0;
    }
    
    /* 빈 줄을 파라그래프 구분자로 사용 */
    .text-line:has(.line-content:empty) {
        display: block;
        height: 15px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 15px 0;
    }
    
    .header-content {
        padding: 0 15px;
        gap: 15px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .description {
        font-size: 11px;
    }
    
    .navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-item {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.3);
        padding: 12px 10px;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-title {
        font-size: 11px;
    }
    
    .nav-subtitle-container {
        height: 17px;
        width: 60px;
    }
    
    .nav-subtitle {
        font-size: 13px;
        height: 17px;
        line-height: 17px;
    }
    
    .nav-arrow-container {
        width: 25px;
        height: 25px;
    }
    
    .nav-arrow {
        width: 25px;
        height: 25px;
    }
    
    .main {
        padding: 0 15px 30px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .about-left {
        padding: 20px 15px;
    }
    
    .about-right {
        padding: 20px 15px;
        flex: 1;
    }
    
    .about-left img {
        max-height: 200px;
        margin-bottom: 10px;
        object-fit: contain;
    }
    
    .about-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    #lined-text {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .line-number {
        display: none;
    }
    
    .text-line {
        margin-bottom: 1px;
        min-height: 1.4em;
    }
    
    .line-content {
        margin-left: 0;
    }
    
    /* 모바일에서 파라그래프 단위로 표시 */
    #lined-text {
        white-space: normal;
    }
    
    .text-line {
        display: inline;
    }
    
    .text-line:not(:last-child) {
        margin-bottom: 0;
    }
    
    /* 빈 줄을 파라그래프 구분자로 사용 */
    .text-line:has(.line-content:empty) {
        display: block;
        height: 12px;
        margin-bottom: 12px;
    }
}

/* Modal responsive design */
@media (max-width: 1200px) {
    .modal-content {
        width: 95%;
        max-width: 1000px;
    }
    
    .modal-left {
        width: 400px;
    }
}

@media (max-width: 1024px) {
    .modal-content {
        width: 98%;
        height: 85%;
    }
    
    .modal-left {
        width: 350px;
        padding: 25px;
    }
    
    .modal-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 90%;
        margin: 20px;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-left {
        width: 100%;
        flex: 0 0 auto;
        max-height: 250px;
        padding: 20px;
    }
    
    .modal-right {
        flex: 1;
    }
    
    .modal-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .tab-icon {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-left {
        padding: 15px;
        max-height: 200px;
    }
    
    .project-description h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .project-description p {
        font-size: 12px;
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .tab-icon {
        width: 25px;
        height: 25px;
    }
    
    .code-container {
        height: 300px;
        padding: 15px;
    }
    
    #codeContent {
        font-size: 12px;
    }
    
    #codeContent code {
        font-size: 12px;
    }
}