/**
 * Compliance Pack Cookie Consent Styles
 */

/* Banner Base Styles */
.cp-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Position Variants */
.cp-banner-top {
    top: 0;
    border-bottom: 1px solid #e5e7eb;
}

.cp-banner-bottom {
    bottom: 0;
    border-top: 1px solid #e5e7eb;
}

/* Layout Variants */
.cp-banner-bar .cp-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.cp-banner-box {
    left: 20px;
    right: auto;
    max-width: 400px;
    border-radius: 8px;
    width: auto;
    height: auto;
}

/* Full-width bar positions */
.cp-banner-bar.cp-banner-top {
    top: 0;
    bottom: auto;
}

.cp-banner-bar.cp-banner-bottom {
    bottom: 0;
    top: auto;
}

/* Floating box positions */
.cp-banner-box.cp-banner-top-left {
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
}

.cp-banner-box.cp-banner-top-right {
    top: 20px;
    right: 20px;
    left: auto;
    bottom: auto;
}

.cp-banner-box.cp-banner-bottom-left {
    bottom: 20px;
    left: 20px;
    right: auto;
    top: auto;
}

.cp-banner-box.cp-banner-bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    top: auto;
}

.cp-banner-box.cp-banner-center {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
}

/* Legacy support for old position values */
.cp-banner-box.cp-banner-top {
    top: 20px;
    left: 20px;
    right: auto;
    bottom: auto;
}

.cp-banner-box.cp-banner-bottom {
    bottom: 20px;
    left: 20px;
    right: auto;
    top: auto;
}

.cp-banner-box .cp-banner-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Banner Content */
.cp-banner-message {
    flex: 1;
    margin-right: 20px;
    color: #374151;
}

.cp-banner-message p {
    margin: 0 0 8px 0;
}

.cp-privacy-link {
    color: #2563eb;
    text-decoration: underline;
    margin-left: 4px;
}

.cp-privacy-link:hover {
    color: #1d4ed8;
}

/* Banner Actions */
.cp-banner-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* Buttons */
.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

/* Button Styles */
.cp-btn-rounded {
    border-radius: 6px;
}

.cp-btn-square {
    border-radius: 0;
}

.cp-btn-pill {
    border-radius: 50px;
}

/* Button Variants */
.cp-accept-btn {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.cp-accept-btn:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.cp-reject-btn {
    background-color: #6b7280;
    color: #ffffff;
    border-color: #6b7280;
}

.cp-reject-btn:hover {
    background-color: #4b5563;
    border-color: #4b5563;
}

.cp-settings-btn {
    background-color: transparent;
    color: #2563eb;
    border-color: #2563eb;
}

.cp-settings-btn:hover {
    background-color: #2563eb;
    color: #ffffff;
}

/* Cookie Settings Modal */
.cp-cookie-settings {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cp-settings-content {
    background: #ffffff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.cp-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.cp-settings-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.cp-close-settings {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.cp-close-settings:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.cp-settings-body {
    padding: 24px;
}

.cp-settings-body > p {
    margin: 0 0 24px 0;
    color: #6b7280;
}

/* Cookie Categories */
.cp-cookie-category {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.cp-category-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.cp-category-header h4 {
    margin: 0 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.cp-category-description {
    padding: 16px;
}

.cp-category-description p {
    margin: 0 0 12px 0;
    color: #6b7280;
}

/* Toggle Switch */
.cp-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.cp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.2s;
    border-radius: 24px;
}

.cp-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .cp-toggle-slider {
    background-color: #2563eb;
}

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

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

/* Cookie Details */
.cp-cookie-details {
    margin-top: 12px;
}

.cp-cookie-details summary {
    cursor: pointer;
    font-weight: 500;
    color: #2563eb;
    padding: 4px 0;
}

.cp-cookie-details summary:hover {
    color: #1d4ed8;
}

.cp-cookie-list {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.cp-cookie-item {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.cp-cookie-item:last-child {
    border-bottom: none;
}

.cp-cookie-item strong {
    display: block;
    color: #111827;
    margin-bottom: 4px;
}

.cp-cookie-item p {
    margin: 0 0 4px 0;
    color: #6b7280;
    font-size: 13px;
}

.cp-cookie-item small {
    color: #9ca3af;
    font-size: 12px;
}

/* Settings Footer */
.cp-settings-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

/* Modal Open State */
body.cp-modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cp-banner-bar .cp-banner-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .cp-banner-message {
        margin-right: 0;
    }
    
    .cp-banner-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cp-banner-box {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .cp-cookie-settings {
        padding: 10px;
    }
    
    .cp-settings-content {
        max-height: 90vh;
    }
    
    .cp-settings-footer {
        flex-direction: column;
    }
    
    .cp-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cp-category-header h4 {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .cp-banner-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cp-btn {
        width: 100%;
        justify-content: center;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .cp-cookie-banner {
        border-width: 2px;
    }
    
    .cp-btn {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cp-btn,
    .cp-toggle-slider,
    .cp-toggle-slider:before {
        transition: none;
    }
}

/* Focus Styles for Accessibility */
.cp-cookie-banner:focus-within {
    outline: none;
}

.cp-toggle-switch:focus-within .cp-toggle-slider {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .cp-cookie-banner,
    .cp-cookie-settings {
        display: none !important;
    }
}