/*
* Optimaly s.r.o. - Cookie Consent Banner
* GDPR Compliant Cookie Consent with Microsoft Clarity & GTM Integration
* Copyright (c) 2025 Optimaly s.r.o.
*/

/* Cookie Consent Banner - Bottom Fixed */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9997;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px 0;
    animation: slideUp 0.4s ease-out;
    display: none;
}

.cookie-consent-banner.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.cookie-consent-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.cookie-consent-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cookie-consent-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
}

.cookie-consent-text a {
    color: var(--optimaly-blue);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.cookie-consent-text a:hover {
    color: var(--optimaly-dark);
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Buttons */
.cookie-consent-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-consent-btn-accept {
    background: var(--optimaly-blue);
    color: white;
}

.cookie-consent-btn-accept:hover {
    background: var(--optimaly-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.cookie-consent-btn-necessary {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.cookie-consent-btn-necessary:hover {
    background: #f8f9fa;
    border-color: #999;
    color: #333;
}

.cookie-consent-btn-settings {
    background: transparent;
    color: var(--optimaly-blue);
    border: none;
    text-decoration: underline;
    padding: 10px 15px;
}

.cookie-consent-btn-settings:hover {
    color: var(--optimaly-dark);
}

/* Settings Modal */
.cookie-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    animation: fadeIn 0.3s;
    display: none;
}

.cookie-settings-overlay.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cookie-settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.4s;
    display: none;
}

.cookie-settings-modal.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cookie-settings-header {
    background: var(--optimaly-blue);
    color: white;
    padding: 25px 30px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-settings-header h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

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

.cookie-settings-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.cookie-settings-body {
    padding: 30px;
}

.cookie-category {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.cookie-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

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

.cookie-category-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--optimaly-dark);
    margin: 0;
}

.cookie-category-description {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Toggle Switch */
.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%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--optimaly-blue);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--optimaly-gold);
}

.cookie-settings-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cookie-settings-footer button {
    flex: 1;
}

/* Manage Cookies Button in Privacy Policy */
.manage-cookies-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--optimaly-blue);
    color: white;
    border: none;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.manage-cookies-btn:hover {
    background: var(--optimaly-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .cookie-consent-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .cookie-consent-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-consent-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .cookie-consent-container {
        padding: 0 20px;
    }

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

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

    .cookie-consent-icon {
        font-size: 24px;
    }

    .cookie-settings-modal {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-settings-header {
        padding: 20px;
    }

    .cookie-settings-body {
        padding: 20px;
    }

    .cookie-settings-footer {
        flex-direction: column;
        padding: 15px 20px;
    }
}

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

    .cookie-consent-banner {
        padding: 12px 0;
    }

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

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

    .cookie-settings-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .cookie-settings-header {
        border-radius: 0;
    }
}
