/**
 * COOKIE CONSENT STYLES
 * Profesjonalny system zarządzania cookies z pięknym UI
 * Pasujący do GuidedMindHypnosis design system
 *
 * @version 1.0
 * @date 2025-11-20
 */

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */

.cookie-consent-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.cookie-consent-banner {
    position: relative;
    max-width: 1000px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 1rem;
    padding: 1.25rem 1.75rem;
    box-shadow:
        0 25px 50px -12px rgba(102, 126, 234, 0.25),
        0 0 0 1px rgba(102, 126, 234, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-banner.hide {
    transform: translateY(120%);
    opacity: 0;
}

/* Cookie Icon */
.cookie-consent-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    flex-shrink: 0;
}

/* Content */
.cookie-consent-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cookie-consent-description {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #4a5568;
}

.cookie-consent-description a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.cookie-consent-description a:hover {
    border-bottom-color: #667eea;
}

/* Buttons */
.cookie-consent-actions {
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
}

.cookie-consent-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    user-select: none;
    white-space: nowrap;
}

.cookie-consent-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cookie-consent-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.cookie-consent-btn-primary:active {
    transform: translateY(0);
}

.cookie-consent-btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.cookie-consent-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.cookie-consent-btn-tertiary {
    background: transparent;
    color: #718096;
    border: 2px solid #e2e8f0;
}

.cookie-consent-btn-tertiary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #4a5568;
}

/* ============================================
   COOKIE SETTINGS MODAL
   ============================================ */

.cookie-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 32, 44, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-settings-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-modal {
    background: white;
    border-radius: 1.5rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-settings-overlay.show .cookie-settings-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.cookie-settings-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.cookie-settings-header-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cookie-settings-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.cookie-settings-header-text {
    flex: 1;
}

.cookie-settings-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cookie-settings-subtitle {
    font-size: 0.9375rem;
    color: #718096;
    line-height: 1.6;
}

.cookie-settings-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #718096;
}

.cookie-settings-close:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #4a5568;
    transform: rotate(90deg);
}

.cookie-settings-close svg {
    width: 20px;
    height: 20px;
}

/* Modal Body */
.cookie-settings-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-settings-body::-webkit-scrollbar {
    width: 8px;
}

.cookie-settings-body::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.cookie-settings-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.cookie-settings-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Cookie Categories */
.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.cookie-category.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    cursor: pointer;
}

.cookie-category-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cookie-category-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.cookie-category.disabled .cookie-category-icon {
    background: #cbd5e0;
}

.cookie-category-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.cookie-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e2e8f0;
    color: #718096;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cookie-category-description {
    font-size: 0.875rem;
    color: #718096;
    line-height: 1.6;
    margin-top: 0.75rem;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 56px;
    height: 32px;
    flex-shrink: 0;
}

.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: #cbd5e0;
    border-radius: 9999px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Expandable Details */
.cookie-category-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cookie-category.expanded .cookie-category-details {
    max-height: 500px;
}

.cookie-category-expand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #667eea;
    font-weight: 600;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-category-expand:hover {
    color: #5568d3;
}

.cookie-category-expand svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.cookie-category.expanded .cookie-category-expand svg {
    transform: rotate(180deg);
}

.cookie-details-list {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.cookie-details-list h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.cookie-details-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cookie-details-list li {
    font-size: 0.8125rem;
    color: #718096;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f7fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-details-list li:last-child {
    border-bottom: none;
}

.cookie-details-list li:before {
    content: "🍪";
    font-size: 0.875rem;
}

/* Modal Footer */
.cookie-settings-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    border-radius: 0 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cookie-settings-footer .cookie-consent-btn {
    flex: 1;
    min-width: 150px;
}

/* ============================================
   COOKIE SETTINGS LINK (FOOTER)
   ============================================ */

.cookie-settings-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.cookie-settings-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cookie-settings-link svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .cookie-consent-wrapper {
        padding: 1rem;
    }

    .cookie-consent-banner {
        padding: 1.25rem;
        border-radius: 1.25rem;
        flex-direction: column;
        gap: 1rem;
    }

    .cookie-consent-content {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .cookie-consent-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .cookie-consent-title {
        font-size: 1rem;
    }

    .cookie-consent-description {
        font-size: 0.8125rem;
    }

    .cookie-consent-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-consent-btn {
        width: 100%;
    }

    .cookie-settings-modal {
        max-height: 90vh;
        border-radius: 1.25rem;
    }

    .cookie-settings-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .cookie-settings-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-settings-title {
        font-size: 1.5rem;
    }

    .cookie-settings-body {
        padding: 1.5rem;
    }

    .cookie-category {
        padding: 1.25rem;
    }

    .cookie-settings-footer {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
    }

    .cookie-settings-footer .cookie-consent-btn {
        width: 100%;
    }

    .cookie-settings-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 1rem;
    }

    .cookie-consent-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .cookie-consent-title {
        font-size: 0.9375rem;
    }

    .cookie-consent-description {
        font-size: 0.75rem;
    }

    .cookie-consent-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .cookie-settings-title {
        font-size: 1.25rem;
    }

    .cookie-category {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cookie-category-info {
        width: 100%;
    }

    .cookie-toggle {
        width: 52px;
        height: 28px;
    }

    .cookie-toggle-slider:before {
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
    }

    .cookie-toggle input:checked + .cookie-toggle-slider:before {
        transform: translateX(24px);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
.cookie-consent-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.cookie-settings-close:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-settings-overlay,
    .cookie-settings-modal,
    .cookie-toggle-slider:before,
    .cookie-category-expand svg {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cookie-consent-banner,
    .cookie-settings-modal {
        border: 2px solid #2d3748;
    }

    .cookie-category {
        border: 2px solid #4a5568;
    }

    .cookie-consent-btn-secondary,
    .cookie-consent-btn-tertiary {
        border-width: 2px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
    .cookie-settings-body {
        scroll-behavior: smooth;
    }
}
