@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    color-scheme: light dark;
}

body {
    font-family: "Pretendard", sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

.container {
    width: 80%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

.header {
    font-size: 3.5rem;
    font-weight: 400;
    text-align: left;
    transition: text-shadow 0.3s ease, color 0.3s ease; 
}

.content {
    padding-top: 5rem;
}

.content__item {
    margin: 2rem auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.content__item__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-radius: 15px;
    text-decoration: none;
    color: #212529;
    transition: all 0.2s ease-in-out;
    border: none;
}

.content__item__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.content__item__link:nth-child(1):hover {
    background: linear-gradient(135deg, #ffe0e0, #ffeaea);
}

.content__item__link:nth-child(2):hover {
    background: linear-gradient(135deg, #d4ebff, #e8f4ff);
}

.content__item__link:nth-child(3):hover {
    background: linear-gradient(135deg, #d4ffe2, #e8fff0);
}

.content__item__link:nth-child(4):hover {
    background: linear-gradient(135deg, #ffecc6, #fff5e5);
}

.content__item__link:nth-child(5):hover {
    background: linear-gradient(135deg, #ead5ff, #f4e8ff);
}

.content__item__link:nth-child(6):hover {
    background: linear-gradient(135deg, #d7ccc8, #efebe9);
}

.content__item__link i {
    font-size: 2.5rem;
    width: 30px;
    text-align: left;
}

.content__item__link span {
    word-break: keep-all;
    white-space: pre-wrap;
    flex-grow: 1;
    text-align: right;
    margin-left: 20px;
    font-size: 2.5rem;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin: 0;
}

.controls__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: #212529;
    font-size: 2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
}

.controls__item i {
    font-size: 1.1em;
}

.controls__item:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.footer {
    margin-top: auto;
    width: 100%;
    padding: 1.5rem 0;
    text-align: center;
    background-color: #f8f9fa;
    transition: background-color 0.3s ease;
}

.footer p {
    margin: 0.4rem 0;
    font-size: 1rem;
    color: #6c757d;
    transition: color 0.3s ease;
}

.footer p:first-child {
    font-weight: 500;
    font-size: 1rem;
    color: #495057;
}

/*아이콘 색깔 개별 지정 */
.content__item__link:nth-child(1) i {
    color: #e74c3c;
}
.content__item__link:nth-child(2) i {
    color: #3498db;
}
.content__item__link:nth-child(3) i {
    color: #2ecc71;
}
.content__item__link:nth-child(4) i {
    color: #f39c12;
}
.content__item__link:nth-child(5) i {
    color: #9b59b6;
}
.content__item__link:nth-child(6) i {
    color: #795548;
}

/* 적응형 디자인 */
@media (max-width: 1200px) {
    .container {
        width: 100%;
        padding: 0 1.5rem;
        box-sizing: border-box;
    }
    
    .content__item {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.8rem;
        margin: 1.8rem 0;
    }

    .content__item__link {
        padding: 2rem;
        height: auto;
        min-height: 100px;
    }

    .content__item__link i {
        font-size: 3rem;
    }

    .content__item__link span {
        font-size: 2.5rem;
        margin-left: 1.5rem;
    }

    .controls {
        margin: 0;
        gap: 1.2rem;
    }

    .controls__item {
        padding: 1rem 1.8rem;
        font-size: 1.6rem;
    }
}

@media (max-width: 768px) {
    .header {
        font-size: 3rem;
    }

    .content__item {
        grid-template-columns: 1fr;
        margin: 2rem 1rem;
    }
    
    .container {
        width: 100%;
        padding: 0 1rem;
        margin: 0;
    }

    .controls__item {
        padding: 12px 15px;
        font-size: 1.2rem;
        flex-direction: column;  /* 세로 배치로 변경 */
        gap: 5px;  /* 아이콘과 텍스트 사이 간격 조정 */
        text-align: center;  /* 텍스트 중앙 정렬 */
        min-width: 70px;  /* 최소 너비 설정 */
    }
    
    .controls__item i {
        font-size: 1.8rem;  /* 아이콘 크기 유지 */
        margin-bottom: 2px;  /* 아이콘 아래 여백 추가 */
    }

    .controls {
        gap: 8px;  /* 버튼 사이 간격 줄임 */
    }
}

/* 더 작은 화면에서 추가 조정 */
@media (max-width: 375px) {
    .controls__item {
        padding: 10px 12px;
        font-size: 1.1rem;
        min-width: 60px;
    }
    
    .controls__item i {
        font-size: 1.6rem;
    }
}

/* 1024px 이상일 때의 스타일 */
@media (min-width: 1200px) {
    .content__item__link {
        height: 200px;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 30px;
        position: relative;
    }

    .content__item__link i {
        font-size: 4em;
        align-self: flex-start;
        margin-bottom: 20px;
    }

    .content__item__link span {
        font-size: 3rem;
        position: absolute;
        bottom: 30px;
        right: 30px;
        margin: 0;
        text-align: right;
        max-width: 80%;
    }

    .controls {
        margin: 0;
    }
}

/* 각 항목별 그데이션 배경 */
.content__item__link:nth-child(1) {
    background: linear-gradient(135deg, #ffeaea, #fff);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.1);
}

.content__item__link:nth-child(2) {
    background: linear-gradient(135deg, #e8f4ff, #fff);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1);
}

.content__item__link:nth-child(3) {
    background: linear-gradient(135deg, #e8fff0, #fff);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.1);
}

.content__item__link:nth-child(4) {
    background: linear-gradient(135deg, #fff5e5, #fff);
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.1);
}

.content__item__link:nth-child(5) {
    background: linear-gradient(135deg, #f4e8ff, #fff);
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.1);
}

.content__item__link:nth-child(6) {
    background: linear-gradient(135deg, #efebe9, #fff);
    box-shadow: 0 2px 10px rgba(121, 85, 72, 0.1);
}

/* 도움말 버튼 타일 */
.controls__item:nth-child(1) {
    background: linear-gradient(135deg, #e8f4ff, #fff);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1);
}

.controls__item:nth-child(1):hover {
    background: linear-gradient(135deg, #d4ebff, #e8f4ff);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

/* 고대비 버튼 스타일 */
.controls__item:nth-child(2) {
    background: linear-gradient(135deg, #f4e8ff, #fff);
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.1);
}

.controls__item:nth-child(2):hover {
    background: linear-gradient(135deg, #ead5ff, #f4e8ff);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.2);
    transform: translateY(-2px);
}

.controls__item:nth-child(3) {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), #fff);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.1);
}

.controls__item:nth-child(3):hover {
    background: linear-gradient(135deg, #d4f0e2, #e8fff0);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.2);
    transform: translateY(-2px);
}

/* 아이콘 색상 */
.controls__item:nth-child(1) i {
    color: #3498db;
}

.controls__item:nth-child(2) i {
    color: #9b59b6;
}

.controls__item:nth-child(3) i {
    color: #2ecc71;
}

/* 고대비 모드 스타일 */
body.high-contrast {
    background: #000;
}

body.high-contrast::before {
    background: linear-gradient(to bottom, 
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.8) 50%,
        rgba(0,0,0,0) 100%);
}

body.high-contrast .container {
    background-color: #000;
}

body.high-contrast .content__item__link {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

body.high-contrast .content__item__link:hover {
    background: #333;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

body.high-contrast .controls__item {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

body.high-contrast .controls__item:hover {
    background: #333;
}

body.high-contrast .footer {
    background-color: #000;
    border-top: 1px solid #fff;
}

body.high-contrast .footer p {
    color: #fff;
}

/* 아이콘 색상 고대비 모드 */
body.high-contrast .content__item__link i {
    color: #fff;
}

body.high-contrast .controls__item i {
    color: #fff;
}

/* 고대비 모드 텍스트 색상 */
body.high-contrast .header p {
    color: #fff;
}

body.high-contrast .content__item__link span {
    color: #fff;
}

/* 다크모드 타일 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
    }
}

body.dark-mode {
    background-color: #121212;
    transition: background-color 0.3s ease;
}

body.dark-mode .header {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(255, 255, 255, 0.3),
                 0 0 30px rgba(255, 255, 255, 0.2);
}

/* 다크모드에서 각 항목별 배경 그라데이션 */
body.dark-mode .content__item__link:nth-child(1) {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.2);
}

body.dark-mode .content__item__link:nth-child(2) {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
}

body.dark-mode .content__item__link:nth-child(3) {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.2);
}

body.dark-mode .content__item__link:nth-child(4) {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.2);
}

body.dark-mode .content__item__link:nth-child(5) {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.2);
}

body.dark-mode .content__item__link:nth-child(6) {
    background: linear-gradient(135deg, rgba(121, 85, 72, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(121, 85, 72, 0.2);
}

/* 다크모드에서 hover 효과 */
body.dark-mode .content__item__link:nth-child(1):hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), #2d2d2d);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

body.dark-mode .content__item__link:nth-child(2):hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.25), #2d2d2d);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

body.dark-mode .content__item__link:nth-child(3):hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.25), #2d2d2d);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

body.dark-mode .content__item__link:nth-child(4):hover {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.25), #2d2d2d);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

body.dark-mode .content__item__link:nth-child(5):hover {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.25), #2d2d2d);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

body.dark-mode .content__item__link:nth-child(6):hover {
    background: linear-gradient(135deg, rgba(121, 85, 72, 0.25), #2d2d2d);
    box-shadow: 0 5px 15px rgba(121, 85, 72, 0.3);
}

/* 아이콘 색상 유지 */
body.dark-mode .content__item__link i {
    opacity: 0.9;  /* 약간의 투명도만 추가 */
}

/* 텍스트 색상 */
body.dark-mode .content__item__link span {
    color: #fff;
}

/* 컨트롤 버튼 스타일 */
body.dark-mode .controls__item {
    color: #fff;  /* 텍스트 색상을 흰색으로 변경 */
}

body.dark-mode .controls__item:nth-child(1) {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
}

body.dark-mode .controls__item:nth-child(2) {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.2);
}

body.dark-mode .controls__item:nth-child(3) {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), #1e1e1e);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.2);
}

/* 컨트롤 버튼 아이콘 색상 유지 */
body.dark-mode .controls__item:nth-child(1) i {
    color: #3498db;  /* 도움말 아이콘 색상 */
    opacity: 0.9;
}

body.dark-mode .controls__item:nth-child(2) i {
    color: #9b59b6; 
}

body.high-contrast.dark-mode {
    background: #000;
}

body.high-contrast.dark-mode .content__item a,
body.high-contrast.dark-mode .controls__item {
    background: #000;
    border: 2px solid #fff;
}

/* 다크드 토글 버튼 추가 */
.dark-mode-toggle {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    font-size: 1.8rem;
    padding: 0.5rem;
}

body.dark-mode .dark-mode-toggle {
    color: #fff;
}

/* 푸터 다크모드 스타일 */
body.dark-mode .footer {
    background-color: #121212;  /* 본문과 같은 배경색 */
}

body.dark-mode .footer p {
    color: #4d5053;
}

body.dark-mode .footer p:first-child {
    color: #6b7074;
}

/* 초기 상태에서 컨텐츠를 숨김 */
.content-wrapper {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 컨텐츠가 준비되면 표시 */
.content-wrapper.ready {
    opacity: 1;
    visibility: visible;
}

/* 로딩 중 표시할 요소 */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader.hidden {
    display: none;
}

/* 고대비 모드에서는 그림자 제거 */
body.high-contrast .header {
    text-shadow: none;
}
