/* PilotWeb 全域樣式 */

/* 基本布局 - 確保頁腳始終在底部 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

footer {
    flex-shrink: 0;
}

/* 全域響應式設計調整 */

/* 表格響應式 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* 卡片樣式 */
.card {
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 通用間距調整 */
.mb-xs {
    margin-bottom: 0.5rem;
}

.mt-xs {
    margin-top: 0.5rem;
}

.py-xs {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* 文字溢出處理 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-break-all {
    word-break: break-all;
}

.text-break-word {
    word-break: break-word;
}

/* 表單元素通用樣式 */
.form-control {
    box-sizing: border-box;
}

/* 按鈕通用樣式 */
.btn {
    white-space: normal;
}

/* 響應式調整 */
@media (max-width: 768px) {
    /* 表格調整 */
    .table-responsive-sm {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    /* 按鈕在小螢幕上的樣式 */
    .btn-mobile-block {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
        text-align: center;
    }
    
    /* 小螢幕上的間距調整 */
    .container, .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* 小螢幕表單調整 */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* 文字在小螢幕上的調整 */
    h1, .h1 {
        font-size: 1.8rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.3rem;
    }
    
    /* 小螢幕上的卡片調整 */
    .card-body {
        padding: 0.75rem;
    }
    
    /* 隱藏某些元素 */
    .d-sm-none {
        display: none !important;
    }
    
    /* 縮小間距 */
    .py-sm-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* 文字處理 */
    .text-sm-center {
        text-align: center !important;
    }
    
    /* 避免內容溢出 */
    img, svg, video, canvas, audio, iframe, embed, object {
        max-width: 100%;
        height: auto;
    }
}

/* 特小螢幕調整 (手機) */
@media (max-width: 576px) {
    /* 進一步縮小間距 */
    .card-body {
        padding: 0.5rem;
    }
    
    /* 調整文字大小 */
    body {
        font-size: 0.9rem;
    }
    
    /* 表格調整 */
    table {
        font-size: 0.85rem;
    }
    
    /* 列表項目調整 */
    .list-group-item {
        padding: 0.5rem 0.75rem;
    }
}

/* 自定義元件樣式 */

/* 搜尋表單樣式 */
.search-form {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

/* 資料卡片樣式 */
.data-card {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.data-card-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-card-body {
    padding: 1rem;
}

.data-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* 資料表格樣式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.data-table th {
    font-weight: 600;
    background-color: #f8f9fa;
}

/* 響應式調整 */
@media (max-width: 768px) {
    /* 搜尋表單在小螢幕上的調整 */
    .search-form .form-row {
        margin: 0 -5px;
    }
    
    .search-form .form-group {
        padding: 0 5px;
        margin-bottom: 0.75rem;
    }
    
    /* 資料卡片在小螢幕上的調整 */
    .data-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .data-card-header .actions {
        margin-top: 0.5rem;
        text-align: center;
    }
    
    /* 表格在小螢幕上的滾動容器 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 主要樣式表 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
}

main {
    flex: 1;
    padding: 20px 0;
}

.navbar-dark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 固定側邊欄樣式 */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background-color: #343a40;
    transition: left 0.3s ease;
    z-index: 1000;
    padding-top: 60px;
}

.sidebar.show {
    left: 0;
}

.sidebar .nav-link {
    color: #fff;
    padding: 10px 20px;
}

.sidebar .nav-link:hover {
    background-color: #495057;
    color: #fff;
}

/* 主內容區域 */
.content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
    padding: 20px;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .sidebar {
        left: -250px;
    }
    
    .content {
        margin-left: 0;
    }
}

/* ====== 美麗的首頁樣式和動畫效果 ====== */

/* 首頁專用背景 */
.homepage-background {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
    background-size: 400% 400% !important;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    width: 100%;
}

.homepage-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="1"/></g></svg>') repeat;
    animation: movePattern 20s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* 主要英雄區塊 */
.hero-section {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 8rem 0;
    color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 1s ease forwards, glow 3s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.1em;
}

@keyframes glow {
    0%, 100% { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.3); }
    50% { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 30px rgba(255,255,255,0.6), 0 0 40px rgba(255,255,255,0.4); }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease 0.3s forwards;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease 0.6s forwards;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

/* 動畫按鈕 */
.animated-btn {
    display: inline-block;
    padding: 15px 30px;
    margin: 10px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease 0.9s forwards;
}

.animated-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.animated-btn:hover::before {
    left: 100%;
}

.animated-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-primary-gradient {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-secondary-gradient {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.btn-outline-gradient {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.8);
    color: white;
}

.btn-outline-gradient:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
    color: white;
}

/* 功能卡片區塊 */
.features-section {
    padding: 4rem 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.feature-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 1s ease forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }
.feature-card:nth-child(4) { animation-delay: 0.8s; }

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.feature-description {
    color: #666;
    line-height: 1.6;
}

/* 統計數據區塊 */
.stats-section {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
    border-radius: 15px;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.5s;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* 浮動元素動畫 */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.floating-element {
    position: absolute;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}

.floating-element:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    font-size: 3rem;
}

.floating-element:nth-child(2) {
    top: 25%;
    right: 15%;
    animation-delay: 1s;
    font-size: 2.5rem;
}

.floating-element:nth-child(3) {
    bottom: 40%;
    left: 15%;
    animation-delay: 2s;
    font-size: 2.8rem;
}

.floating-element:nth-child(4) {
    top: 50%;
    right: 8%;
    animation-delay: 3s;
    font-size: 2.2rem;
}

.floating-element:nth-child(5) {
    bottom: 20%;
    right: 25%;
    animation-delay: 4s;
    font-size: 2.6rem;
}

.floating-element:nth-child(6) {
    top: 70%;
    left: 8%;
    animation-delay: 5s;
    font-size: 2.4rem;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1); 
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-30px) rotate(10deg) scale(1.1); 
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-15px) rotate(-5deg) scale(1); 
        opacity: 0.4;
    }
    75% { 
        transform: translateY(-25px) rotate(8deg) scale(1.05); 
        opacity: 0.5;
    }
}

/* 響應式設計調整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .animated-btn {
        padding: 12px 24px;
        font-size: 1rem;
        margin: 8px;
    }
    
    .floating-element {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .floating-element {
        font-size: 1.2rem !important;
    }
} 