/* Variables */
:root {
    --accent-color: #FA7E61;
    --accent-hover: #F44174;
    --background-dark: #101014;
    --background-light: #000;
    --text-dark: #fff;
    --text-light: #ddd;
    --border-radius: 18px;
    --shadow: 0 8px 30px rgba(0,0,0,0.6), 0 15px 60px rgba(0,0,0,0.7);
    --gradient-border: linear-gradient(45deg, var(--accent-color), var(--accent-hover));
    --gradient-text: linear-gradient(180deg, var(--accent-color) -103.79%, var(--accent-hover) 101.34%);
}

/* Keyframes */
@keyframes slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse-text-shadow {
    0%, 100% { text-shadow: none; }
    50% { text-shadow: 0 0 8px var(--accent-color), 0 0 15px var(--accent-hover); }
}

@keyframes gradient-border-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes checkmark-pop {
    0% { opacity: 0; transform: scale(0.5) translate(-50%, -50%); }
    60% { opacity: 1; transform: scale(1.2) translate(-50%, -50%); }
    100% { opacity: 1; transform: scale(1) translate(-50%, -50%); }
}

/* Popup Container Styles */
.cookie-popup-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999999;
    padding: 20px;
    box-sizing: border-box;
}

/* Popup Modal Styles */
.cookie-popup-container .cookie-popup {
    background: var(--background-light);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
    margin: 0;
    padding: 30px;
    position: relative;
    font-family: "Manrope", sans-serif;
    animation: slide-up 0.6s cubic-bezier(.4,2,.6,1) 1; /* Entry animation */
    transition: box-shadow 0.3s;
    border: 1px solid rgba(80, 72, 247, 0.3);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* Animated border pseudo-element */
.cookie-popup-container .cookie-popup::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: calc(var(--border-radius) + 3px);
    padding: 3px;
    background: var(--gradient-border);
    background-size: 200% 200%;
    animation: gradient-border-animation 5s ease infinite; /* Continuous border animation */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    pointer-events: none;
}

/* Rule to reapply border animation when JS adds this class */
.cookie-popup-container .cookie-popup.animate-border-loop::before {
    animation: gradient-border-animation 5s ease infinite; /* Ensure animation is applied when class is present */
}

.cookie-popup-container .cookie-popup:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 20px 80px rgba(0,0,0,0.8);
}

/* Cookie Panel Styles (Title Area) */
.cookie-panel {
    padding: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.cookie-popup .cookie-panel ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
    justify-content: flex-start;
    border-bottom: none;
    width: 100%;
}

.cookie-popup .cookie-panel ul li.consent-panel {
    display: none; /* Consent tab is hidden in this layout */
}

.cookie-popup .cookie-panel ul li.details-panel {
    flex: unset;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-dark);
    transition: color 0.3s ease;
    border: none;
    display: flex;
    align-items: center; /* Center icon and text vertically */
    justify-content: center; /* Center icon and text horizontally */
    width: 100%;
    gap: 10px;
    font-size: 24px;
    font-family: "Jockey One", sans-serif;
    animation: none; /* No continuous animation on the text */
}

.cookie-popup .cookie-panel ul li.details-panel:hover {
    color: var(--accent-color); /* Color change on hover */
}

.cookie-popup .cookie-panel ul li.details-panel.active {
    color: var(--accent-color);
    background: transparent;
    border-color: transparent;
}

.cookie-popup .cookie-panel ul li.details-panel .cookie-icon {
    font-size: 40px;
    margin-right: 0px;
    color: var(--accent-color);
    transition: transform 0.3s ease; /* Smooth transition for hover effect */
    display: inline-block;
    animation: bounce-subtle 1.5s infinite ease-in-out; /* Continuous bounce animation */
}

.cookie-popup .cookie-panel ul li.details-panel:hover .cookie-icon {
    transform: translateY(-5px); /* Subtle bounce on hover */
}

.cookie-popup .cookie-panel ul li.details-panel .subtitle {
    display: none; /* Subtitle is hidden in this layout */
}

/* Cookie Content Area */
.cookie-content.cookie-mid {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-grow: 1;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Cookie Categories Display Area */
.cookie-cookies-display {
    padding: 20px;
    max-height: 350px; /* Increased max height for content scroll */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--background-light);
    scroll-behavior: smooth;
    flex-grow: 1;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
    background: var(--background-light); /* Dark background for the list */
    border-radius: 12px; /* Rounded corners */
    border: 1px solid var(--accent-hover); /* Subtle border */
    animation: none; /* No continuous animation on the list */
}

/* Custom scrollbar for Webkit browsers */
.cookie-cookies-display::-webkit-scrollbar {
    width: 8px;
    background: var(--background-dark);
    border-radius: 8px;
}
.cookie-cookies-display::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 8px;
}

.cookie-cookies-display > p {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
    text-align: left;
}

