/**
 * UD度假體驗 - Cookie隱私通知組件
 * 參考凱渡廣場酒店風格設計
 */

/* Cookie通知主容器 */
.privacy-notice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.privacy-notice-overlay.show {
    display: flex;
    align-items: flex-end;
    opacity: 1;
}

/* Cookie通知彈窗 */
.privacy-notice-popup {
    background: #fff;
    width: 100%;
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.privacy-notice-overlay.show .privacy-notice-popup {
    transform: translateY(0);
}

/* 標題區域 */
.privacy-notice-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.privacy-notice-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ud-primary), var(--ud-primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: #fff;
    font-size: 1.2rem;
}

.privacy-notice-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ud-dark);
    margin: 0;
}

.privacy-notice-subtitle {
    font-size: 0.9rem;
    color: var(--ud-secondary);
    margin: 0.5rem 0 0 0;
}

/* 內容區域 */
.privacy-notice-content {
    margin-bottom: 2rem;
}

.privacy-notice-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--ud-secondary);
    margin-bottom: 1.5rem;
}

.privacy-notice-highlight {
    background: var(--ud-bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--ud-primary);
    margin: 1rem 0;
}

.privacy-notice-highlight p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ud-dark);
}

/* Cookie類型說明 */
.cookie-types {
    margin: 1.5rem 0;
}

.cookie-type-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.cookie-type-item:last-child {
    margin-bottom: 0;
}

.cookie-type-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ud-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-right: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.cookie-type-content h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ud-dark);
    margin: 0 0 0.3rem 0;
}

.cookie-type-content p {
    font-size: 0.85rem;
    color: var(--ud-secondary);
    margin: 0;
    line-height: 1.4;
}

/* 按鈕區域 */
.privacy-notice-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.privacy-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.privacy-btn-primary {
    background: linear-gradient(135deg, var(--ud-primary), var(--ud-primary-dark));
    color: #fff;
}

.privacy-btn-primary:hover {
    background: linear-gradient(135deg, var(--ud-primary-dark), var(--ud-primary));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--ud-primary-rgb), 0.3);
}

.privacy-btn-secondary {
    background: #fff;
    color: var(--ud-secondary);
    border: 2px solid #e0e0e0;
}

.privacy-btn-secondary:hover {
    background: #f8f9fa;
    border-color: var(--ud-primary);
    color: var(--ud-primary);
}

.privacy-btn-outline {
    background: transparent;
    color: var(--ud-primary);
    border: 2px solid var(--ud-primary);
}

.privacy-btn-outline:hover {
    background: var(--ud-primary);
    color: #fff;
}

/* 隱私設定中心 */
.privacy-center-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 10001 !important;
    display: none !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    overflow: auto !important;
}

.privacy-center-overlay.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
}

.privacy-center-modal {
    background: #fff !important;
    width: 100% !important;
    max-width: 700px !important;
    max-height: 90vh !important;
    border-radius: 1rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    transform: scale(0.9) !important;
    transition: transform 0.3s ease !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    margin: auto !important;
}

.privacy-center-overlay.show .privacy-center-modal {
    transform: scale(1) !important;
}

.privacy-center-header {
    padding: 1.5rem 2rem !important;
    border-bottom: 1px solid #eee !important;
    background: var(--ud-bg-light) !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.privacy-center-header h3 {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: var(--ud-dark) !important;
    margin: 0 !important;
    padding-right: 3rem !important;
}

.privacy-center-close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: var(--ud-secondary) !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    z-index: 1 !important;
}

.privacy-center-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ud-dark);
}

.privacy-center-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.privacy-setting-group {
    margin-bottom: 2rem;
}

.privacy-setting-group:last-child {
    margin-bottom: 0;
}

.privacy-setting-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ud-dark);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.privacy-setting-description {
    font-size: 0.9rem;
    color: var(--ud-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.privacy-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.privacy-toggle-info h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ud-dark);
    margin: 0 0 0.3rem 0;
}

.privacy-toggle-info p {
    font-size: 0.85rem;
    color: var(--ud-secondary);
    margin: 0;
    line-height: 1.4;
}

/* 切換開關 - 強化樣式優先級 */
.privacy-switch {
    position: relative !important;
    width: 50px !important;
    height: 28px !important;
    background: #dcdcdc !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: 1px solid #bbb !important;
    display: inline-block !important;
    vertical-align: middle !important;
    min-width: 50px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.privacy-switch.active {
    background: #28a745 !important;
    border-color: #28a745 !important;
}

.privacy-switch.disabled {
    background: #f5f5f5 !important;
    border-color: #e0e0e0 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.privacy-switch-handle {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 24px !important;
    height: 24px !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.privacy-switch.active .privacy-switch-handle {
    transform: translateX(22px) !important;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3) !important;
}

.privacy-switch:hover:not(.disabled) {
    border-color: #999 !important;
}

.privacy-switch:hover:not(.disabled) .privacy-switch-handle {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25) !important;
}

