/* ========================================
   Cookie 隱私權條款樣式 - 簡約版
   ======================================== */

/* Cookie 同意橫幅 */
.cookie-consent {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1da3f8 0%, #0d8ae6 100%);
    background-image: linear-gradient(to top,rgb(0,102,255) 0%,rgb(22,138,254) 20%,rgb(43,173,252) 92%);
    border-radius: 16px;
    padding: 30px 40px;
    z-index: 9999;
    display: none;
    animation: slideUp 0.4s ease-out;
    box-shadow: 0 8px 32px rgba(29, 163, 248, 0.3);
    max-width: 900px;
    width: 90%;
}

.cookie-consent.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cookie-text {
    color: white;
    text-align: center;
}

.cookie-text h3 {
    display: none;
}

.cookie-text p {
    font-size: 15px;
    color: white;
    line-height: 1.7;
    margin: 0;
}

.cookie-text a {
    color: #ffeb3b;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-text a:hover {
    color: #fff59d;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.cookie-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans TC', sans-serif;
    white-space: nowrap;
}

.cookie-btn-accept {
    background-color: white;
    color: #1da3f8;
}

.cookie-btn-accept:hover {
    background-color: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.cookie-btn-settings {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.cookie-btn-settings:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.cookie-btn-decline {
    display: none;
}

/* Cookie 設定視窗 */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-content {
    background: white;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease-out;
}

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

.cookie-settings-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}

.cookie-settings-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.cookie-settings-close:hover {
    color: #333;
    background-color: #f5f5f5;
}

.cookie-settings-body {
    padding: 24px 28px;
}

.cookie-settings-intro {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.7;
}

.cookie-category {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.cookie-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cookie-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-category-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background-color: #e3f2fd;
    color: #1565c0;
    font-weight: 500;
}

.cookie-category-badge.always-on {
    background-color: #e3f2fd;
    color: #1565c0;
}

.cookie-category-description {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 8px;
}

.cookie-category-examples {
    font-size: 12px;
    color: #999;
    font-style: italic;
    line-height: 1.6;
}

/* 開關切換按鈕 */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ddd;
    transition: 0.3s;
    border-radius: 28px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #1da3f8;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-settings-footer {
    padding: 20px 28px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: white;
    border-radius: 0 0 16px 16px;
}

.cookie-settings-footer .cookie-btn {
    min-width: 100px;
}

.cookie-settings-footer .cookie-btn-settings {
    background-color: #f5f5f5;
    color: #666;
    border: none;
}

.cookie-settings-footer .cookie-btn-settings:hover {
    background-color: #e8e8e8;
}

.cookie-settings-footer .cookie-btn-decline {
    display: inline-block; /* 在設定視窗中顯示 */
    background-color: #f5f5f5;
    color: #666;
    border: none;
}

.cookie-settings-footer .cookie-btn-decline:hover {
    background-color: #e8e8e8;
}

.cookie-settings-footer .cookie-btn-accept {
    background-color: #1da3f8;
    color: white;
}

.cookie-settings-footer .cookie-btn-accept:hover {
    background-color: #0088dd;
}

/* 手機版響應式 */
@media (max-width: 767px) {
    .cookie-consent {
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 24px 20px;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-text {
        min-width: 100%;
    }
    
    .cookie-text p {
        font-size: 14px;
    }
    
    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .cookie-settings-content {
        max-height: 90vh;
        margin: 10px;
        border-radius: 12px;
    }
    
    .cookie-settings-header {
        padding: 20px;
        border-radius: 12px 12px 0 0;
    }
    
    .cookie-settings-header h2 {
        font-size: 18px;
    }
    
    .cookie-settings-body {
        padding: 20px;
    }
    
    .cookie-settings-footer {
        flex-direction: column-reverse;
        padding: 16px 20px;
        border-radius: 0 0 12px 12px;
    }
    
    .cookie-settings-footer .cookie-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 479px) {
    .cookie-text p {
        font-size: 13px;
        line-height: 1.7;
    }
    
    .cookie-btn {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .cookie-settings-header h2 {
        font-size: 17px;
    }
    
    .cookie-category-title {
        font-size: 15px;
    }
    
    .cookie-category-description {
        font-size: 13px;
    }
}

/* 平板版 */
@media (min-width: 768px) and (max-width: 1024px) {
    .cookie-consent {
        bottom: 16px;
        padding: 28px 32px;
    }
    
    .cookie-content {
        gap: 16px;
    }
    
    .cookie-text {
        min-width: 280px;
    }
}