/* =========================================================
   ADMITH LEGACY — COOKIE CONSENT SYSTEM
   File: css/components/cookie-consent.css

   Includes:
   01. Base / Hidden State
   02. Cookie Consent Banner
   03. Banner Content
   04. Banner Actions
   05. Cookie Settings Modal
   06. Modal Backdrop
   07. Modal Dialog
   08. Cookie Categories
   09. Toggle Switches
   10. Modal Actions
   11. Animations
   12. Mobile Responsive
========================================================= */


/* =========================================================
   01. BASE / HIDDEN STATE
========================================================= */

.cookie-consent[hidden],
.cookie-settings[hidden] {
    display: none !important;
}


/* =========================================================
   02. COOKIE CONSENT BANNER
========================================================= */

.cookie-consent {
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 9990;

    width: auto;
    max-width: 1180px;
    margin: 0 auto;

    padding: 24px 28px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(17, 17, 17, 0.97),
            rgba(30, 30, 30, 0.97)
        );

    color: #ffffff;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.28);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    animation:
        cookieConsentSlideUp
        0.45s
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}


/* =========================================================
   03. BANNER CONTENT
========================================================= */

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 32px;
}


/* Text area */

.cookie-consent-text {
    flex: 1;
    min-width: 0;
}


.cookie-consent-title {
    margin: 0 0 8px;

    color: #ffffff;

    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}


.cookie-consent-description {
    margin: 0;

    max-width: 760px;

    color: rgba(255, 255, 255, 0.72);

    font-size: 0.88rem;
    line-height: 1.65;
}


.cookie-consent-description a {
    color: #5bb780;

    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;

    transition:
        color 0.25s ease;
}


.cookie-consent-description a:hover {
    color: #ffffff;
}


/* =========================================================
   04. BANNER ACTIONS
========================================================= */

.cookie-consent-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex-shrink: 0;

    gap: 10px;
}


/* Shared button */

.cookie-consent-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 18px;

    border: 1px solid transparent;
    border-radius: 10px;

    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.cookie-consent-button:hover {
    transform: translateY(-2px);
}


/* Accept */

.cookie-consent-button--accept {
    background: #5bb780;
    color: #ffffff;

    box-shadow:
        0 8px 20px rgba(91, 183, 128, 0.20);
}


.cookie-consent-button--accept:hover {
    background: #3f9566;
}


/* Reject */

.cookie-consent-button--reject {
    border-color: rgba(255, 255, 255, 0.20);

    background: transparent;
    color: #ffffff;
}


.cookie-consent-button--reject:hover {
    border-color: rgba(255, 255, 255, 0.35);

    background:
        rgba(255, 255, 255, 0.08);
}


/* Settings */

.cookie-consent-button--settings {
    border-color: rgba(255, 255, 255, 0.20);

    background:
        rgba(255, 255, 255, 0.06);

    color: rgba(255, 255, 255, 0.88);
}


.cookie-consent-button--settings:hover {
    border-color: #5bb780;

    background:
        rgba(91, 183, 128, 0.10);

    color: #ffffff;
}


/* =========================================================
   05. COOKIE SETTINGS MODAL
========================================================= */

.cookie-settings {
    position: fixed;

    inset: 0;

    z-index: 10000;

    display: grid;

    place-items: center;

    width: 100%;
    height: 100%;

    padding: 24px;

    overflow-y: auto;

    background: transparent;

    pointer-events: none;
}


/* =========================================================
   06. MODAL BACKDROP
========================================================= */

.cookie-settings::before {
    content: "";

    position: fixed;

    inset: 0;

    z-index: -1;

    width: 100%;
    height: 100%;

    background:
        rgba(0, 0, 0, 0.72);

    backdrop-filter:
        blur(8px);

    -webkit-backdrop-filter:
        blur(8px);

    pointer-events: auto;
}


/* =========================================================
   07. MODAL DIALOG
========================================================= */

.cookie-settings-dialog {
    position: relative;

    z-index: 2;

    width: min(
        100%,
        640px
    );

    max-height: 90vh;

    padding: 42px;

    overflow-y: auto;

    border:
        1px solid
        rgba(17, 17, 17, 0.08);

    border-radius: 24px;

    background: #ffffff;

    color: #383838;

    box-shadow:
        0 35px 100px
        rgba(0, 0, 0, 0.35);

    pointer-events: auto;

    animation:
        cookieSettingsOpen
        0.35s
        cubic-bezier(0.22, 1, 0.36, 1)
        both;
}


/* =========================================================
   MODAL HEADER
========================================================= */

.cookie-settings-header {
    position: relative;

    padding-right: 50px;

    margin-bottom: 28px;
}


.cookie-settings-title {
    margin: 0 0 10px;

    color: #111111;

    font-size: clamp(
        1.6rem,
        3vw,
        2rem
    );

    font-weight: 700;

    line-height: 1.2;
}


