/* Cookie Consent Banner Styles */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    display: none;
}

.cookie-consent-banner.expanded ~ .cookie-consent-overlay {
    display: block;
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    animation: slideUp 0.4s ease-out forwards;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-consent-banner.expanded {
    max-height: 80vh;
}

.cookie-consent-main {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-icon {
    font-size: 3rem;
    color: #667eea;
    flex-shrink: 0;
}

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

.cookie-content h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.cookie-content p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-cookie-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-cookie-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-cookie-essential {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.btn-cookie-essential:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-cookie-reject {
    background: transparent;
    color: #6c757d;
    border: 2px solid #dee2e6;
}

.btn-cookie-reject:hover {
    background: #f8f9fa;
}

.btn-cookie-settings {
    background: transparent;
    color: #667eea;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cookie-settings:hover {
    color: #764ba2;
}

/* Cookie Settings Panel */
.cookie-consent-settings {
    padding: 0 2rem 2rem;
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
    animation: expandDown 0.3s ease-out;
}

.cookie-consent-settings h4 {
    margin: 1.5rem 0 1rem;
    color: #333;
    font-size: 1.25rem;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Стили для категорий в попапе cookie consent */
.cookie-consent-settings .cookie-category {
    background: rgba(103, 126, 234, 0.1) !important; /* Фиолетовый с 10% прозрачностью */
    border: 1px solid rgba(103, 126, 234, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.cookie-consent-settings .cookie-category:hover {
    background: rgba(103, 126, 234, 0.15) !important; /* Чуть темнее при наведении */
    border-color: rgba(103, 126, 234, 0.3);
}

/* Убедимся, что текст хорошо читается на полупрозрачном фоне */
.cookie-consent-settings .category-info h5 {
    color: #2d3748 !important; /* Темный цвет для контраста */
}

.cookie-consent-settings .category-info p {
    color: #4a5568 !important; /* Темно-серый для хорошей читаемости */
}

.cookie-consent-settings .category-details ul {
    color: #4a5568 !important;
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Фиолетовый фон с 90% прозрачностью для заголовков категорий в попапе */
.cookie-consent-settings .category-header {
    background: rgba(103, 126, 234, 0.1) !important; /* 10% непрозрачности = 90% прозрачности */
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.category-info {
    flex: 1;
}

.category-info h5 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.category-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.category-details {
    margin-top: 1rem;
    padding-left: 3.5rem;
}

.category-details ul {
    margin: 0;
    padding-left: 1.5rem;
    color: #666;
    font-size: 0.85rem;
}

.category-details li {
    margin: 0.25rem 0;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

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

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

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.cookie-switch input:checked + .slider {
    background-color: #667eea;
}

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

.cookie-switch.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-switch.disabled .slider {
    cursor: not-allowed;
}

/* Settings Footer */
.cookie-settings-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.cookie-policy-link {
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.cookie-policy-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.btn-cookie-save {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cookie-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Animations */
@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

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

@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-main {
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .cookie-icon {
        font-size: 2.5rem;
    }

    .cookie-content h3 {
        font-size: 1.25rem;
    }

    .cookie-content p {
        font-size: 0.9rem;
    }

    .cookie-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cookie-actions button {
        flex: 1;
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }

    .btn-cookie-settings {
        flex: 0 0 auto;
    }

    .cookie-consent-settings {
        padding: 0 1.5rem 1.5rem;
    }

    .category-details {
        padding-left: 0;
        margin-top: 0.75rem;
    }

    .cookie-settings-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-cookie-save {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .cookie-consent-banner {
        border-radius: 0;
    }

    .cookie-consent-main {
        padding: 1rem;
        text-align: center;
    }

    .cookie-icon {
        margin: 0 auto;
    }

    .cookie-actions {
        flex-direction: column;
    }

    .cookie-actions button {
        width: 100%;
    }

    .category-header {
        flex-direction: column;
        text-align: left;
    }

    .cookie-switch {
        align-self: flex-start;
    }
}