/* PyTool Cookie Banner Styles */

#pytool-cookie-banner {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* 位置样式 */
#pytool-cookie-banner.position-top {
    top: 0;
    left: 0;
    right: 0;
}

#pytool-cookie-banner.position-bottom {
    bottom: 0;
    left: 0;
    right: 0;
}

#pytool-cookie-banner.position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 600px;
    border-radius: 8px;
}

/* 布局样式 */
#pytool-cookie-banner.layout-bar {
    padding: 15px 20px;
}

#pytool-cookie-banner.layout-box {
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
}

#pytool-cookie-banner.layout-modal {
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
}

/* 动画效果 */
#pytool-cookie-banner.animation-slide.position-bottom {
    transform: translateY(100%);
}

#pytool-cookie-banner.animation-slide.position-top {
    transform: translateY(-100%);
}

#pytool-cookie-banner.animation-slide.show {
    transform: translateY(0);
}

#pytool-cookie-banner.animation-fade {
    opacity: 0;
}

#pytool-cookie-banner.animation-fade.show {
    opacity: 1;
}

/* 内容区域 */
.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.cookie-banner-message {
    margin: 0;
    opacity: 0.9;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 按钮样式 */
.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}

.cookie-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cookie-btn:active {
    transform: translateY(0);
}

.cookie-btn-primary {
    background-color: var(--cookie-primary-color, #007cba);
    color: white;
}

.cookie-btn-secondary {
    background-color: transparent;
    color: var(--cookie-primary-color, #007cba);
    border: 1px solid var(--cookie-primary-color, #007cba);
}

.cookie-btn-decline {
    background-color: #dc3545;
    color: white;
}

.cookie-btn-settings {
    background-color: var(--cookie-secondary-color, #ffffff);
    color: var(--cookie-text-color, #333333);
    border: 1px solid #ddd;
}

/* 按钮样式变体 */
.button-style-rounded .cookie-btn {
    border-radius: 25px;
}

.button-style-square .cookie-btn {
    border-radius: 0;
}

/* Cookie设置模态框 */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-settings-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cookie-settings-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

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

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

.cookie-category {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
}

.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;
}

.cookie-category-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-category-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%;
}

.cookie-category-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--cookie-primary-color, #007cba);
}

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

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

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

.cookie-settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 隐私政策链接 */
.cookie-privacy-link {
    color: var(--cookie-primary-color, #007cba);
    text-decoration: underline;
    font-size: 13px;
    margin-top: 10px;
    display: inline-block;
}

.cookie-privacy-link:hover {
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #pytool-cookie-banner.position-center {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        max-width: none;
        border-radius: 0;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-banner-text {
        min-width: auto;
        text-align: center;
    }
    
    .cookie-banner-actions {
        justify-content: center;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: auto;
    }
    
    .cookie-settings-content {
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
    }
    
    .cookie-settings-actions {
        flex-direction: column;
    }
    
    .cookie-settings-actions .cookie-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #pytool-cookie-banner {
        font-size: 13px;
    }
    
    .cookie-banner-title {
        font-size: 15px;
    }
    
    .cookie-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .cookie-settings-content {
        padding: 15px;
    }
    
    .cookie-category {
        padding: 12px;
    }
}

/* 可访问性 */
.cookie-btn:focus,
.cookie-settings-close:focus,
.cookie-category-toggle:focus-within {
    outline: 2px solid var(--cookie-primary-color, #007cba);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    #pytool-cookie-banner {
        border: 2px solid;
    }
    
    .cookie-btn {
        border-width: 2px;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    #pytool-cookie-banner,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
}
