/**
 * HUSHIKO Cookie Consent Styles
 * GDPR-compliant banner and modal with Hushiko brand colors
 *
 * Design System:
 * - Primary: #9B87D9 (Soft Lavender)
 * - Secondary: #FF9F66 (Sunrise Orange)
 * - Background: #FFF8F0 (Cloud Cream)
 * - Fonts: Quicksand (headings), Nunito (body)
 */

/* ===========================
   Cookie Banner (Bottom)
   =========================== */

.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    box-shadow: 0 -4px 20px rgba(155, 135, 217, 0.2);
    border-top: 3px solid #9B87D9;
    padding: 1.5rem 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cc-banner--visible {
    transform: translateY(0);
}

.cc-banner__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cc-banner__content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.cc-banner__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #9B87D9 0%, #FF9F66 100%);
    border-radius: 12px;
    color: #FFFFFF;
}

.cc-banner__icon svg {
    width: 24px;
    height: 24px;
}

.cc-banner__text {
    flex: 1;
}

.cc-banner__title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4A3B6B;
    margin-bottom: 0.5rem;
}

.cc-banner__description {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #3D3D5C;
    margin: 0;
}

.cc-banner__description a {
    color: #9B87D9;
    text-decoration: underline;
    font-weight: 600;
}

.cc-banner__description a:hover {
    color: #6B5B95;
}

.cc-banner__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ===========================
   Cookie Modal (Overlay)
   =========================== */

.cc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cc-modal--visible {
    opacity: 1;
    visibility: visible;
}

.cc-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.cc-modal__content {
    position: relative;
    background: #FFFFFF;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(155, 135, 217, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cc-modal--visible .cc-modal__content {
    transform: scale(1);
}

.cc-modal__header {
    padding: 2rem;
    border-bottom: 2px solid #F5F5F7;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cc-modal__title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4A3B6B;
    margin: 0;
}

.cc-modal__close {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B8B9E;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cc-modal__close:hover {
    background: #F5F5F7;
    color: #4A3B6B;
}

.cc-modal__body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.cc-modal__intro {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #3D3D5C;
    margin-bottom: 2rem;
}

.cc-modal__footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #F5F5F7;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===========================
   Cookie Categories
   =========================== */

.cc-category {
    background: #FFF8F0;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.cc-category:hover {
    border-color: #C4B8E8;
}

.cc-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cc-category__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.cc-category__title {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4A3B6B;
    margin: 0;
}

.cc-category__badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #9B87D9 0%, #FF9F66 100%);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.cc-category__description {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4B5563;
    margin: 0;
}

/* ===========================
   Toggle Switch
   =========================== */

.cc-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.cc-toggle--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.cc-toggle__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #D1D5DB;
    border-radius: 28px;
    transition: all 0.3s ease;
}

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

.cc-toggle input:checked + .cc-toggle__slider {
    background: linear-gradient(135deg, #9B87D9 0%, #FF9F66 100%);
}

.cc-toggle input:checked + .cc-toggle__slider::before {
    transform: translateX(24px);
}

.cc-toggle input:focus + .cc-toggle__slider {
    box-shadow: 0 0 0 3px rgba(155, 135, 217, 0.3);
}

/* ===========================
   Buttons
   =========================== */

.cc-btn {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cc-btn--primary {
    background: linear-gradient(135deg, #9B87D9 0%, #FF9F66 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(155, 135, 217, 0.3);
}

.cc-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(155, 135, 217, 0.4);
}

.cc-btn--primary:active {
    transform: translateY(0);
}

.cc-btn--secondary {
    background: #F5F5F7;
    color: #4A3B6B;
    border: 2px solid #D1D5DB;
}

.cc-btn--secondary:hover {
    background: #FFFFFF;
    border-color: #9B87D9;
    color: #6B5B95;
}

.cc-btn--tertiary {
    background: transparent;
    color: #9B87D9;
    border: 2px solid #9B87D9;
}

.cc-btn--tertiary:hover {
    background: #9B87D9;
    color: #FFFFFF;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    .cc-banner__container {
        padding: 0 1rem;
    }

    .cc-banner__content {
        flex-direction: column;
        gap: 1rem;
    }

    .cc-banner__icon {
        width: 40px;
        height: 40px;
    }

    .cc-banner__actions {
        flex-direction: column;
        gap: 0.75rem;
    }

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

    .cc-modal__content {
        width: 95%;
        max-height: 90vh;
    }

    .cc-modal__header,
    .cc-modal__body,
    .cc-modal__footer {
        padding: 1.5rem;
    }

    .cc-modal__title {
        font-size: 1.25rem;
    }

    .cc-category {
        padding: 1rem;
    }

    .cc-modal__footer {
        flex-direction: column-reverse;
    }
}

@media (max-width: 480px) {
    .cc-banner__title {
        font-size: 1.1rem;
    }

    .cc-banner__description {
        font-size: 0.9rem;
    }

    .cc-btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }

    .cc-category__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cc-toggle {
        align-self: flex-end;
    }
}

/* ===========================
   Accessibility
   =========================== */

/* Focus visible for keyboard navigation */
.cc-btn:focus-visible,
.cc-toggle input:focus-visible + .cc-toggle__slider,
.cc-modal__close:focus-visible {
    outline: 3px solid #9B87D9;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cc-banner {
        border-top-width: 5px;
    }

    .cc-category {
        border-width: 3px;
    }

    .cc-btn--primary {
        background: #6B5B95;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-modal,
    .cc-modal__content,
    .cc-btn,
    .cc-toggle__slider,
    .cc-toggle__slider::before {
        transition: none;
    }
}

/* Print styles - hide cookie consent when printing */
@media print {
    .cc-banner,
    .cc-modal {
        display: none !important;
    }
}
