/* 欣聯算力 - 共用樣式檔案 */

/* CSS 變數定義 - 深色主題 */
:root {
    --bs-primary: #00bfff;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-body-bg: #0a192f;
    --bs-body-color: #ffffff;
    --bs-dark-secondary: #1a2332;
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-text-muted: rgba(255, 255, 255, 0.6);
    
    /* 自定義顏色 */
    --primary-gradient: linear-gradient(135deg, #00bfff 0%, #0080ff 100%);
    --dark-gradient: linear-gradient(135deg, #0a192f 0%, #1a2332 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    
    /* 陰影效果 */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    
    /* 轉場效果 */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* 全域設定 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 通用區塊樣式 */
section {
    padding: 6rem 0;
    position: relative;
}

.bg-dark-secondary {
    background: var(--bs-dark-secondary) !important;
}

.py-6 {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
}

/* 導覽列樣式 */
.navbar {
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1030;
    background: rgba(10, 25, 47, 0.1) !important;
    min-height: 70px;
    padding: 0.5rem 0;
}

.navbar-scrolled {
    background: rgba(10, 25, 47, 0.95) !important;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-primary) !important;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
    max-width: 150px !important;
    object-fit: contain;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: var(--transition-fast);
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 0.375rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--bs-primary) !important;
    background: rgba(0, 191, 255, 0.15);
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.6);
}

/* 按鈕樣式 */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    transition: var(--transition-base);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #0080ff 0%, #0060cc 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: #ffffff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background: rgba(0, 191, 255, 0.1);
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.2);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 191, 255, 0.4);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* 卡片樣式 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 191, 255, 0.3);
}

.card-body {
    padding: 2rem;
}

/* 文字顏色工具類 */
.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.text-primary {
    color: var(--bs-primary) !important;
}

/* 標題樣式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

.display-3 {
    font-size: calc(1.525rem + 3.3vw);
    font-weight: 700;
}

.display-5 {
    font-size: calc(1.425rem + 2.1vw);
    font-weight: 700;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
}

/* 圖片樣式 */
img:not(.navbar-brand img) {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    border-radius: 0.75rem;
}

/* 表單樣式 */
.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 191, 255, 0.25);
    color: #ffffff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.invalid-feedback {
    color: var(--bs-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-control.is-invalid {
    border-color: var(--bs-danger);
}

/* 列表樣式 */
.list-unstyled li {
    margin-bottom: 0.5rem;
}

/* 響應式設計 */
@media (max-width: 768px) {
    section {
        padding: 4rem 0;
    }
    
    .py-6 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
    }
    
    .navbar-brand img {
        height: 35px !important;
        max-width: 120px !important;
    }
}

@media (max-width: 576px) {
    section {
        padding: 3rem 0;
    }
    
    .py-6 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0080ff;
}

/* 選取文字樣式 */
::selection {
    background: var(--bs-primary);
    color: #ffffff;
}

::-moz-selection {
    background: var(--bs-primary);
    color: #ffffff;
}

/* 焦點樣式 */
:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* 載入動畫 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 工具提示樣式 */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background: var(--bs-dark);
    color: #ffffff;
    border-radius: 0.375rem;
}

/* 無障礙設計 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
