/**
 * Cookie Consent Banner Styles
 * 符合GDPR等法规要求的cookies同意提示样式
 */

/* Cookie同意横幅容器 */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    z-index: 9999999999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-consent-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Cookie信息内容 */
.cookie-consent-content {
    flex: 1;
    color: #ffffff;
}

.cookie-consent-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.cookie-consent-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    color: #cccccc;
}

.cookie-consent-text a {
    color: var(--theme-color, #D7183D);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.cookie-consent-text a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Cookie按钮组 */
.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-consent-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    white-space: nowrap;
}

.cookie-consent-btn:focus {
    outline: 2px solid var(--theme-color, #D7183D);
    outline-offset: 2px;
}

/* 接受按钮 */
.cookie-consent-btn.accept {
    background: var(--theme-color, #D7183D);
    color: #ffffff;
}

.cookie-consent-btn.accept:hover {
    background: #b8152f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(215, 24, 61, 0.3);
}

/* 拒绝按钮 */
.cookie-consent-btn.decline {
    background: transparent;
    color: #cccccc;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-consent-btn.decline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* 设置按钮 */
.cookie-consent-btn.settings {
    background: transparent;
    color: var(--theme-color, #D7183D);
    border: 1px solid var(--theme-color, #D7183D);
}

.cookie-consent-btn.settings:hover {
    background: var(--theme-color, #D7183D);
    color: #ffffff;
}

/* Cookie设置模态框 */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-settings-modal.show .cookie-settings-content {
    transform: scale(1);
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-settings-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Cookie类别 */
.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

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

.cookie-category-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.cookie-category-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* 切换开关 */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.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: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    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: var(--theme-color, #D7183D);
}

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

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

/* 设置模态框按钮 */
.cookie-settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cookie-consent-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .cookie-consent-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .cookie-consent-btn {
        flex: 1;
        min-width: auto;
    }

    .cookie-settings-content {
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
    }

    .cookie-settings-title {
        font-size: 20px;
    }

    .cookie-settings-actions {
        flex-direction: column;
    }

    .cookie-consent-title {
        font-size: 16px;
    }

    .cookie-consent-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 15px 0;
    }

    .cookie-consent-container {
        padding: 0 15px;
    }

    .cookie-consent-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* 动画效果 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {

    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-settings-content,
    .cookie-consent-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        background: #000000;
        border-top: 2px solid #ffffff;
    }

    .cookie-consent-text {
        color: #ffffff;
    }

    .cookie-consent-btn.decline {
        border-color: #ffffff;
    }
}