/**
 * Analytics & Cookie Consent Banner Styles
 * TarpTheRoof by 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(17, 24, 39, 0.98), rgba(0, 0, 0, 0.98));
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 107, 0, 0.3);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 107, 0, 0.3);
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

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

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

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

.analytics-banner-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ff6b00;
    margin: 0;
}

.analytics-banner-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.analytics-banner-close:hover {
    color: #ff6b00;
    background: rgba(255, 107, 0, 0.1);
}

.analytics-banner-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.analytics-simple-controls {
    margin-bottom: 1rem;
}

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

.analytics-banner-link {
    color: #ff6b00;
    text-decoration: underline;
    text-underline-offset: 4px;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.analytics-banner-link:hover {
    color: #ff8c00;
}

.analytics-banner-button {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
}

.analytics-settings-button {
    background: transparent;
    border: 1px solid rgba(255, 107, 0, 0.5);
    color: #ff6b00;
}

.analytics-settings-button:hover {
    background: rgba(255, 107, 0, 0.1);
    border-color: #ff6b00;
}

.analytics-deny-button {
    background: transparent;
    border: 1px solid rgba(255, 107, 0, 0.5);
    color: #ff6b00;
}

.analytics-deny-button:hover {
    background: rgba(255, 107, 0, 0.1);
    border-color: #ff6b00;
}

.analytics-accept-button {
    background: linear-gradient(to right, #ff6b00, #ff8c00);
    color: white;
    font-weight: 600;
}

.analytics-accept-button:hover {
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.4);
    transform: translateY(-1px);
}

.analytics-save-button {
    background: linear-gradient(to right, #ff6b00, #ff8c00);
    color: white;
    font-weight: 600;
    width: 100%;
}

.analytics-save-button:hover {
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.4);
}

/* Detailed Preferences */
.analytics-preferences {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 107, 0, 0.2);
    transition: all 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.analytics-preferences:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
}

.analytics-preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 107, 0, 0.1);
}

.analytics-preference-info {
    flex: 1;
}

.analytics-preference-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 0.25rem 0;
}

.analytics-preference-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* 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: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

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

.analytics-toggle input:focus + .analytics-slider {
    box-shadow: 0 0 1px #ff6b00;
}

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

.analytics-toggle input:disabled + .analytics-slider {
    cursor: not-allowed;
    background-color: rgba(156, 163, 175, 0.5);
}

.analytics-detailed-actions {
    margin-top: 1rem;
}

/* Privacy Settings Toggle Button */
.privacy-settings-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9998;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b00, #ff8c00);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
    transition: all 0.3s;
}

.privacy-settings-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

.animate-fade-out-down {
    animation: fadeOutDown 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analytics-banner-content {
        padding: 1rem;
    }

    .analytics-banner-actions {
        flex-direction: column;
        width: 100%;
    }

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

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

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

    .privacy-settings-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    .privacy-settings-toggle svg {
        width: 16px;
        height: 16px;
    }
}

/* Smooth scrollbar for banner on small screens */
.analytics-consent-banner::-webkit-scrollbar {
    width: 6px;
}

.analytics-consent-banner::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.analytics-consent-banner::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 0, 0.5);
    border-radius: 3px;
}

.analytics-consent-banner::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 0, 0.7);
}

/* Body adjustments when banners are visible */
body[data-cookie-consent-visible="true"],
body[data-analytics-consent-visible="true"] {
    padding-bottom: 0;
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}
