/* 共用基礎樣式 - 僅包含所有頁面都需要的基本樣式 */

/* 全域重置 - 所有頁面共用 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本字體設定 - 所有頁面共用 */
body {
    font-family: 'Microsoft JhengHei', 'Arial', sans-serif;
    line-height: 1.6;
}

/* 通用工具類 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* 通用間距類 */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* 通用顏色類 */
.text-primary { color: #4CAF50; }
.text-success { color: #4CAF50; }
.text-danger { color: #f44336; }
.text-warning { color: #ff9800; }
.text-muted { color: #666; }

/* 通用背景色類 */
.bg-primary { background-color: #4CAF50; }
.bg-success { background-color: #4CAF50; }
.bg-danger { background-color: #f44336; }
.bg-warning { background-color: #ff9800; }
.bg-light { background-color: #f8f9fa; }
.bg-white { background-color: #fff; }

/* 版本資訊樣式 */
.version-info {
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.5rem;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #e0e0e0;
}

/* PWA 安裝提示橫幅樣式 */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

.install-banner-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
}

.install-banner-icon {
    flex-shrink: 0;
}

.install-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.install-banner-text p {
    margin: 2px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.3;
}

.install-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.install-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.install-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.dismiss-btn {
    background: none;
    color: white;
    border: none;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.dismiss-btn:hover {
    background: rgba(255,255,255,0.2);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* iOS 安裝指引樣式 */
.ios-install-guide {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ios-install-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 320px;
    text-align: center;
    position: relative;
}

.ios-install-content h3 {
    color: #4CAF50;
    margin-bottom: 16px;
    font-size: 18px;
}

.ios-install-steps {
    text-align: left;
    margin: 16px 0;
}

.ios-install-steps li {
    margin: 8px 0;
    padding-left: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.ios-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ios-close-btn:hover {
    background: #f0f0f0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .login-box {
        padding: 1rem;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .logout-btn {
        margin-top: 1rem;
        width: 100%;
    }
    
    .version-info {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
    
    /* 手機版安裝橫幅樣式 */
    .install-banner {
        padding: 10px 12px;
    }
    
    .install-banner-content {
        gap: 8px;
    }
    
    .install-icon {
        width: 32px;
        height: 32px;
    }
    
    .install-banner-text h3 {
        font-size: 14px;
    }
    
    .install-banner-text p {
        font-size: 12px;
        display: none; /* 手機版隱藏描述文字 */
    }
    
    .install-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .dismiss-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .ios-install-content {
        margin: 0 10px;
        padding: 20px;
    }
    
    .ios-install-steps li {
        font-size: 13px;
    }
}