/* 基本重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'Arial', 'Helvetica Neue', sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 語言選擇器 */
.language-selector {
    text-align: right;
    margin-bottom: 20px;
    position: relative;
}

.language-selector select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 14px 45px 14px 20px;
    border: 3px solid #4CAF50;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    animation: glow-pulse 3s ease-in-out infinite;
    color: #2c3e50;
    min-width: 180px;
}

/* 自定義下拉箭頭 */
.language-selector::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: #4CAF50;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
    border-color: #45a049;
}

.language-selector:hover::after {
    color: #45a049;
    transform: translateY(-50%) scale(1.2);
}

.language-selector select:focus {
    outline: none;
    border-color: #45a049;
    animation: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.language-selector select option {
    padding: 15px 20px;
    font-size: 16px;
    background-color: #ffffff !important;
    color: #2c3e50 !important;
    font-weight: 500;
    line-height: 2;
}

.language-selector select option:checked {
    background-color: #4CAF50 !important;
    color: white !important;
    font-weight: 600;
}

/* 語言選擇器脈動光暈動畫 */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6), 0 0 30px rgba(76, 175, 80, 0.3);
    }
}


/* 標題 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* 表單部分 */
.form-section {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-section h2 {
    color: #34495e;
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 16px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 說明部分 */
.instructions {
    background-color: #f0f8ff;
    padding: 30px;
    border-radius: 8px;
    border-left: 5px solid #4CAF50;
}

.instructions h2 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 15px;
}

.instructions p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

/* HR 聯絡資訊樣式 */
.hr-contact-info {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    border: 2px solid #4CAF50;
    font-size: 15px;
    line-height: 1.8;
    color: #2c3e50;
}

.hr-contact-info strong {
    color: #2d5016;
    font-size: 16px;
}

/* 按鈕樣式 */
button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin-top: 15px;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

button:disabled:hover {
    background-color: #cccccc;
    box-shadow: none;
}

#startBtn,
#continueBtn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
}

/* 進度條 */
.progress-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
    border-radius: 15px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

/* 部份標題 */
.part-title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #e8f5e9;
    border-radius: 8px;
}

/* 問題容器 */
.question-container {
    background-color: #fafafa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 25px;
    min-height: 250px;
}

.question-number {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 20px;
    text-align: center;
}

/* 選項樣式 */
.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.option:hover {
    border-color: #4CAF50;
    background-color: #f0f8ff;
    transform: translateX(5px);
}

.option.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.option input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.option-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    flex: 1;
}

/* 導航按鈕 */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.navigation-buttons button {
    flex: 1;
    margin-top: 0;
}

/* 完成訊息 */
.completion-message {
    text-align: center;
    padding: 50px 30px;
    background-color: #e8f5e9;
    border-radius: 8px;
}

.completion-message h2 {
    color: #4CAF50;
    font-size: 28px;
    margin-bottom: 15px;
}

.completion-message p {
    font-size: 18px;
    color: #555;
}

/* 響應式設計 - 手機模式 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 5px;
    }

    .header h1 {
        font-size: 22px;
    }

    .form-section {
        padding: 20px;
    }

    .form-section h2 {
        font-size: 20px;
    }

    .form-group label {
        font-size: 14px;
    }

    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="date"] {
        padding: 10px;
        font-size: 14px;
    }

    .instructions {
        padding: 20px;
    }

    .instructions h2 {
        font-size: 20px;
    }

    .instructions p {
        font-size: 14px;
    }

    button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .part-title {
        font-size: 20px;
        padding: 12px;
    }

    .question-container {
        padding: 20px;
        min-height: 200px;
    }

    .question-number {
        font-size: 18px;
    }

    .option {
        padding: 15px;
    }

    .option-text {
        font-size: 14px;
    }

    .option input[type="radio"] {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .navigation-buttons button {
        width: 100%;
    }

    .language-selector select {
        padding: 10px 16px;
        font-size: 14px;
    }

    .progress-text {
        font-size: 12px;
    }

    .completion-message {
        padding: 40px 20px;
    }

    .completion-message h2 {
        font-size: 24px;
    }

    .completion-message p {
        font-size: 16px;
    }
}

/* 響應式設計 - 超小螢幕 */
@media screen and (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 20px;
    }

    .form-section h2,
    .instructions h2 {
        font-size: 18px;
    }

    .option {
        padding: 12px;
    }

    .option-text {
        font-size: 13px;
    }

    button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 響應式設計 - 大螢幕 */
@media screen and (min-width: 1200px) {
    .container {
        max-width: 900px;
    }

    .header h1 {
        font-size: 32px;
    }

    .form-section h2,
    .instructions h2 {
        font-size: 24px;
    }

    .part-title {
        font-size: 26px;
    }

    .option-text {
        font-size: 17px;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-container {
    animation: fadeIn 0.3s ease;
}

/* 紅色閃爍動畫 - 提示未選擇 */
@keyframes flashRed {
    0%, 100% {
        border-color: #ddd;
        background-color: white;
    }
    25%, 75% {
        border-color: #dc3545;
        background-color: #ffe0e0;
    }
    50% {
        border-color: #ff0000;
        background-color: #ffcccc;
    }
}

.option.flash-error {
    animation: flashRed 1s ease-in-out;
}

/* 錯誤提示訊息 */
.error-message {
    background-color: #ffe0e0;
    border: 2px solid #dc3545;
    color: #dc3545;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    animation: fadeIn 0.3s ease;
}

/* 打印樣式 */
@media print {
    body {
        background-color: white;
    }

    .container {
        box-shadow: none;
    }

    .language-selector,
    .navigation-buttons,
    button {
        display: none;
    }

    .progress-bar {
        display: none;
    }
}
