/* 駿盛科技官方網站樣式 */
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* 全域樣式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* 確保頁面內容占滿整個寬度 */
.page {
    width: 100% !important;
    max-width: 100% !important;
}

.main-content {
    width: 100% !important;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: #0a58ca;
}

/* 核心服務區塊主題底色 */
.service-section-bg {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

/* 卡片半透明白色底色 */
.service-card-bg {
    background: rgba(255,255,255,0.92) !important;
}

/* 卡片文字顏色優化 */
.service-card-bg .card-title {
    color: #212529 !important;
}
.service-card-bg .card-text {
    color: #6c757d !important;
}

/* Hero 區塊樣式 */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    position: relative;
    overflow: hidden;
    min-height: 520px;
    display: flex;
    align-items: center;
}

.hero-image {
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.3));
    animation: float 6s ease-in-out infinite;
    max-width: 420px;
    width: 100%;
    height: auto;
    min-width: 220px;
    background: #f8f9fa;
}

.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@media (max-width: 991.98px) {
    .hero-section .display-4 {
        font-size: 2.2rem;
    }
    .hero-image {
        max-width: 320px;
        min-width: 120px;
    }
}

/* 後台管理系統樣式 */
.admin-dashboard {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.admin-sidebar {
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.admin-sidebar .nav-link {
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.admin-sidebar .nav-link.active {
    background-color: #007bff;
    color: #fff;
}

.border-left-primary {
    border-left: .25rem solid #007bff !important;
}

.border-left-success {
    border-left: .25rem solid #28a745 !important;
}

.border-left-info {
    border-left: .25rem solid #17a2b8 !important;
}

.border-left-warning {
    border-left: .25rem solid #ffc107 !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-xs {
    font-size: .75rem;
}

/* 選單管理器樣式 */
.menu-item {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.35rem;
    margin-bottom: 0.5rem;
    cursor: move;
    transition: all 0.3s ease;
}

.menu-item:hover {
    border-color: #5a5c69;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.menu-item-content {
    padding: 1rem;
}

.submenu-item {
    background: #f8f9fc;
    border-left: 3px solid #5a5c69;
}

.has-children {
    border-left: 4px solid #1cc88a;
}

.sortable-menu {
    min-height: 400px;
}

.menu-actions .btn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-item:hover .menu-actions .btn {
    opacity: 1;
}

/* 頁面編輯器樣式 */
.component-item {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.35rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    cursor: grab;
    transition: all 0.3s ease;
}

.component-item:hover {
    border-color: #5a5c69;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transform: translateY(-2px);
}

.component-item:active {
    cursor: grabbing;
}

.component-preview {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.component-preview i {
    margin-right: 0.5rem;
}

.page-builder-canvas {
    min-height: 600px;
    background: #f8f9fa;
    position: relative;
}

.page-section {
    position: relative;
    margin-bottom: 1rem;
}

.page-section:hover .section-controls {
    opacity: 1;
}

.section-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.section-controls .btn {
    margin-left: 0.25rem;
}

.drop-zone {
    min-height: 100px;
    border: 2px dashed #e3e6f0;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #1cc88a;
    background-color: rgba(28, 200, 138, 0.1);
}

.drop-zone-placeholder {
    text-align: center;
}

.hero-preview,
.services-preview {
    position: relative;
}

.property-form {
    border-top: 1px solid #e3e6f0;
    padding-top: 1rem;
}

/* 使用者管理樣式 */
.avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
}

.avatar-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    font-weight: bold;
}

/* 按鈕樣式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
}

.btn-success {
    color: #fff;
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
}

.btn-warning {
    color: var(--dark-color);
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffca2c 100%);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--primary-color);
}

.btn-outline-light {
    color: #fff;
    border: 2px solid #fff;
    background: transparent;
}

.btn-outline-light:hover {
    color: var(--dark-color);
    background: #fff;
}

/* 導航列樣式 */
.navbar {
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--warning-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%) !important;
    padding: 0;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}
/* 讓 service-menu-item 與 dropdown-menu 完全協調，無留白 */
.service-menu-item {
    background: transparent !important;
    color: #fff !important;
    font-weight: 500;
    border-radius: 0;
    margin: 0;
    padding: 0.75rem 1.5rem;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.service-menu-item:last-child {
    border-bottom: none;
}
.service-menu-item:hover, .service-menu-item:focus, .service-menu-item.active {
    background: linear-gradient(135deg, #0a58ca 0%, var(--primary-color) 100%) !important;
    color: var(--warning-color) !important;
    box-shadow: 0 2px 8px rgba(13,110,253,0.12);
}

/* 卡片樣式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

/* 表單樣式 */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

/* 表單驗證樣式 */
.valid.modified:not([type=checkbox]) {
    border-color: var(--success-color);
}

.invalid {
    border-color: var(--danger-color);
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 懸浮客服按鈕 */
.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    text-align: center;
}

.floating-chat-btn button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    color: white;
}

.floating-chat-btn button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
}

.chat-label {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 新懸浮聊天組件 */
.floating-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-chat-widget .chat-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.floating-chat-widget .chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    color: white;
    position: relative;
}

.floating-chat-widget .chat-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.4);
}

.floating-chat-widget .qr-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.floating-chat-widget .qr-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.floating-chat-widget .chat-label {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.floating-chat-widget.expanded {
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 500px;
}

.chat-window {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 15px;
    border-radius: 15px 15px 0 0;
}

.chat-header .header-buttons .btn {
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
}

.chat-header .header-buttons .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
}

.message.user-message {
    text-align: right;
}

.message.ai-message {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-message .message-content {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.ai-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

.welcome-message {
    text-align: center;
    color: #6c757d;
    padding: 30px 20px;
}

.welcome-message i {
    font-size: 2rem;
    color: #007bff;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-input .input-group .form-control {
    border-radius: 20px 0 0 20px;
    border: 1px solid #e9ecef;
    padding: 10px 15px;
}

.chat-input .input-group .btn {
    border-radius: 0 20px 20px 0;
    padding: 10px 15px;
}

.qr-popup {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    z-index: 1001;
}

.qr-popup.expanded {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    right: auto;
    margin: 0;
}

.qr-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    min-width: 200px;
}

.qr-content .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
}

.qr-content h6 {
    margin-bottom: 15px;
    color: #333;
}

/* 動畫效果 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* 載入動畫 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 背景漸層 */
.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%) !important;
}

/* 回應式設計 */
@media (max-width: 768px) {
    .floating-chat-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-chat-btn button {
        width: 50px;
        height: 50px;
    }
    
    .chat-label {
        font-size: 0.7rem;
    }
    
    /* 新懸浮聊天組件手機版 */
    .floating-chat-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-chat-widget.expanded {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        height: 450px;
    }
    
    .floating-chat-widget .chat-btn {
        width: 50px;
        height: 50px;
    }
    
    .floating-chat-widget .qr-btn {
        width: 35px;
        height: 35px;
    }
    
    .chat-window {
        border-radius: 10px;
    }
    
    .chat-header {
        padding: 12px;
        border-radius: 10px 10px 0 0;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .chat-input {
        padding: 10px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Blazor 錯誤 UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}
/* 優化核心服務選單色彩 */
.service-menu-item {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%) !important;
    color: #fff !important;
    font-weight: 500;
    border-radius: 6px;
    margin: 2px 0;
    transition: background 0.2s, color 0.2s;
}

.service-menu-item:hover, .service-menu-item:focus, .service-menu-item.active {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
