/* ==========================================
   Virtual Try-On Plugin - Enhanced Styles v1.1.0
   黑色主題版 - 所有按鈕統一黑色 + 完美居中 + 手機優化
   ========================================== */

/* Google Fonts Import - Playfair Light 300 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,300;0,400;1,300;1,700&display=swap');

/* Font Awesome 備用載入 */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* ==========================================
   CSS 變數定義
   ========================================== */
:root {
    /* 品牌顏色 - 黑色系 */
    --vto-primary-black: #1a1a1a;
    --vto-primary-black-dark: #000000;
    --vto-hover-black: #333333;
    --vto-error-red: #f44336;
    --vto-error-bg: #ffebee;
    
    /* 字體 */
    --vto-font-family: 'Playfair Display', serif;
    --vto-font-weight-light: 300;
    --vto-font-weight-normal: 400;
    --vto-font-weight-bold: 700;
    
    /* 陰影 */
    --vto-shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --vto-shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.2);
    --vto-shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* 間距 */
    --vto-button-padding: 8px 20px;
    --vto-modal-padding: 30px;
    --vto-border-radius: 8px;
    --vto-border-radius-small: 4px;
    
    /* 動畫 */
    --vto-transition-fast: 0.2s ease;
    --vto-transition-normal: 0.3s ease;
    --vto-transition-slow: 0.5s ease;
}

/* 全局字體設定 */
* {
    font-family: var(--vto-font-family);
    font-weight: var(--vto-font-weight-light);
}

/* ==========================================
   按鈕樣式 - 統一黑色
   ========================================== */

/* 隱藏預設按鈕內的小圓形圖標 */
.vto-button-default-icon {
    display: none !important;
}

/* 完全自定義圖標按鈕 */
.vto-custom-button {
    max-width: 200px !important;
    max-height: 60px !important;
    width: auto !important;
    height: auto !important;
    cursor: pointer !important;
    transition: all var(--vto-transition-normal) !important;
    display: block !important;
    margin: 8px auto !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: var(--vto-shadow-light) !important;
}

.vto-custom-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--vto-shadow-medium) !important;
    opacity: 0.9 !important;
}

.vto-custom-button:active {
    transform: translateY(0) !important;
}

/* 預設按鈕樣式 - 黑色版 */
.vto-button,
.vto-default-button {
    background: linear-gradient(135deg, var(--vto-primary-black) 0%, var(--vto-primary-black-dark) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: var(--vto-button-padding) !important;
    border-radius: 0 !important;
    font-family: var(--vto-font-family) !important;
    font-weight: var(--vto-font-weight-light) !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all var(--vto-transition-fast) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    min-width: 100px !important;
    max-width: 200px !important;
    box-shadow: var(--vto-shadow-light) !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

.vto-button:hover,
.vto-default-button:hover {
    background: var(--vto-hover-black) !important;
    box-shadow: var(--vto-shadow-medium) !important;
    transform: translateY(-1px) !important;
}

.vto-button:active,
.vto-default-button:active {
    transform: translateY(0) !important;
    box-shadow: var(--vto-shadow-light) !important;
}

.vto-button-text {
    color: #ffffff !important;
    font-weight: var(--vto-font-weight-light) !important;
}

/* ==========================================
   Modal 彈出視窗樣式
   ========================================== */

.vto-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity var(--vto-transition-normal);
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.vto-modal-overlay.show {
    opacity: 1 !important;
}

.vto-modal {
    background: #ffffff !important;
    border-radius: var(--vto-border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative !important;
    padding: var(--vto-modal-padding);
    box-shadow: var(--vto-shadow-heavy);
    animation: slideIn 0.3s ease;
    box-sizing: border-box;
    z-index: 100000 !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 自定義滾動條樣式（Webkit 瀏覽器） */
.vto-modal::-webkit-scrollbar {
    width: 8px;
}

.vto-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.vto-modal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.vto-modal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox 滾動條樣式 */
.vto-modal {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Modal 關閉按鈕 - 絕對定位右上角 + 強制圓形 */
.vto-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    transition: color var(--vto-transition-fast);
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10;
    line-height: 1 !important;
    font-family: Arial, sans-serif !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
}

.vto-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.vto-modal-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    padding: 0;
}

.vto-modal-logo {
    max-height: 40px;
    width: auto;
    display: inline-block;
}

.vto-modal-title {
    font-size: 24px;
    color: #333;
    margin: 0;
    font-weight: var(--vto-font-weight-normal);
    text-align: center;
}

/* ==========================================
   表單樣式
   ========================================== */

.vto-form {
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.vto-form-group {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.vto-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: var(--vto-font-weight-normal);
}

.vto-form-group label i {
    font-size: 16px;
    color: var(--vto-primary-black);
}

.vto-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* 文件上傳區域 */
.vto-file-drop-area {
    border: 2px dashed #ddd;
    border-radius: var(--vto-border-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--vto-transition-normal);
    position: relative;
    background: #fafafa;
}

.vto-file-drop-area:hover,
.vto-file-drop-area.dragover {
    border-color: var(--vto-primary-black);
    background: #fff;
}

.vto-file-drop-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 10px;
    pointer-events: none;
}

.upload-content {
    pointer-events: none;
}

.upload-content p {
    color: #666;
    margin: 0;
    pointer-events: none;
}

/* 圖片預覽 */
.preview-content {
    position: relative;
}

.vto-image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--vto-border-radius-small);
    display: block;
    margin: 0 auto;
}

/* 移除圖片按鈕 - 強制圓形 */
.vto-remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    border-radius: 50% !important;
    background: var(--vto-error-red);
    color: white;
    border: 2px solid white;
    font-size: 18px;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: var(--vto-shadow-light);
    transition: all var(--vto-transition-fast);
    line-height: 1 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    font-family: Arial, sans-serif !important;
}

