/*
Template Name: Velzon - Admin & Dashboard Template
Author: Themesbrand
Website: https://themesbrand.com/
Contact: support@themesbrand.com
File: Custom Css File
*/

/* =========================================
   登入頁面自定義樣式 (Login Page Styles)
========================================= */
/* 1. 背景圖片設定 */
.auth-one-bg-position {
    /* 重要修改：在 CSS 文件中不能使用 {% static %}。
       假設此 CSS 位於 static/css/，圖片位於 static/images/，
       則使用相對路徑 "../images/" 指向圖片。 */
    background-image: url("../images/auth-one-bg.jpg");
    background-position: center;
    background-size: cover;
    /* 確保背景圖層至少佔滿整個視窗高度 */
    min-height: 100vh;
}

/* 2. 內容垂直置中容器 */
.auth-page-content {
    position: relative;
    z-index: 2;
    /* 設定最小高度為視窗高度，確保有足夠空間置中 */
    min-height: 100vh;
    /* 使用 Flexbox */
    display: flex;
    /* 設定主軸為垂直方向 */
    flex-direction: column;
    /* 在主軸(垂直方向)上置中對齊 */
    justify-content: center;
    /* 給予上下一些緩衝空間，避免螢幕太矮時貼邊 */
    padding-top: 30px;
    padding-bottom: 30px;
}

/* 3. 主題顏色定義 */
/* 使用卡通圖片中的亮藍色作為主題色 */
:root {
    --dental-theme-color: #0ab39c; /* 類似卡通中的牙刷藍綠色 */
    --dental-theme-hover: #089d88;
}

/* 4. 輸入框樣式 */
.login-border {
     border-color: #e0e0e0;
}

.login-border:focus, .login-border:active {
     border-color: var(--dental-theme-color);
}

.login-icon i {
    color: var(--dental-theme-color);
}

/* 5. 按鈕樣式 */
.btn-dental-theme {
    background-color: var(--dental-theme-color);
    border-color: var(--dental-theme-color);
    color: white;
}

.btn-dental-theme:hover {
     background-color: var(--dental-theme-hover);
     border-color: var(--dental-theme-hover);
     color: white;
}

/* 6. 圖片樣式 */
.hospital-logo {
    max-height: 80px;
    width: auto;
}

/* 讓卡通圖片看起來更有趣的樣式 (保留備用) */
.cartoon-header-img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

/* 7. 卡片樣式 */
/* 調整卡片樣式使其更柔和 */
.login-card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: none;
    /* 移除 margin-top，因為現在是靠 flex 置中 */
    margin-top: 0 !important;
}

/* 8. 頁尾文字樣式 (替代原有的行內樣式) */
.auth-footer-text {
    color: var(--dental-theme-color) !important;
}

