/**
 * Cookie Consent Plugin - Frontend Styles
 *
 * Responsive styles for banner and modal
 */

/* CSS Variables for theming */
:root {
    --ccp-primary-color: #ff6633;
    --ccp-primary-hover: #e55a2b;
}

/* Reset and base styles */
.ccp-consent-banner *,
.ccp-consent-modal * {
    box-sizing: border-box;
}

/* Banner Styles */
.ccp-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    border-top: 3px solid var(--ccp-primary-color);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
    display: none;
}

.ccp-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ccp-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ccp-banner-text {
    flex: 1;
    min-width: 0;
}

.ccp-banner-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.ccp-banner-description {
    margin: 0;
    color: #e0e0e0;
    line-height: 1.4;
}

.ccp-banner-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    min-width: 200px;
}

.ccp-banner-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.ccp-link {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.ccp-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.ccp-link-separator {
    color: #999;
    user-select: none;
}

/* Banner Categories (optional expanded view) */
.ccp-banner-categories {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ccp-categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.ccp-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ccp-category-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ccp-essential-badge {
    background: var(--ccp-primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ccp-categories-actions {
    text-align: center;
}

/* Close button */
.ccp-banner-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.ccp-banner-close:hover {
    color: #fff;
}

/* Buttons */
.ccp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
}

.ccp-btn-primary {
    background: var(--ccp-primary-color);
    color: white;
    border-color: var(--ccp-primary-color);
}

.ccp-btn-primary:hover {
    background: var(--ccp-primary-hover);
    border-color: var(--ccp-primary-hover);
}

.ccp-btn-secondary {
    background: #666;
    color: white;
    border-color: #666;
}

.ccp-btn-secondary:hover {
    background: #555;
    border-color: #555;
}

.ccp-btn-outline {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.ccp-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.ccp-btn-link {
    background: transparent;
    color: var(--ccp-primary-color);
    border: none;
    text-decoration: underline;
    padding: 5px 10px;
}

.ccp-btn-link:hover {
    color: var(--ccp-primary-hover);
}

.ccp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

.ccp-btn-large {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    min-height: 50px;
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.ccp-btn-large:hover {
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.4);
    transform: translateY(-1px);
}

/* Modal Styles */
.ccp-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.ccp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.ccp-modal-container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ccp-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ccp-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.ccp-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.ccp-modal-close:hover {
    color: #333;
}

.ccp-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.ccp-modal-description {
    padding: 20px 30px;
    background: #f8f9fa;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.ccp-modal-description p {
    margin: 0;
    line-height: 1.6;
}

.ccp-modal-categories {
    padding: 0;
}

/* Category sections */
.ccp-category-section {
    border-bottom: 1px solid #e0e0e0;
}

.ccp-category-section:last-child {
    border-bottom: none;
}

.ccp-category-header {
    padding: 25px 30px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.ccp-category-info {
    flex: 1;
    min-width: 0;
}

.ccp-category-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ccp-category-description {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.ccp-category-toggle-wrapper {
    flex-shrink: 0;
}

/* Toggle switches */
.ccp-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

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

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

input:checked + .ccp-toggle-slider {
    background-color: var(--ccp-primary-color);
}

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

input:disabled + .ccp-toggle-slider {
    background-color: var(--ccp-primary-color);
    opacity: 0.7;
    cursor: not-allowed;
}

/* Small toggle switches for services */
.ccp-toggle-switch-small {
    width: 40px;
    height: 22px;
}

.ccp-toggle-switch-small .ccp-toggle-slider {
    border-radius: 22px;
}

.ccp-toggle-switch-small .ccp-toggle-slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
}

.ccp-toggle-switch-small input:checked + .ccp-toggle-slider:before {
    transform: translateX(18px);
}

/* Services list */
.ccp-category-services {
    padding: 0 30px 20px;
}

.ccp-services-toggle {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 15px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ccp-services-toggle:hover {
    background: #e9ecef;
}

.ccp-toggle-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.ccp-services-list {
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
}

.ccp-service-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.ccp-service-item:last-child {
    border-bottom: none;
}

.ccp-service-info {
    flex: 1;
    min-width: 0;
}

.ccp-service-name {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.ccp-service-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ccp-service-toggle-wrapper .ccp-status-indicator {
    font-size: 11px;
    white-space: nowrap;
}

.ccp-service-description {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.ccp-service-status {
    flex-shrink: 0;
}

.ccp-status-indicator {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ccp-status-indicator.active {
    background: #d4edda;
    color: #155724;
}

.ccp-status-indicator.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Modal footer */
.ccp-modal-footer {
    padding: 25px 30px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.ccp-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.ccp-modal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ccp-privacy-link,
.ccp-imprint-link {
    color: var(--ccp-primary-color);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.ccp-privacy-link:hover,
.ccp-imprint-link:hover {
    color: var(--ccp-primary-hover);
    text-decoration: underline;
}

/* Settings trigger (after consent) */
.ccp-settings-trigger {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999998;
}

.ccp-settings-btn {
    background: var(--ccp-primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
    transition: all 0.2s ease;
}

.ccp-settings-btn:hover {
    background: var(--ccp-primary-hover);
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.4);
    transform: translateY(-1px);
}

.ccp-settings-icon {
    font-size: 14px;
}

/* Body classes for state management */
body.ccp-banner-visible {
    padding-bottom: 0; /* Adjust if needed */
}

body.ccp-modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    /* Banner mobile styles */
    .ccp-banner-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .ccp-banner-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .ccp-banner-actions .ccp-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ccp-categories-list {
        grid-template-columns: 1fr;
    }
    
    .ccp-category-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Modal mobile styles */
    .ccp-modal-container {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
        border-radius: 8px;
    }
    
    .ccp-modal-header,
    .ccp-modal-description,
    .ccp-category-header,
    .ccp-category-services,
    .ccp-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .ccp-modal-title {
        font-size: 20px;
    }
    
    .ccp-category-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .ccp-modal-actions {
        flex-direction: column;
    }
    
    .ccp-modal-actions .ccp-btn {
        width: 100%;
    }
    
    .ccp-modal-links {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Settings trigger mobile */
    .ccp-settings-trigger {
        bottom: 10px;
        left: 10px;
    }
    
    .ccp-settings-btn {
        padding: 10px 16px;
        font-size: 11px;
    }
    
    .ccp-settings-text {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .ccp-banner-container {
        padding: 15px;
    }
    
    .ccp-banner-title {
        font-size: 16px;
    }
    
    .ccp-banner-description {
        font-size: 13px;
    }
    
    .ccp-btn {
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ccp-consent-banner {
        border-top-width: 5px;
    }
    
    .ccp-btn-outline {
        border-width: 3px;
    }
    
    .ccp-toggle-slider {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ccp-consent-banner,
    .ccp-consent-modal,
    .ccp-btn,
    .ccp-toggle-slider,
    .ccp-toggle-slider:before,
    .ccp-settings-btn {
        transition: none;
    }
}

/* Print styles */
@media print {
    .ccp-consent-banner,
    .ccp-consent-modal,
    .ccp-settings-trigger {
        display: none !important;
    }
}