<!DOCTYPE html>
<html lang="ko">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>병원 접수 키오스크</title>
    <!-- Use Standard Font -->
    <link rel="stylesheet" href="/css/web/font.css">
    <style>
        :root {
            --primary-color: #1B66C9;
            --primary-hover: #1652a3;
            --bg-color: #F8FBFF;
            --card-bg: #ffffff;
            --text-main: #494E53;
            --text-sub: #777d85;
            --border-color: #DDE2E8;
        }

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

        body {
            font-family: 'Pretendard', sans-serif;
            background-color: var(--bg-color);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            color: var(--text-main);
        }

        /* 메인 컨테이너 */
        .kiosk-container {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 80px 100px;
            text-align: center;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
            width: 100%;
            max-width: 1200px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 800px;
            /* Force substantial height */
        }

        /* 헤더 */
        .header {
            margin-bottom: 80px;
        }

        .hospital-logo {
            width: 100px;
            height: 100px;
            background: #fff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 30px;
            border: 2px solid #EBF3FD;
            font-size: 50px;
        }

        .title {
            color: var(--text-main);
            font-size: 40px;
            font-weight: 800;
            margin-bottom: 16px;
        }

        .subtitle {
            color: var(--text-sub);
            font-size: 18px;
            font-weight: 400;
            line-height: 1.5;
        }

        /* 버튼 컨테이너 */
        .button-container {
            display: flex;
            gap: 40px;
            justify-content: center;
            width: 100%;
        }

        /* 메인 버튼 스타일 */
        .patient-button {
            flex: 1;
            max-width: 400px;
            background: #fff;
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 60px 40px;
            cursor: pointer;
            transition: all 0.2s ease-in-out;
            text-decoration: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
        }

        .patient-button:hover {
            transform: translateY(-5px);
            border-color: var(--primary-color);
            box-shadow: 0 10px 25px rgba(27, 102, 201, 0.15);
        }

        .patient-button:active {
            transform: scale(0.98);
        }

        /* 버튼 아이콘 */
        .button-icon {
            font-size: 60px;
            margin-bottom: 30px;
            display: block;
            background: #EBF3FD;
            width: 120px;
            height: 120px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
        }

        /* 버튼 텍스트 */
        .button-text {
            color: var(--text-main);
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .button-desc {
            color: var(--text-sub);
            font-size: 16px;
            font-weight: 400;
            line-height: 1.5;
        }

        /* 하단 정보 */
        .footer-info {
            margin-top: 80px;
            color: #999;
            font-size: 15px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .current-time {
            font-weight: 600;
            color: var(--primary-color);
            font-size: 18px;
        }

        /* 반응형 디자인 */
        @media (max-width: 1024px) {
            .kiosk-container {
                padding: 40px;
                min-height: auto;
            }

            .button-container {
                flex-direction: column;
                align-items: center;
                gap: 20px;
            }

            .patient-button {
                width: 100%;
                padding: 40px;
                flex-direction: row;
                text-align: left;
                gap: 20px;
            }

            .button-icon {
                margin-bottom: 0;
                width: 80px;
                height: 80px;
                font-size: 40px;
            }

            .button-text {
                margin-bottom: 5px;
            }
        }

        /* 로딩 화면 */
        .loading {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.8);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
            font-weight: 600;
            font-size: 18px;
        }
    </style>
</head>

<body>
    <!-- 키오스크 메인 화면 -->
    <div class="kiosk-container">
        <div class="header">
            <h1 class="title">병원 접수</h1>
            <p class="subtitle">환자 유형을 선택해 주세요</p>
        </div>

        <div class="button-container">
            <a href="javascript:void(0);" class="patient-button" onclick="handleSelection('new')">
                <span class="button-icon">
                    <!-- SVG Icon for New Patient -->
                    <svg width="40" height="40" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path
                            d="M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z"
                            fill="#1B66C9" />
                    </svg>
                </span>
                <div>
                    <div class="button-text">신규 환자</div>
                    <div class="button-desc">처음 방문하셨나요?</div>
                </div>
            </a>

            <a href="javascript:void(0);" class="patient-button" onclick="handleSelection('existing')">
                <span class="button-icon">
                    <!-- SVG Icon for Existing Patient -->
                    <svg width="40" height="40" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path
                            d="M19 3H5C3.89 3 3 3.9 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM12 17L7 12L8.41 10.59L12 14.17L17.59 8.59L19 10L12 17Z"
                            fill="#1B66C9" />
                    </svg>
                </span>
                <div>
                    <div class="button-text">기존 환자</div>
                    <div class="button-desc">다시 방문하셨나요?</div>
                </div>
            </a>
        </div>

        <div class="footer-info">
            <div class="current-time" id="currentTime"></div>
            <div>안내데스크 문의</div>
        </div>
    </div>

    <!-- 로딩 화면 -->
    <div class="loading" id="loadingScreen" style="display:none; flex-direction:column;">
        <div style="margin-bottom:10px;">이동 중...</div>
    </div>

    <script>
        function updateTime() {
            const now = new Date();
            const timeString = now.toLocaleString('ko-KR', {
                hour: '2-digit', minute: '2-digit', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'
            });
            document.getElementById('currentTime').textContent = timeString;
        }
        updateTime();
        setInterval(updateTime, 60000);

        function handleSelection(type) {
            const loading = document.getElementById('loadingScreen');
            loading.style.display = 'flex';

            setTimeout(() => {
                if (type === 'new') {
                    // alert('신규 - 신분증 지참');
                    window.location.href = '/kiosk/NewPatientIntro.do';
                } else {
                    // alert('기존 - 진료카드 지참');
                    window.location.href = '/kiosk/ExistPatientIntro.do';
                }
                loading.style.display = 'none';
            }, 500);
        }
    </script>
</body>

</html>