/* 9. 背景遮罩 (Overlay) 樣式 */
/* 使用 .auth-one-bg 限定範圍，確保只影響這個特定頁面的遮罩 */
.auth-one-bg .bg-overlay {
    background: linear-gradient(to right, #364574, #405189) !important;
    opacity: 0.7 !important;
}

/* 10. 形狀分隔線 (Shape Divider) 顏色 */
/* 設定 SVG 路徑的填滿顏色為白色，以銜接下方的內容區塊 */
.shape svg path {
    fill: #ffffff;
}


.login-logo {
    max-width: 90px; /* 限制寬度 */
    height: auto;
    margin: 0 auto;
}

/* 讓 input 與 button 無縫 */
.password-input-no-right-border {
  border-right: 0 !important;
}

/* 眼睛切換按鈕樣式 */
.password-addon-btn {
  border: 1px solid #C0B4AA;
  border-left: 0;
  background-color: #fff;
}

/* Spinner 預設隱藏 */
.spinner-hidden {
  display: none;
}

.btn-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* =========================================
   密碼輸入框組合樣式 (Password Input Group Styles)
========================================= */
/* 1. 移除輸入框的右邊框 */
.password-input-no-right-border {
    border-right: 0 !important;
    /* 移除輸入框聚焦時的預設陰影，改用邊框變色 */
    box-shadow: none !important;
}

/* 2. 移除按鈕的左邊框，並統一邊框顏色 */
.password-addon-no-left-border {
    border-left: 0 !important;
    border-color: #e0e0e0; /* 與 .login-border 預設顏色一致 */
    /* 移除按鈕聚焦時的預設外框 */
    box-shadow: none !important;
    outline: none !important;
}

/* 3. 處理聚焦狀態 (Focus State) 的連動 */

/* 當輸入框被聚焦時： */
.password-input-no-right-border:focus {
    /* 輸入框本身邊框變色 */
    border-color: var(--dental-theme-color) !important;
}
/* 且緊跟在它後面的按鈕邊框也要變色 */
.password-input-no-right-border:focus + .password-addon-no-left-border {
    border-color: var(--dental-theme-color) !important;
    /* 確保左邊框依然是 0，避免出現雙重邊框 */
    border-left: 0 !important;
}

/* 當按鈕被聚焦時 (例如使用者用 Tab 鍵切換到按鈕)： */
.password-addon-no-left-border:focus {
    /* 按鈕本身邊框變色 */
    border-color: var(--dental-theme-color) !important;
    background-color: #f8f9fa; /* 微調背景色，保持 btn-light 的感覺 */
}

/* 修正：Bootstrap 的 input-group 在聚焦時會產生一個 z-index 較高的浮動邊框，
   這會蓋住我們自定義的無邊框效果。我們需要調整 z-index 來解決。 */
.input-group .form-control:focus,
.input-group .btn:focus {
    z-index: 3; /* 確保聚焦的元素在最上層 */
}
/* 讓未聚焦的另一半稍微提高層級，確保邊框線條清晰 */
.password-input-no-right-border:not(:focus) + .password-addon-no-left-border:not(:focus) {
    z-index: 2;
}

/* =========================================
   表單設計器 (Form Builder) 自定義樣式
========================================= */
.focus-ring:focus {
    box-shadow: none;
    border-bottom: 2px solid var(--vz-primary) !important;
    border-radius: 0;
}

.q-card {
    transition: all 0.2s ease-in-out;
    border-left: 5px solid transparent;
    cursor: default;
}

.q-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1) !important;
}

.q-card.active {
    border-left-color: var(--vz-primary) !important;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

/* 懸浮選單定位 (Floating Menu) */
#floating-menu {
    z-index: 1060;
}

@media (min-width: 992px) {
    #floating-menu {
        position: fixed !important;
        top: 150px !important;
        /* 置中對齊邏輯：畫面中央往右偏移畫布寬度的一半 */
        left: 50%;
        margin-left: 395px; /* (770px / 2) + 10px spacing */
        right: auto !important;
    }
}

/* 滾動區域優化 */
.scroll-area {
    overflow-y: auto;
    height: 100%;
}

.q-input-text::placeholder {
    color: #adb5bd;
    font-weight: normal;
}

.draggable-opt:hover .opt-remove-btn {
    opacity: 1;
}

.opt-remove-btn {
    opacity: 0.3;
    transition: opacity 0.2s;
}

/* =========================================
   Builder V2 (Split View) Styles
========================================= */
.a4-paper {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    margin: 2rem auto;
    padding: 15mm; /* 標準邊距 */
    position: relative;
}

.builder-item {
    position: relative;
    border: 1px dashed transparent; /* 平常隱藏邊框 */
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.builder-item:hover {
    background-color: rgba(10, 179, 156, 0.05); /* --dental-theme-color with opacity */
    border-color: rgba(10, 179, 156, 0.2);
}

.builder-item.active {
    background-color: #fff;
    border: 1px solid var(--dental-theme-color);
    box-shadow: 0 4px 12px rgba(10, 179, 156, 0.15);
    z-index: 2; /* 浮起效果 */
}

/* 左側強調線 (Accent Line) */
.builder-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--dental-theme-color);
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

/* 讓 Canvas 內的輸入框在編輯模式下不觸發 focus */
.builder-item * {
    pointer-events: none;
}

/* Header 區塊特殊樣式 */
.builder-header {
    cursor: pointer;
    border: 1px dashed transparent;
    border-radius: 4px;
    transition: all 0.2s;
}
.builder-header:hover {
    background-color: rgba(10, 179, 156, 0.05);
}
.builder-header.active {
    border-color: var(--dental-theme-color);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 自定義 Scrollbar (Inspector) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}