/**
 * styles.css
 * 台灣長照居家服務量表計算器樣式表
 */

/* 全局樣式 */
body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 導航欄 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.4rem;
}

/* 卡片樣式 */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    font-weight: bold;
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

/* 量表選擇 */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item.active, 
.list-group-item.active:hover {
    background-color: #007bff;
    border-color: #007bff;
}

.list-group-item:hover {
    background-color: #f1f8ff;
}

/* 量表項目 */
.scale-item {
    transition: all 0.3s;
    margin-bottom: 1.5rem !important;
}

.scale-item:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.scale-item .card-header h5 {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-check-label {
    cursor: pointer;
    padding-left: 0.25rem;
}

/* 按鈕 */
.btn {
    border-radius: 0.25rem;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:active:after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(30, 30);
        opacity: 0;
    }
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 123, 255, 0.2);
}

.btn-primary:disabled {
    background-color: #83b9ff;
    border-color: #83b9ff;
    box-shadow: none;
    cursor: not-allowed;
}

/* 表單項目改進 */
.form-check {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    margin-bottom: 0.5rem;
}

.form-check:hover {
    background-color: rgba(0, 123, 255, 0.08);
}

.form-check-input {
    cursor: pointer;
    margin-right: 0.5rem;
}

.form-check-input:checked + .form-check-label {
    font-weight: bold;
    color: #0056b3;
}

.form-check-label {
    padding-left: 0.5rem;
    line-height: 1.5;
}

/* 結果區域 */
#result-container {
    transition: all 0.5s ease;
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 150, 136, 0.2);
}

#result-container.d-none {
    opacity: 0;
    transform: translateY(-20px);
}

#result-container .card-header {
    background-color: #009688 !important;
}

#result-score {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
}

#result-level {
    color: #d32f2f;
    font-size: 1.2rem;
    text-decoration: underline;
}

.alert {
    border-radius: 0.25rem;
}

/* 載入提示 */
#loading-message, #error-message {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

/* 列印相關 */
@media print {
    body {
        padding: 0;
        margin: 0;
    }
    
    .scale-item {
        page-break-inside: avoid;
    }
    
    #result-container {
        page-break-before: always;
    }
}

/* 響應式設計 */
@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    #result-container {
        margin-top: 2rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }
}

/* 頁尾改進 */
footer {
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: #83b9ff !important;
    text-decoration: none;
}

footer .contact-engineer {
    font-style: italic;
    color: #83b9ff;
}

/* 載入動畫 */
.fa-spin {
    animation-duration: 0.8s;
}

/* 提高量表項目可讀性 */
.scale-item {
    margin-bottom: 1.5rem !important;
}

.scale-item .card-header h5 {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
} 