﻿/* Custom CSS for Yihsheng Technology Website */

/* Color Variables */
:root {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --accent-color: #ffc107;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    padding-top: 76px; /* Account for fixed navbar */
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Navigation Styles */
.navbar {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

    .nav-link:hover {
        color: var(--primary-color) !important;
    }

    .nav-link.active {
        color: var(--primary-color) !important;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: var(--primary-color);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

/* 避免下拉選單顯示小黑點 */
.navbar-nav .dropdown-toggle::after {
    display: none !important;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* 取消空 href 導致的下方小點 */
.nav-link[href="#"]::after {
    display: none;
}

/* 滑鼠懸停展開下拉選單 */
@media (min-width: 992px) {
    .navbar-nav .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Hero Section */
.hero-section {
    background: url('../Images/factory_exterior.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.hero-section .lead {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-section p {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-section .d-flex {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 透明下拉選單背景 */
.transparent-dropdown {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 8px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

    .transparent-dropdown .dropdown-item {
        color: var(--text-color);
        padding: 0.5rem 1.5rem;
    }

        .transparent-dropdown .dropdown-item:hover {
            background-color: rgba(0, 123, 255, 0.1);
            color: var(--primary-color);
        }

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
}

    .scroll-to-top.show {
        opacity: 1;
        pointer-events: auto;
    }

/* 滑鼠懸停在 nav-pills 時，讓文字變白色 */
.nav-pills .nav-link:hover {
    color: #fff !important;
}

/* 確保 active 狀態下也文字白色 */
.nav-pills .nav-link.active {
    color: #fff !important;
}

/* nav-pills active 狀態：白字藍底 */
.nav-pills .nav-link.active {
    background-color: #0d6efd; /* Bootstrap primary 色 */
    color: #fff !important;
}

/* nav-pills 滑鼠懸停：白字藍底 */
.nav-pills .nav-link:hover {
    background-color: #0d6efd; /* Bootstrap primary 色 */
    color: #fff !important;
}

/* nav-pills hover 狀態：只改變沒被選中的按鈕 */
.nav-pills .nav-link:not(.active):hover {
    background-color: #e9f2ff; /* 淡藍底 */
    color: #0d6efd !important; /* 藍字 */
}
