/**
 * Cookie Consent Banner Styles
 * Design GDPR-compliant cookie banner
 */

.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(45, 52, 54, 0.98);
    backdrop-filter: blur(10px);
    color: white;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    border-top: 3px solid var(--primary-color);
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-banner.hide {
    bottom: -100%;
    opacity: 0;
}

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

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

.cookie-banner-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.cookie-banner-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

.cookie-banner-body p {
    margin: 0 0 20px 0;
    line-height: 1.6;
    color: #e0e0e0;
}

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

.cookie-category {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.cookie-category.necessary {
    border-left: 4px solid #4caf50;
}

.cookie-category.functional {
    border-left: 4px solid #2196f3;
}

.cookie-category.analytics {
    border-left: 4px solid #ff9800;
}

.cookie-category.marketing {
    border-left: 4px solid #e91e63;
}

.category-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

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

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

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

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

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

.category-info {
    flex: 1;
}

.category-info strong {
    display: block;
    margin-bottom: 5px;
    color: white;
    font-size: 1rem;
}

.category-info .required {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px;
}

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

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.cookie-banner-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.btn-accept-all {
    background: var(--primary-color);
    color: white;
}

.btn-accept-all:hover {
    background: #3a5f47;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 89, 0.4);
}

.btn-reject-all {
    background: #666;
    color: white;
}

.btn-reject-all:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 102, 102, 0.4);
}

.btn-save-preferences {
    background: var(--accent-color);
    color: white;
}

.btn-save-preferences:hover {
    background: #e69547;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 162, 97, 0.4);
}

.cookie-banner-links {
    text-align: center;
    font-size: 0.9rem;
}

.cookie-banner-links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.cookie-banner-links a:hover {
    color: #e69547;
    text-decoration: underline;
}

/* Floating Cookie Preferences Link */
.cookie-preferences-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-preferences-link:hover {
    background: #3a5f47;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(74, 124, 89, 0.3);
    color: white;
    text-decoration: none;
}

.cookie-preferences-link:before {
    content: '🍪';
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 15px;
    }

    .cookie-categories {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cookie-category {
        padding: 12px;
    }

    .category-header {
        gap: 12px;
    }

    .cookie-banner-actions {
        flex-direction: column;
        gap: 10px;
    }

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

    .cookie-banner-header h3 {
        font-size: 1.2rem;
    }

    .cookie-preferences-link {
        bottom: 15px;
        left: 15px;
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-content {
        padding: 12px;
    }

    .cookie-banner-header {
        margin-bottom: 12px;
    }

    .cookie-banner-header h3 {
        font-size: 1.1rem;
    }

    .cookie-category {
        padding: 10px;
    }

    .category-header {
        flex-direction: column;
        gap: 8px;
    }

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

    .cookie-banner-actions button {
        padding: 10px 20px;
        font-size: 13px;
    }

    .cookie-preferences-link {
        bottom: 12px;
        left: 12px;
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 20px;
    }
}

/* Animation keyframes */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Accessibility */
.cookie-banner:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

.cookie-toggle:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 24px;
}

.cookie-banner-actions button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-banner {
        background: #000;
        border-top: 4px solid var(--primary-color);
    }

    .cookie-category {
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .toggle-slider {
        background-color: #333;
    }

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .toggle-slider,
    .toggle-slider:before,
    .cookie-banner-actions button,
    .cookie-preferences-link {
        transition: none;
    }

    .cookie-banner-close:hover {
        transform: none;
    }

    .cookie-banner-actions button:hover,
    .cookie-preferences-link:hover {
        transform: none;
    }
}