/**
 * Global Synlogia Cookie Consent System
 * GDPR/RODO compliant cookie banner and management
 */

/* Cookie Banner Modal Styles */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-banner:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.cookie-banner-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-banner:not(.hidden) .cookie-banner-content {
    transform: scale(1);
}

/* Banner Header */
.cookie-banner-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.cookie-banner-branding {
    display: flex;
    justify-content: center;
}

.cookie-banner-branding .gs-logo {
    height: 80px;
    width: auto;
    max-width: 400px;
}

.cookie-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-icon {
    width: 32px;
    height: 32px;
    background: #124f9e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cookie-icon .lucide-icon,
.cookie-icon .lucide-cookie {
    color: white;
    stroke: white;
    width: 20px;
    height: 20px;
}

.cookie-banner-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* Description */
.cookie-description {
    color: #6c757d;
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Cookie Categories */
.cookie-categories {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
    opacity: 1;
    max-height: 1000px;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
}

.cookie-categories.cookie-categories-hidden {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.cookie-categories.expanding {
    opacity: 1;
    max-height: 1000px;
    margin-bottom: 24px;
}

.cookie-categories.show {
    opacity: 1;
    max-height: 1000px;
    margin-bottom: 24px;
}

.cookie-category {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    background: white;
    transition: border-color 0.2s ease;
}

.cookie-category:hover {
    border-color: #124f9e;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cookie-category-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: all 0.2s ease;
}

.cookie-category-header input[type="checkbox"]:checked {
    background: #124f9e;
    border-color: #124f9e;
}

.cookie-category-header input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.cookie-category-header input[type="checkbox"]:disabled {
    background: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.cookie-category-header input[type="checkbox"]:disabled:checked {
    background: #6c757d;
    border-color: #6c757d;
}

.cookie-category-header label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    cursor: pointer;
    font-size: 0.95rem;
}

.cookie-category-status {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
}

.cookie-category-description {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    margin-left: 32px;
}

/* Buttons */
.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    justify-content: center;
}

.cookie-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.cookie-btn-primary {
    background: #124f9e;
    color: white;
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 79, 158, 0.3);
}

.cookie-btn-secondary {
    background: white;
    color: #124f9e;
    border: 2px solid #124f9e;
}

.cookie-btn-secondary:hover {
    background: #124f9e;
    color: white;
}

.cookie-btn-tertiary {
    background: #6c757d;
    color: white;
}

.cookie-btn-tertiary:hover {
    background: #5a6268;
}

/* Links */
.cookie-links {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 0.85rem;
}

.cookie-links a {
    color: #124f9e;
    text-decoration: none;
    font-weight: 500;
}

.cookie-links a:hover {
    text-decoration: underline;
}

.cookie-links span {
    color: #dee2e6;
}

/* Floating Settings Button */
.cookie-settings-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.cookie-settings-float.hidden {
    opacity: 0;
    pointer-events: none;
}

.cookie-settings-float button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #124f9e;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-float button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cookie-settings-float .lucide-icon {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 16px;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        min-width: auto;
    }

    .cookie-links {
        flex-direction: column;
        gap: 4px;
    }

    .cookie-category-description {
        margin-left: 0;
        margin-top: 8px;
    }

    .cookie-settings-float {
        bottom: 16px;
        left: 16px;
    }

    .cookie-settings-float button {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-header {
        gap: 12px;
    }

    .cookie-banner-branding .gs-logo {
        height: 45px;
        max-width: 200px;
    }

    .cookie-header-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cookie-category-header label {
        width: 100%;
    }
}

/* Accessibility */
.cookie-btn:focus,
.cookie-category-header input[type="checkbox"]:focus {
    outline: 2px solid #124f9e;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cookie-banner-content {
        background: #2d2d2d;
        color: #ffffff;
    }

    .cookie-banner-header h3 {
        color: #ffffff;
    }

    .cookie-description {
        color: #a6a6a6;
    }

    .cookie-category {
        background: #2d2d2d;
        border-color: #404040;
    }

    .cookie-category:hover {
        border-color: #124f9e;
    }

    .cookie-category-description {
        color: #a6a6a6;
    }

    .cookie-links span {
        color: #404040;
    }
}

/* Animation for consent given */
.cookie-consent-given {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

/* Content blocking until cookie consent */
.cookie-content-blocked {
    filter: blur(4px);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
    transition: all 0.3s ease;
}

.cookie-content-blocked.cookie-consent-given {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

/* Full page overlay until consent */
.cookie-page-blocked {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-page-blocked.cookie-consent-given {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.cookie-page-blocked .blocked-message {
    text-align: center;
    max-width: 400px;
    padding: 20px;
}

.cookie-page-blocked .blocked-message h3 {
    margin-bottom: 16px;
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
}

.cookie-page-blocked .blocked-message p {
    margin-bottom: 0;
    color: #6c757d;
    line-height: 1.6;
}