/**
 * Analytics and Cookie Consent Banner Styles
 * Enhance Home Solutions
 */

/* ========================================
   ANALYTICS CONSENT BANNER
   ======================================== */

.analytics-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(to bottom, rgba(20, 27, 45, 0.98), rgba(11, 15, 25, 0.98));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 229, 255, 0.3);
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out, box-shadow 0.3s ease;
}

.analytics-consent-banner.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.analytics-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.analytics-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.analytics-banner-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: 'Poppins', sans-serif;
}

.analytics-banner-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.analytics-banner-close:hover {
    color: #00e5ff;
    transform: rotate(90deg);
}

.analytics-banner-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.analytics-simple-controls {
    margin-bottom: 12px;
}

.analytics-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.analytics-banner-link {
    color: #00e5ff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.analytics-banner-link:hover {
    color: #00e5ff;
    border-bottom-color: #00e5ff;
    filter: brightness(1.2);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.8);
}

.analytics-banner-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.analytics-settings-button {
    background: transparent;
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.5);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.analytics-settings-button:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: #00e5ff;
    filter: brightness(1.2);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.8);
}

.analytics-deny-button {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.analytics-deny-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

.analytics-accept-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.analytics-accept-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.analytics-save-button {
    background: linear-gradient(135deg, #00e5ff 0%, #00b8d4 100%);
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.3);
}

.analytics-save-button:hover {
    background: linear-gradient(135deg, #00b8d4 0%, #0097a7 100%);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.4);
}

/* Detailed Preferences */
.analytics-preferences {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.analytics-preferences.hidden {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.analytics-preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.analytics-preference-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.analytics-preference-info {
    flex: 1;
    margin-right: 16px;
}

.analytics-preference-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    font-family: 'Poppins', sans-serif;
}

.analytics-preference-desc {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* Toggle Switch */
.analytics-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

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

.analytics-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 26px;
}

.analytics-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.analytics-toggle input:checked + .analytics-slider {
    background-color: #00e5ff;
}

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

.analytics-toggle input:disabled + .analytics-slider {
    cursor: not-allowed;
    opacity: 0.6;
}

.analytics-detailed-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Privacy Settings Toggle Button */
.privacy-settings-toggle {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 9998;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e5ff 0%, #00b8d4 100%);
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.4);
    transition: all 0.3s ease;
}

.privacy-settings-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 229, 255, 0.5);
}

.privacy-settings-toggle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

/* ========================================
   COOKIE CONSENT BANNER
   ======================================== */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: linear-gradient(to bottom, rgba(20, 27, 45, 0.98), rgba(11, 15, 25, 0.98));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 229, 255, 0.3);
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.cookie-consent-banner.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.cookie-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cookie-banner-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-banner-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
}

.cookie-banner-text p {
    margin: 0;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.cookie-btn-link {
    background: transparent;
    color: #00e5ff;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.cookie-btn-link:hover {
    color: #00e5ff;
    filter: brightness(1.2);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.8);
}

.cookie-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.cookie-btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (min-width: 768px) {
    .cookie-banner-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cookie-banner-text {
        flex: 1;
        margin-right: 20px;
    }

    .cookie-banner-actions {
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .analytics-banner-content {
        padding: 20px 16px;
    }

    .analytics-banner-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .analytics-banner-button {
        width: 100%;
    }

    .analytics-preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .analytics-preference-info {
        margin-right: 0;
    }

    .privacy-settings-toggle {
        bottom: 160px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

/* Light theme adjustments */
[data-theme="light"] .analytics-consent-banner,
[data-theme="light"] .cookie-consent-banner {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.98));
    border-top-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .analytics-banner-title,
[data-theme="light"] .analytics-preference-title {
    color: #1a1a1a;
}

[data-theme="light"] .analytics-banner-text,
[data-theme="light"] .analytics-preference-desc,
[data-theme="light"] .cookie-banner-text {
    color: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .analytics-banner-close {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .analytics-banner-close:hover {
    color: #00b8d4;
}

[data-theme="light"] .analytics-preference-item {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .analytics-preference-item:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .analytics-banner-link {
    color: #0097a7;
    text-shadow: none;
}

[data-theme="light"] .analytics-banner-link:hover {
    color: #00b8d4;
    filter: brightness(0.9);
}

[data-theme="light"] .analytics-settings-button,
[data-theme="light"] .cookie-btn-link {
    color: #0097a7;
    border-color: rgba(0, 151, 167, 0.5);
    text-shadow: none;
}

[data-theme="light"] .analytics-settings-button:hover,
[data-theme="light"] .cookie-btn-link:hover {
    color: #00b8d4;
    border-color: #00b8d4;
    background: rgba(0, 151, 167, 0.1);
    filter: none;
}

[data-theme="light"] .analytics-deny-button,
[data-theme="light"] .cookie-btn-secondary {
    color: rgba(0, 0, 0, 0.75);
    border-color: rgba(0, 0, 0, 0.3);
    text-shadow: none;
}

[data-theme="light"] .analytics-deny-button:hover,
[data-theme="light"] .cookie-btn-secondary:hover {
    color: rgba(0, 0, 0, 0.9);
    border-color: rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.1);
    filter: none;
}
