:root {
    --primary-color: #514D6F;
    --white-color: #FFFFFF;
    --border-radius: 8px;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--white-color);
    color: #333;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
    animation: pageFadeIn 0.5s ease-out forwards;
}

body.page-fade-out {
    animation: pageFadeOut 0.3s ease-in forwards;
}

@keyframes pageFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes pageFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* 헤더 스타일 */
.main-header {
    height: 80px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.header-logo img {
    height: 40px;
}

.header-nav {
    display: flex;
    gap: 40px;
}

.header-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s, color 0.3s;
}

.header-nav a:hover, .header-nav a.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.header-lang {
    color: #333;
    cursor: pointer;
}

/* 메인 컨테이너 */
.container {
    position: relative;
    flex: 1;
    width: 100vw;
    overflow: hidden;
}

/* 좌우 분할 화면 공통 스타일 */
.split {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.split .content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    transition: transform 0.5s ease;
    width: 40%;
}

/* 좌측 텍스트 위치 지정 */
.split.left .content {
    left: 8%;
}

/* 우측 텍스트 위치 지정 */
.split.right .content {
    left: 52%;
}

.split h2 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.split p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 12px 35px;
    font-size: 0.95rem;
    color: #333;
    background-color: var(--white-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 600;
    letter-spacing: 1px;
}

.btn:hover, .btn:active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* 오버레이 (가독성을 위한 어두운 배경) */
.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.left-overlay {
    background: linear-gradient(135deg, rgba(20,50,80,0.6), rgba(40,100,120,0.4));
}

.right-overlay {
    background: linear-gradient(135deg, rgba(30,40,30,0.5), rgba(50,60,50,0.3));
}

/* 왼쪽 화면 (IT 부문) - clip-path를 이용한 사선 처리 */
.left {
    background-image: url('images/LeftSide_IT_img.jpeg');
    /* 이미지가 너무 확대되어 보일 경우 background-size를 100% 100% (왜곡 발생) 또는 구체적인 크기로 변경할 수 있습니다. 
       하지만 반응형을 위해서는 cover가 가장 좋으며, 보이는 위치를 조절하려면 아래 background-position을 수정하세요. */
    background-size: cover;
    background-position: left top; /* 좌측 상단으로 포커스 조정 */
    background-repeat: no-repeat;
    clip-path: polygon(0 0, 55% 0, 45% 100%, 0 100%);
    transition: clip-path 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 10;
}

/* 오른쪽 화면 (제조 부문) - 전체 영역 (왼쪽에 가려짐) */
.right {
    background-image: url('images/RightSide_Plastic_img.jpeg');
    background-size: cover;
    background-position: left top; /* 좌측 상단으로 포커스 조정 */
    background-repeat: no-repeat;
    z-index: 5;
}

/* 마우스 오버 시 사선 이동 (clip-path 애니메이션) */
.hover-left .left {
    clip-path: polygon(0 0, 60% 0, 50% 100%, 0 100%);
}

.hover-right .left {
    clip-path: polygon(0 0, 50% 0, 40% 100%, 0 100%);
}

/* 중앙 로고 박스 */
.center-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    background-color: #fff;
    border-radius: 12px;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    pointer-events: none; /* 클릭 이벤트를 통과시켜 뒤의 split이 감지되게 함 */
}

.center-box img {
    width: 140px;
    height: auto;
}

/* 푸터 스타일 */
.main-footer {
    height: 70px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 100;
}

.footer-logo img {
    height: 45px;
    opacity: 1;
}

.footer-copy {
    color: #888;
    font-size: 0.85rem;
}

/* 반응형 처리 */
@media (max-width: 1024px) {
    .split.left .content { left: 5%; width: 45%; }
    .split.right .content { left: 50%; width: 45%; }
    .split h2 { font-size: 2rem; }
    .center-box { width: 160px; height: 160px; }
    .center-box img { width: 100px; }
}

@media (max-width: 768px) {
    body { flex-direction: column; overflow: auto; height: auto; }
    .container { flex-direction: column; height: auto; }
    .split { position: relative; width: 100%; height: 50vh; clip-path: none !important; }
    .left { clip-path: none; z-index: 1; }
    .right { z-index: 1; }
    .split.left .content, .split.right .content { left: 50%; transform: translateX(-50%); width: 80%; text-align: center; }
    .center-box { display: none; }
    .header-nav { display: none; }
    .hover-left .left, .hover-right .left { clip-path: none; }
    .main-header { padding: 0 20px; }
    .main-footer { flex-direction: column; justify-content: center; gap: 10px; padding: 20px; height: auto; text-align: center; }
}

/* 원료 가이드 툴팁 (호버) */
.guide-icon-wrapper {
    position: relative;
    display: inline-block;
}
.material-guide-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: -20px;
    width: max-content;
    max-width: 650px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 1000;
    color: #334155;
    margin-bottom: 12px;
    cursor: default;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}
.guide-icon-wrapper:hover .material-guide-tooltip {
    display: block;
}
/* 말풍선 꼬리표 */
.material-guide-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 28px;
    border-width: 8px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}
.material-guide-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 27px;
    border-width: 9px;
    border-style: solid;
    border-color: #e2e8f0 transparent transparent transparent;
}
.guide-tooltip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}
.guide-tooltip-table th {
    text-align: left;
    padding: 0.5rem;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    white-space: nowrap;
}
.guide-tooltip-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}
.guide-tooltip-table td.lbl {
    font-weight: 600;
    color: #475569;
}
.guide-tooltip-table .sm-txt {
    font-size: 0.75rem;
    color: #94a3b8;
}
.guide-tooltip-footer {
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}
.guide-tooltip-footer ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
}
.guide-tooltip-footer li {
    margin-bottom: 0.3rem;
}