/* 기본 & 폰트 설정 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* 시놀로지 DSM과 유사한 배경색 */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 상단 정렬로 변경 */
    min-height: 100%;
    height: 100%; /* 정확한 높이 설정 */
    overflow-y: hidden; /* 세로 스크롤 방지 */
}

.container {
    max-width: 900px;
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
    margin-top: 10px;
}

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 20px; /* 40px에서 20px로 축소 */
    margin-top: 10px; /* 상단 여백 추가 */
}

header h1 {
    font-size: 2.5rem;
    color: #1a73e8; /* DSM 스타일의 파란색 */
    margin: 0;
}

header p {
    font-size: 1.1rem;
    color: #5f6368;
}

/* 메뉴 그리드 */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 130px); /* 아이템 크기에 맞춰 조정 */
    gap: 20px;
    justify-content: center; /* 가운데 정렬 */
}

/* 메뉴 아이템 */
.menu-item {
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 20px 10px 15px 10px; /* 상단 패딩 줄이고 하단 패딩 더 줄임 */
    text-align: center;
    text-decoration: none;
    color: #3c4043;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* 위에서부터 시작 */
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.302);
    width: 130px; /* 90% 크기로 축소 (145px * 0.9 ≈ 130px) */
    height: 130px; /* 정사각형을 위한 높이 설정 */
    box-sizing: border-box; /* 패딩 포함한 전체 크기 계산 */
}

.menu-item:hover {
    box-shadow: 0 4px 8px 0 rgba(60,64,67,0.302), 0 6px 20px 0 rgba(60,64,67,0.19);
    transform: translateY(-5px);
    color: #1a73e8;
}

.menu-item i {
    color: #1a73e8; /* 아이콘 색상 */
    margin-bottom: 8px; /* 아이콘과 텍스트 간격 줄임 */
    margin-top: 10px; /* 상단 여백 추가 */
    transition: color 0.3s ease;
    font-size: 3rem; /* PC에서는 약간 작게 */
    flex-grow: 1; /* 남은 공간 차지 */
    display: flex;
    align-items: center;
}

.menu-item:hover i {
    color: #1967d2; /* 호버 시 약간 진한 색 */
}

.menu-item span {
    font-size: 0.9rem; /* 약간 작은 텍스트 */
    font-weight: 500;
    margin-bottom: 5px; /* 하단 여백 추가 */
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 5px;
    padding: 10px 0;
    color: #5f6368;
    font-size: 0.9rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 정확히 2열로 고정 */
        gap: 15px !important;
        padding: 0 20px !important; /* 좌우 여백 추가 */
        max-width: 360px !important; /* 90% 사이즈로 축소 (400px * 0.9 = 360px) */
        margin: 0 auto !important; /* 가운데 정렬 */
    }

    header {
        margin-bottom: 20px !important; /* 헤더 아래 여백을 반으로 줄임 (40px -> 20px) */
    }

    header h1 {
        font-size: 1.8rem;
    }

    footer {
        margin-top: 10px !important; /* 푸터 위 여백을 반으로 줄임 (50px -> 25px) */
    }
        
    .menu-item {
        padding: 15px 8px 12px 8px !important; /* 상단 패딩 줄이고 하단 더 줄임 */
        width: 100% !important; /* 그리드 셀에 맞춰 자동 조정 */
        aspect-ratio: 1 / 1 !important; /* 정사각형 비율 유지 */
        height: auto !important; /* 높이는 자동으로 계산 */
    }
    
    .menu-item i {
        font-size: 3.8rem !important; /* 모바일에서 더 큰 아이콘 */
        margin-bottom: 6px !important;
        margin-top: 6px !important;
    }
    
    .menu-item span {
        font-size: 0.85rem !important; /* 약간 작은 텍스트 */
        line-height: 1.2;
        margin-bottom: 5px !important;
    }
}

/* 추가 모바일 대응 */
@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 작은 화면에서도 2열 유지 */
        gap: 12px !important;
        padding: 0 15px !important; /* 좌우 여백 */
        max-width: 315px !important; /* 90% 사이즈로 축소 (350px * 0.9 = 315px) */
        margin: 0 auto !important;
    }

    header {
        margin-bottom: 15px !important; /* 더 작은 화면에서 헤더 아래 여백을 더 줄임 */
    }

    footer {
        margin-top: 10px !important; /* 더 작은 화면에서 푸터 위 여백을 더 줄임 */
    }
    
    
    .menu-item {
        padding: 12px 6px 10px 6px !important; /* 상단 패딩 줄이고 하단 더 줄임 */
        width: 100% !important; /* 그리드 셀에 맞춰 자동 조정 */
        aspect-ratio: 1 / 1 !important; /* 정사각형 비율 유지 */
        height: auto !important; /* 높이는 자동으로 계산 */
    }
    
    .menu-item i {
        font-size: 3.5rem !important; /* 더 큰 아이콘 */
        margin-bottom: 4px !important;
        margin-top: 4px !important;
    }
    
    .menu-item span {
        font-size: 0.8rem !important; /* 약간 작은 텍스트 */
        line-height: 1.1;
        margin-bottom: 4px !important;
    }
}