.vto-remove-image:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

/* 輸入框樣式 */
.vto-form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--vto-border-radius-small);
    font-size: 14px;
    transition: border-color var(--vto-transition-fast);
}

.vto-form-group input[type="number"]:focus {
    border-color: var(--vto-primary-black);
    outline: none;
}

/* 提交按鈕 - 黑色版 + 完全居中 */
.vto-submit-btn {
    width: 100% !important;
    max-width: 100% !important;
    background: linear-gradient(135deg, var(--vto-primary-black) 0%, var(--vto-primary-black-dark) 100%) !important;
    color: white !important;
    border: none !important;
    padding: 15px 0 !important;
    border-radius: var(--vto-border-radius-small) !important;
    font-size: 16px !important;
    font-weight: var(--vto-font-weight-normal) !important;
    cursor: pointer !important;
    transition: all var(--vto-transition-fast) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 20px 0 0 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.vto-submit-btn:hover:not(:disabled) {
    background: var(--vto-hover-black) !important;
    transform: translateY(-2px);
    box-shadow: var(--vto-shadow-medium);
}

.vto-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 隱藏提交按鈕圖標 */
.vto-submit-btn i {
    display: none !important;
}

/* 按鈕文字居中 */
.vto-submit-btn .btn-text {
    width: 100%;
    text-align: center;
    display: block;
}

/* ==========================================
   結果顯示區域
   ========================================== */

.vto-result {
    text-align: center;
    animation: fadeIn 0.5s ease;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.vto-result h3 {
    color: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.vto-success {
    color: #4caf50;
    font-size: 24px;
}

#vto-result-image {
    max-width: 100%;
    border-radius: var(--vto-border-radius);
    margin-bottom: 20px;
    box-shadow: var(--vto-shadow-medium);
    cursor: pointer;
    transition: transform var(--vto-transition-fast);
}

#vto-result-image:hover {
    transform: scale(1.02);
}

.vto-result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Download 按鈕 - 黑色版 */
.vto-download-btn {
    background: var(--vto-primary-black) !important;
    color: white !important;
    padding: 10px 20px;
    border-radius: var(--vto-border-radius-small);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all var(--vto-transition-fast);
    border: none;
    cursor: pointer;
}

.vto-download-btn:hover {
    background: var(--vto-hover-black) !important;
    transform: translateY(-2px);
}

/* Share 按鈕 - 黑色版 */
.vto-share-btn {
    background: var(--vto-primary-black) !important;
    color: white !important;
    padding: 10px 20px;
    border-radius: var(--vto-border-radius-small);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all var(--vto-transition-fast);
    border: none;
    cursor: pointer;
}

.vto-share-btn:hover {
    background: var(--vto-hover-black) !important;
    transform: translateY(-2px);
}

/* Buy Now 按鈕 - 黑色版 */
.vto-buy-btn {
    background: linear-gradient(135deg, var(--vto-primary-black) 0%, var(--vto-primary-black-dark) 100%) !important;
    color: white !important;
    padding: 10px 20px;
    border-radius: var(--vto-border-radius-small);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all var(--vto-transition-fast);
    border: none;
    cursor: pointer;
}

.vto-buy-btn:hover {
    background: var(--vto-hover-black) !important;
    transform: translateY(-2px);
}

/* ==========================================
   錯誤提示樣式
   ========================================== */

.vto-error {
    display: none;
    background: var(--vto-error-bg);
    border: 1px solid var(--vto-error-red);
    border-radius: var(--vto-border-radius-small);
    padding: 15px;
    margin-top: 15px;
    color: #c62828;
}

.vto-error.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    margin: 0;
    font-size: 14px;
}