.cookie-settings-description {
    margin: 0;

    color: #707070;

    font-size: 0.9rem;

    line-height: 1.7;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.cookie-settings-close {
    position: absolute;

    top: 0;
    right: 0;

    display: grid;

    place-items: center;

    width: 40px;
    height: 40px;

    padding: 0;

    border: 0;

    border-radius: 50%;

    background:
        #f1f3f1;

    color:
        #111111;

    font-family: inherit;

    font-size: 1.4rem;

    line-height: 1;

    cursor: pointer;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}


.cookie-settings-close:hover {
    background:
        #5bb780;

    color:
        #ffffff;

    transform:
        rotate(90deg);
}


/* =========================================================
   08. COOKIE CATEGORIES
========================================================= */

.cookie-settings-categories {
    border-top:
        1px solid
        rgba(17, 17, 17, 0.10);
}


.cookie-category {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 22px 0;

    border-bottom:
        1px solid
        rgba(17, 17, 17, 0.10);
}


.cookie-category-info {
    flex: 1;
}


.cookie-category-title {
    display: block;

    margin-bottom: 6px;

    color:
        #111111;

    font-size:
        0.95rem;

    font-weight:
        700;
}


.cookie-category-description {
    margin: 0;

    color:
        #707070;

    font-size:
        0.82rem;

    line-height:
        1.6;
}


/* Always active */

.cookie-category-required {
    flex-shrink: 0;

    color:
        #3f9566;

    font-size:
        0.75rem;

    font-weight:
        700;

    white-space:
        nowrap;
}


/* =========================================================
   09. TOGGLE SWITCHES
========================================================= */

.cookie-toggle {
    position: relative;

    display: inline-flex;

    flex-shrink: 0;

    width: 48px;
    height: 26px;
}


.cookie-toggle input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}


.cookie-toggle-slider {
    position: absolute;

    inset: 0;

    border-radius: 999px;

    background:
        #d5d9d6;

    cursor: pointer;

    transition:
        background-color 0.25s ease;
}


.cookie-toggle-slider::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background:
        #ffffff;

    box-shadow:
        0 2px 6px
        rgba(0, 0, 0, 0.18);

    transition:
        transform 0.25s ease;
}


.cookie-toggle input:checked
+ .cookie-toggle-slider {
    background:
        #5bb780;
}


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


.cookie-toggle input:focus-visible
+ .cookie-toggle-slider {
    outline:
        3px solid
        rgba(91, 183, 128, 0.30);

    outline-offset:
        3px;
}


/* =========================================================
   10. MODAL ACTIONS
========================================================= */

.cookie-settings-actions {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    gap: 12px;

    margin-top: 28px;
}


.cookie-settings-actions
.cookie-consent-button {
    min-width: 150px;
}


/* =========================================================
   BODY SCROLL LOCK
========================================================= */

body.cookie-settings-open {
    overflow:
        hidden;
}


/* =========================================================
   11. ANIMATIONS
========================================================= */

@keyframes cookieConsentSlideUp {

    from {
        opacity: 0;

        transform:
            translateY(30px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


@keyframes cookieSettingsOpen {

    from {
        opacity: 0;

        transform:
            translateY(20px)
            scale(0.97);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* =========================================================
   12. MOBILE RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .cookie-consent {
        left: 16px;
        right: 16px;
        bottom: 16px;

        padding:
            22px;
    }


    .cookie-consent-content {
        flex-direction:
            column;

        align-items:
            stretch;

        gap:
            20px;
    }


    .cookie-consent-description {
        max-width:
            none;
    }


    .cookie-consent-actions {
        display:
            grid;

        grid-template-columns:
            repeat(3, 1fr);

        width:
            100%;
    }


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

}


@media (max-width: 640px) {

    .cookie-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;

        padding:
            20px;

        border-radius:
            18px;
    }


    .cookie-consent-title {
        font-size:
            1rem;
    }


    .cookie-consent-description {
        font-size:
            0.82rem;
    }


    .cookie-consent-actions {
        grid-template-columns:
            1fr;

        gap:
            8px;
    }


    .cookie-settings {
        padding:
            14px;
    }


    .cookie-settings-dialog {
        width:
            100%;

        max-height:
            92vh;

        padding:
            30px 22px;

        border-radius:
            20px;
    }


    .cookie-settings-header {
        padding-right:
            44px;
    }


    .cookie-settings-title {
        font-size:
            1.5rem;
    }


    .cookie-category {
        align-items:
            flex-start;

        gap:
            16px;
    }


    .cookie-category-description {
        font-size:
            0.78rem;
    }


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

        align-items:
            stretch;
    }


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

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .cookie-consent,
    .cookie-settings-dialog {

        animation:
            none;
    }


    .cookie-consent-button,
    .cookie-settings-close,
    .cookie-toggle-slider,
    .cookie-toggle-slider::before {

        transition:
            none;
    }

}