/* 
 * Alternative Cookie Consent Styles v2 - Modern Glassmorphism Design
 * SAUTO Auto - Using existing class names with modern styling
 */

/* CSS Variables for easy customization */
:root {
    --sauto-primary: #e2001a;
    --sauto-primary-light: rgba(226, 0, 26, 0.1);
    --sauto-primary-dark: #b8001a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #ffffff;
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.3);
    --border-radius: 1.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Consent Banner - Using existing .cons_bx class */
.cons_bx {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 8rem;
    background: linear-gradient(135deg, var(--glass-bg), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    box-shadow: var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-primary);
    font-family: "def_l";
    font-size: 1.1rem;
    transform: translateY(100%);
    transition: var(--transition);
}

.cons_bx p {
    width: 90%;
    margin: 0;
    padding: 0;
    text-align: center;
}

.cons_bx > div:not(.close-banner) {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cons_bx .close-banner {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10001;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.cons_bx .close-banner:hover {
    background: var(--sauto-primary);
    border-color: white;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(226, 0, 26, 0.4);
}

.cons_bx:not([style*="display: none"]) {
    transform: translateY(0);
}

.cons_bx input[type="checkbox"] {
    accent-color: var(--sauto-primary);
    margin: 0 0.2rem 0 1rem;
}

/* Consent Buttons - Using existing .cons_btns class */
.cons_btns {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.cons_btns > button {
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-family: "def";
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    line-height: 1 !important;
}

.cons_btns > button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.cons_btns > button:first-child {
    background: linear-gradient(135deg, var(--sauto-primary), var(--sauto-primary-dark));
    color: var(--text-light);
    border-color: var(--sauto-primary);
}

.cons_btns > button:first-child:hover {
    background: linear-gradient(135deg, var(--sauto-primary-dark), #a0001a);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.cons_btns > button:last-child {
    background: linear-gradient(135deg, #666666, #555555);
    color: #ffffff;
    border-color: #666666;
}

.cons_btns > button:last-child:hover {
    background: linear-gradient(135deg, #555555, #444444);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* Preferences Modal - Using existing #pref_bx class */
#pref_bx {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

#pref_bx:not([style*="display: none"]) {
    opacity: 1;
    visibility: visible;
}

#pref_bx.cons_pref {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    gap: 1rem;
    max-width: 580px;
    max-height: 85vh;
    min-height: 80vh;
    width: 88%;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    background: linear-gradient(135deg, var(--glass-bg), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: 1px solid var(--glass-border);
    overflow-y: auto;
}

#pref_bx > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

/* Preferences Modal Title - Using existing .ttl class */
#pref_bx .ttl {
    border-bottom: 1px solid var(--sauto-primary);
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
    padding: 0 0 0 0.2rem;
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(135deg, var(--sauto-primary), var(--sauto-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Preferences Labels - Using existing label structure */
#pref_bx label {
    position: relative;
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 3.25rem;
    overflow: hidden;
}

#pref_bx label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(226, 0, 26, 0.05), rgba(226, 0, 26, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#pref_bx label:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.25));
    border-color: var(--sauto-primary);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

#pref_bx label:hover::before {
    opacity: 1;
}

/* Essential cookies label - unique locked design */
#pref_bx label:has(.chk_bx.def) {
    background: linear-gradient(135deg, 
        rgba(120, 120, 120, 0.15), 
        rgba(100, 100, 100, 0.1), 
        rgba(140, 140, 140, 0.05));
    border: 2px solid rgba(120, 120, 120, 0.3);
    cursor: not-allowed;
    position: relative;
    overflow: visible;
}

#pref_bx label:has(.chk_bx.def)::after {
    content: '🔒';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #777777, #555555);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(120, 120, 120, 0.4);
    animation: lockPulse 2s infinite;
}

@keyframes lockPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(120, 120, 120, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 6px 16px rgba(120, 120, 120, 0.6); }
}

#pref_bx label:has(.chk_bx.def):hover {
    background: linear-gradient(135deg, 
        rgba(120, 120, 120, 0.2), 
        rgba(100, 100, 100, 0.15), 
        rgba(140, 140, 140, 0.1));
    border-color: rgba(120, 120, 120, 0.5);
    transform: none;
    box-shadow: 0 8px 32px rgba(120, 120, 120, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
}

#pref_bx label:has(.chk_bx.def):hover::before {
    opacity: 0;
}

#pref_bx label:has(.chk_bx.def):hover > .txt {
    border-bottom-color: transparent;
}

#pref_bx label > input {
    display: none;
}