/* 檔案格式錯誤提示 */
.vto-format-error {
    background: var(--vto-error-bg) !important;
    border: 1px solid var(--vto-error-red) !important;
    border-radius: var(--vto-border-radius-small) !important;
    padding: 12px !important;
    margin: 10px 0 !important;
    color: #c62828 !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    animation: slideDown 0.3s ease !important;
}

/* ==========================================
   Lightbox 燈箱樣式 - 最高層
   ========================================== */

.vto-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transition: opacity var(--vto-transition-normal) !important;
}

.vto-lightbox-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    min-height: 100vh !important;
}

.vto-lightbox-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: var(--vto-border-radius) !important;
    box-shadow: var(--vto-shadow-heavy) !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    transition: transform var(--vto-transition-fast) !important;
}

.vto-lightbox-image:active {
    cursor: grabbing !important;
}

/* Lightbox 關閉按鈕 - 最高層 + 強制圓形 */
.vto-lightbox-close-wrapper {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    z-index: 9999999 !important;
    pointer-events: auto !important;
}

.vto-lightbox-close {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: #333 !important;
    box-shadow: var(--vto-shadow-medium) !important;
    transition: all var(--vto-transition-fast) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    font-family: Arial, sans-serif !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.vto-lightbox-close:hover {
    background: rgba(255, 255, 255, 1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.vto-lightbox-instructions {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    color: white !important;
    font-size: 14px !important;
    opacity: 0.8 !important;
    text-align: center !important;
    pointer-events: none !important;
    z-index: 99998 !important;
}

/* ==========================================
   Block 相關樣式
   ========================================== */

.vto-product-image-container {
    position: relative;
    display: inline-block;
}

.vto-image-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: var(--vto-border-radius-small);
    font-size: 12px;
    font-weight: var(--vto-font-weight-bold);
    z-index: 2;
}

.vto-image-caption {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 8px;
}

/* ==========================================
   響應式設計 - 手機版完全優化
   ========================================== */

@media (max-width: 768px) {
    .vto-modal {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    
    .vto-modal-title {
        font-size: 20px;
    }
    
    .vto-file-drop-area {
        padding: 20px;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05) !important;
        position: relative !important;
    }
    
    .vto-file-drop-area input[type="file"] {
        pointer-events: auto !important;
        cursor: pointer !important;
        z-index: 100 !important;
        opacity: 0 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
    
    .vto-file-drop-area .upload-content,
    .vto-file-drop-area .upload-icon,
    .vto-file-drop-area .upload-content p {
        pointer-events: none !important;
    }
    
    .vto-file-drop-area:active {
        background: #f0f0f0 !important;
        border-color: var(--vto-primary-black) !important;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    /* 手機版按鈕垂直排列且100%寬度 */
    .vto-result-actions {
        flex-direction: column;
        gap: 10px;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .vto-download-btn,
    .vto-share-btn,
    .vto-buy-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 20px !important;
        margin: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .vto-download-btn i,
    .vto-share-btn i,
    .vto-buy-btn i {
        margin-right: 8px;
    }
    
    #vto-result-image {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .vto-result {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
    }
    
    /* 確保 Modal 內所有內容不超出 */
    .vto-modal * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .vto-form {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .vto-form-group {
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 15px !important;
    }
    
    /* 確保 Modal 在上層 */
    .vto-modal {
        z-index: 100000 !important;
        position: relative !important;
        background: #ffffff !important;
        opacity: 1 !important;
        isolation: isolate !important;
        transform: translate3d(0, 0, 0) !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        will-change: transform !important;
        pointer-events: auto !important;
    }
    
    .vto-modal * {
        pointer-events: auto !important;
    }
    
    .vto-modal-header {
        position: relative !important;
        z-index: 10 !important;
        background: #ffffff !important;
        pointer-events: auto !important;
    }
    
    .vto-close {
        z-index: 100001 !important;
        position: absolute !important;
        background: rgba(255, 255, 255, 0.95) !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }
    
    .vto-form-group input[type="number"] {
        pointer-events: auto !important;
        cursor: text !important;
        -webkit-user-select: text !important;
        user-select: text !important;
    }
    
    .vto-submit-btn {
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    }
    
    .vto-remove-image {
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(255, 0, 0, 0.2) !important;
    }
    
    .vto-lightbox-close-wrapper {
        top: 15px !important;
        right: 15px !important;
    }
    
    .vto-lightbox-close {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        font-size: 22px !important;
    }
    
    .vto-lightbox-instructions {
        bottom: 30px !important;
        font-size: 13px !important;
        padding: 0 20px !important;
    }
    
    .vto-lightbox-container {
        padding: 15px !important;
    }
    
    .vto-image-overlay {
        font-size: 11px;
        padding: 3px 6px;
        top: 8px;
        left: 8px;
    }
    
    .vto-image-caption {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .vto-modal {
        padding: 15px;
        width: 95%;
    }
    
    .vto-close {
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    .vto-download-btn,
    .vto-share-btn,
    .vto-buy-btn {
        font-size: 14px !important;
        padding: 10px 15px !important;
    }
    
    .vto-lightbox-close {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        max-width: 50px !important;
        max-height: 50px !important;
        font-size: 24px !important;
    }
}

/* Android Chrome 特定修正 */
@supports (-webkit-touch-callout: none) {
    .vto-modal {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .vto-file-drop-area {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* iOS Safari 特定修正 */
@supports (-webkit-touch-callout: inherit) {
    .vto-file-drop-area input[type="file"] {
        -webkit-appearance: none;
    }
}

/* ==========================================
   列印樣式
   ========================================== */

@media print {
    .vto-modal-overlay,
    .vto-lightbox {
        display: none !important;
    }
}

/* ==========================================
   高對比度模式支援
   ========================================== */

@media (prefers-contrast: high) {
    .vto-button,
    .vto-default-button {
        border: 2px solid #000 !important;
    }
    
    .vto-file-drop-area {
        border-width: 3px;
    }
}

/* ==========================================
   深色模式支援（實驗性）
   ========================================== */

@media (prefers-color-scheme: dark) {
    .vto-modal {
        background: #2c2c2c;
        color: #e0e0e0;
    }
    
    .vto-modal-title {
        color: #e0e0e0;
    }
    
    .vto-form-group label {
        color: #e0e0e0;
    }
    
    .vto-file-drop-area {
        background: #1a1a1a;
        border-color: #444;
    }
    
    .vto-form-group input[type="number"] {
        background: #1a1a1a;
        border-color: #444;
        color: #e0e0e0;
    }
}

/* ==========================================
   載入動畫
   ========================================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* ==========================================
   無障礙輔助
   ========================================== */

.vto-button:focus,
.vto-submit-btn:focus,
.vto-close:focus,
.vto-lightbox-close:focus {
    outline: 2px solid var(--vto-primary-black);
    outline-offset: 2px;
}

/* 為螢幕閱讀器隱藏但保留在 DOM 中 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================
   性能優化
   ========================================== */

.vto-modal,
.vto-lightbox {
    contain: layout style paint;
    will-change: opacity;
}

.vto-lightbox-image {
    will-change: transform;
}

/* ==========================================
   瀏覽器兼容性修正
   ========================================== */

/* Safari 修正 */
@supports (-webkit-appearance: none) {
    .vto-file-drop-area {
        -webkit-appearance: none;
    }
}

/* Firefox 修正 */
@-moz-document url-prefix() {
    .vto-button,
    .vto-default-button {
        -moz-appearance: none;
    }
}