.privacy-switch.disabled .privacy-switch-handle {
    background: #f0f0f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* 確保開關容器樣式 */
.privacy-toggle {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    padding: 1.2rem !important;
    background: #f8f9fa !important;
    border-radius: 0.5rem !important;
    margin-bottom: 0.8rem !important;
    min-height: 80px !important;
    gap: 1rem !important;
}

.privacy-toggle-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.privacy-toggle .privacy-switch {
    flex-shrink: 0 !important;
    margin-top: 0.5rem !important;
}

/* 開關除錯樣式 */
.privacy-switch-debug {
    border: 2px solid red !important;
    background: yellow !important;
}

/* 手動加入測試開關 */
.test-switch {
    position: relative;
    width: 50px;
    height: 28px;
    background: #dcdcdc;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #bbb;
    display: inline-block;
    vertical-align: middle;
    margin: 10px;
}

.test-switch.active {
    background: #28a745;
    border-color: #28a745;
}

.test-switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.test-switch.active .test-switch-handle {
    transform: translateX(22px);
}

.privacy-center-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 簡化版通知條 - 半透明懸浮設計 */
.privacy-notice-bar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateY(120%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 900px;
    margin: 0 auto;
}

.privacy-notice-bar.show {
    transform: translateY(0);
}

.privacy-notice-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.privacy-notice-bar-text {
    font-size: 0.9rem;
    color: var(--ud-dark);
    flex: 1;
    line-height: 1.4;
    font-weight: 500;
}

.privacy-notice-bar-actions {
    display: flex;
    gap: 0.8rem;
    flex-shrink: 0;
}

/* 緊湊型按鈕樣式 */
.privacy-btn-compact {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    min-width: 100px;
}

.privacy-btn-accept {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.privacy-btn-accept:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.privacy-btn-settings {
    background: rgba(108, 117, 125, 0.1);
    color: var(--ud-dark);
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.privacy-btn-settings:hover {
    background: rgba(108, 117, 125, 0.2);
    border-color: var(--ud-primary);
    color: var(--ud-primary);
    transform: translateY(-1px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .privacy-notice-popup {
        padding: 1.5rem 1rem;
    }
    
    .privacy-notice-title {
        font-size: 1.3rem;
    }
    
    .privacy-notice-actions {
        flex-direction: column;
    }
    
    .privacy-btn {
        min-width: auto;
    }
    
    .privacy-center-modal {
        width: 100% !important;
        margin: 0 !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }
    
    .privacy-center-overlay.show {
        padding: 0 !important;
        align-items: stretch !important;
    }
    
    .privacy-center-content {
        padding: 1.5rem 1rem !important;
    }
    
    .privacy-toggle {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        text-align: left !important;
        min-height: auto !important;
    }
    
    .privacy-toggle-info {
        margin-bottom: 0.5rem !important;
    }
    
    .privacy-switch {
        align-self: center !important;
        margin-top: 0 !important;
    }
    
    .privacy-notice-bar {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 1rem;
        border-radius: 10px;
    }
    
    .privacy-notice-bar-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .privacy-notice-bar-text {
        font-size: 0.85rem;
    }
    
    .privacy-notice-bar-actions {
        justify-content: center;
        gap: 0.6rem;
    }
    
    .privacy-btn-compact {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
}

@media (max-width: 576px) {
    .privacy-notice-header {
        flex-direction: column;
        text-align: center;
    }
    
    .privacy-notice-icon {
        margin: 0 0 1rem 0;
    }
    
    .cookie-type-item {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .cookie-type-icon {
        align-self: flex-start;
    }
    
    .privacy-center-footer {
        flex-direction: column;
    }
    
    .privacy-center-overlay.show {
        align-items: stretch !important;
        padding: 0 !important;
    }
    
    .privacy-center-modal {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        transform: scale(1) !important;
    }
    
    .privacy-center-header {
        padding: 1rem 1.5rem !important;
    }
    
    .privacy-center-header h3 {
        font-size: 1.2rem !important;
        padding-right: 2.5rem !important;
    }
    
    .privacy-center-close {
        top: 0.8rem !important;
        right: 0.8rem !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 1.3rem !important;
    }
    
    .privacy-toggle {
        text-align: left !important;
        padding: 1rem !important;
        flex-direction: column !important;
    }
    
    .privacy-switch {
        align-self: center !important;
        margin-top: 0.8rem !important;
    }
}

/* 載入動畫 */
.privacy-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 過渡動畫 */
.privacy-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 