#pref_bx label > .txt {
    border-bottom: 1px solid transparent;
    flex: 1;
    color: #000000;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.4;
    padding-right: 1rem;
}

#pref_bx label:hover > .txt {
    border-bottom-color: var(--sauto-primary);
}

/* Toggle Switch - Using existing .chk_bx class with glassmorphism */
#pref_bx .chk_bx {
    width: 3rem;
    height: 1.5rem;
    background: rgba(200, 200, 200, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    display: inline-block;
    border-radius: 0.75rem;
    padding: 0.1rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
}

#pref_bx .chk_bx.def {
    cursor: not-allowed;
    background: linear-gradient(135deg, var(--sauto-primary), var(--sauto-primary-dark));
    border-color: var(--sauto-primary);
}

#pref_bx .chk_bx > .dot {
    width: 1.3rem;
    height: 1.3rem;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border-radius: 50%;
    margin-left: 0;
    margin-top: 0;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#pref_bx input:checked ~ .chk_bx,
#pref_bx .chk_bx.def {
    background: linear-gradient(135deg, var(--sauto-primary), var(--sauto-primary-dark));
    border-color: var(--sauto-primary);
}

#pref_bx input:checked ~ .chk_bx > .dot,
#pref_bx .chk_bx.def > .dot {
    margin-left: calc(100% - 1.3rem);
    background: linear-gradient(135deg, #ffffff, #ffffff);
    transform: translate(0, -50%);
}

/* Buttons container styling */
#pref_bx .cons_btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
}

#pref_bx .cons_btns > button {
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-family: "def";
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 120px;
}

#pref_bx .cons_btns > button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

#pref_bx .cons_btns > button:first-child {
    background: linear-gradient(135deg, var(--sauto-primary), var(--sauto-primary-dark));
    color: var(--text-light);
    border-color: var(--sauto-primary);
}

#pref_bx .cons_btns > button:first-child:hover {
    background: linear-gradient(135deg, var(--sauto-primary-dark), #a0001a);
}

#pref_bx .cons_btns > button:last-child {
    background: linear-gradient(135deg, #666666, #555555);
    color: #ffffff;
    border-color: #666666;
}

#pref_bx .cons_btns > button:last-child:hover {
    background: linear-gradient(135deg, #555555, #444444);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cons_bx {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem;
    }
    
    .cons_bx > div:not(.close-banner) {
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 !important;
    }
    
    .cons_bx p {
        width: 100% !important;
        margin: 0;
        padding: 1rem 0 0 0;
        max-width: none !important;
        font-weight: 600;
    }
    
    .cons_bx .close-banner {
        top: 0.25rem;
        right: 0.5rem;
        width: 2rem;
        height: 2rem;
        font-size: 1.2rem;
    }
    
    .cons_btns {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        width: 100%;
    }
    
    .cons_btns > button {
        width: 100%;
        max-width: 280px;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    #pref_bx.cons_pref {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    #pref_bx label {
        padding: 1rem 1.25rem;
        margin-bottom: 0.75rem;
        min-height: 3.5rem;
    }
    
    #pref_bx label > .txt {
        padding-right: 1rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    #pref_bx .ttl {
        font-size: 1.3rem;
        font-weight: 700;
    }
    
    #pref_bx .chk_bx {
        width: 2.5rem;
        height: 1.25rem;
    }
    
    #pref_bx .chk_bx > .dot {
        width: 1rem;
        height: 1rem;
    }
    
    #pref_bx input:checked ~ .chk_bx > .dot,
    #pref_bx .chk_bx.def > .dot {
        margin-left: calc(100% - 1rem);
    }
    
    #pref_bx .cons_btns {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    #pref_bx .cons_btns > button {
        width: 100%;
        padding: 1rem;
    }
}

/* Focus states for accessibility */
.cons_btns > button:focus,
#pref_bx .chk_bx:focus,
#pref_bx label:focus {
    outline: 2px solid var(--sauto-primary);
    outline-offset: 2px;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cons_bx,
    #pref_bx > div {
        background: #ffffff;
        border: 2px solid #000000;
    }
    
    #pref_bx .chk_bx {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Scrollbar styling for preferences modal */
#pref_bx > div::-webkit-scrollbar {
    width: 6px;
}

#pref_bx > div::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#pref_bx > div::-webkit-scrollbar-thumb {
    background: var(--sauto-primary);
    border-radius: 3px;
}

#pref_bx > div::-webkit-scrollbar-thumb:hover {
    background: var(--sauto-primary-dark);
}