.cookie-category {
    background: var(--background-light); /* Slightly lighter dark background */
    border-radius: 10px; /* Slightly smaller border radius */
    margin-bottom: 12px;
    padding: 15px 20px;
    border: 1px solid var(--accent-hover);
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
    transition: box-shadow 0.25s, background 0.25s, transform 0.18s, border-color 0.25s;
    color: var(--text-light);
}

.cookie-category:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
    background: #F44174; /* Even lighter dark background on hover */
    transform: translateY(-2px);
    border-color: var(--accent-color); /* Highlight border on hover */
}

.cookie-cookies-display .cookie-category .data .data-resume .cat-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cookie-cookies-display .cookie-category .data .data-resume .cat-main > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-cookies-display .cookie-category .data .data-resume .cat-main .cookie-cat-name {
    margin: 0;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 15px;
}

.cookie-cookies-display .cookie-category .cat-describe {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
}

/* Checkbox Styles */
.cookie-cookies-display .cookie-category .choose {
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid var(--accent-color);
    cursor: pointer;
    position: relative;
    background: var(--background-dark);
    transition: border 0.2s, background 0.2s, box-shadow 0.2s, transform 0.18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.cookie-cookies-display .cookie-category .choose:hover:not(.always-on) {
    border-color: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transform: scale(1.05);
}

.cookie-cookies-display .cookie-category .choose.active {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.cookie-cookies-display .cookie-category .choose.active::before {
    content: "\2713"; /* Checkmark symbol */
    font-size: 20px;
    color: var(--background-dark);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    animation: checkmark-pop 0.3s cubic-bezier(.4,2,.6,1);
}

.cookie-cookies-display .cookie-category .choose.always-on {
    border-color: var(--accent-color);
    background: var(--accent-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-cookies-display .cookie-category .choose.always-on::before {
    content: "\2713"; /* Checkmark symbol */
    font-size: 20px;
    color: var(--background-dark);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Button Area Styles */
.cookie-decide {
    width: 100%;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column; /* Stack button list and pre-text vertically */
    gap: 15px; /* Vertical gap between pre-text and buttons */
    align-items: center; /* Center children horizontally */
    justify-content: center;
    flex-shrink: 0;
    margin-top: 25px;
}

.cookie-decide .pre-cookie-box {
    padding: 0;
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.5;
    display: none; /* Pre-text box is hidden in this layout */
}

.cookie-decide .pre-cookie-box h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 18px;
    font-family: "Jockey One", sans-serif;
}

.cookie-decide .pre-cookie-box p {
    margin-bottom: 10px;
}

.cookie-decide .pre-cookie-box p:last-child {
    margin-bottom: 0;
}

.cookie-decide .pre-cookie-box a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px solid var(--accent-color);
}

.cookie-decide .pre-cookie-box a:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.cookie-decide ul {
    display: flex;
    gap: 20px; /* Horizontal gap between buttons */
    justify-content: center; /* Center buttons horizontally */
    align-items: center;
    padding: 0;
    margin: 0;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    flex-direction: row; /* Arrange buttons in a row */
}

.cookie-decide ul li.allow-selection {
    display: none; /* Allow selection button is hidden initially */
}

/* Button Styles */


.cookie-decide .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    padding: 2px;
    background: var(--gradient-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

.cookie-decide .btn-white {
    background-color: var(--background-dark);
    color: var(--accent-color);
    border-color: transparent;
}

.cookie-decide .btn-white:hover {
    background: var(--gradient-border);
    color: var(--background-dark);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cookie-popup-container {
        padding: 15px;
    }
    .cookie-popup-container .cookie-popup {
        padding: 20px;
        min-height: auto;
    }
    .cookie-popup .cookie-panel ul li.details-panel {
        font-size: 20px;
        gap: 8px;
    }
    .cookie-popup .cookie-panel ul li.details-panel .cookie-icon {
        font-size: 30px;
    }
    .cookie-content.cookie-mid {
        padding: 0;
    }
    .cookie-cookies-display {
        max-height: 250px;
        padding: 15px;
    }
    .cookie-cookies-display > p {
        margin-bottom: 15px;
        font-size: 15px;
    }
    .cookie-category {
        padding: 10px 15px;
    }
    .cookie-cookies-display .cookie-category .data .data-resume .cat-main .cookie-cat-name {
        font-size: 13px;
    }
    .cookie-cookies-display .cookie-category .cat-describe {
        font-size: 11px;
    }
    .cookie-cookies-display .cookie-category .choose {
        font-size: 16px;
        width: 22px;
        height: 22px;
    }
    .cookie-cookies-display .cookie-category .choose.active::before,
    .cookie-cookies-display .cookie-category .choose.always-on::before {
        font-size: 16px;
    }
    .cookie-decide {
        gap: 15px;
        margin-top: 20px;
    }
    .cookie-decide ul {
        gap: 15px;
    }
    .cookie-decide .btn {
        font-size: 15px;
        min-width: 120px;
    }
}