/* 酒精濃度計算器自定義樣式 */

/* 平滑過渡動畫 */
* {
    transition: all 0.2s ease-in-out;
}

/* 自定義滾動條 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 導航活動狀態 */
.nav-btn.active,
.mobile-nav-btn.active {
    @apply text-primary-600 bg-primary-50;
}

/* 輸入框聚焦效果 */
input:focus,
textarea:focus,
select:focus {
    @apply ring-2 ring-primary-500 border-transparent;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

/* 按鈕hover效果 */
button {
    @apply transition-all duration-200;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* 卡片陰影效果 */
.shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.shadow-lg:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* 結果區域動畫 */
.result-fade-in {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表單驗證樣式 */
.input-error {
    @apply border-red-500 ring-2 ring-red-200;
}

.input-success {
    @apply border-green-500 ring-2 ring-green-200;
}

/* Loading 動畫 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast 通知動畫 */
#toast {
    animation: slideInRight 0.3s ease-out;
}

#toast.hiding {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 歷史記錄卡片 */
.history-card {
    @apply transition-all duration-200;
}

.history-card:hover {
    @apply shadow-md transform scale-105;
}

/* 響應式設計優化 */
@media (max-width: 640px) {
    .container {
        @apply px-2;
    }
    
    .grid {
        @apply gap-4;
    }
    
    .rounded-xl {
        @apply rounded-lg;
    }
    
    .p-6 {
        @apply p-4;
    }
    
    .text-xl {
        @apply text-lg;
    }
}

/* 深色模式支持（預留） */
@media (prefers-color-scheme: dark) {
    /* 未來可以添加深色模式樣式 */
}

/* 打印樣式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-white {
        box-shadow: none !important;
    }
}

/* 輔助功能改進 */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    @apply outline-none ring-2 ring-offset-2 ring-primary-500;
}

/* 高對比度模式支持 */
@media (prefers-contrast: high) {
    button {
        border: 2px solid currentColor;
    }
    
    .border {
        border-width: 2px;
    }
}

/* 動態效果偏好設置 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 特殊效果 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.glass-effect {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

/* 數字輸入特殊樣式 */
input[type="number"] {
    @apply font-mono;
}

/* 結果顯示特殊樣式 */
.result-value {
    @apply font-mono text-lg font-bold;
}

/* 單位標籤樣式 */
.unit-label {
    @apply text-xs text-gray-500 font-medium;
}

/* 公式顯示樣式 */
.formula {
    @apply font-mono text-sm bg-gray-100 px-2 py-1 rounded;
}

/* 標籤雲樣式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.tag-primary {
    @apply bg-primary-100 text-primary-800;
}

.tag-secondary {
    @apply bg-gray-100 text-gray-800;
}

/* 進度指示器 */
.progress-bar {
    @apply w-full bg-gray-200 rounded-full h-2;
}

.progress-fill {
    @apply bg-primary-600 h-2 rounded-full transition-all duration-300;
}

/* 工具提示樣式 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}