/* Colorado Power Partners - Cookie & Privacy Banner Styles */

.cpp-cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 960px;
    margin: 0 auto;
    background: var(--bg-surface, #161b22);
    border: 1px solid var(--accent, #e59537);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(229, 149, 55, 0.2);
    padding: 20px 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cpp-cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cpp-cookie-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.cpp-cookie-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(229, 149, 55, 0.15);
    border: 1px solid rgba(229, 149, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cpp-cookie-text {
    flex: 1;
}

.cpp-cookie-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpp-cookie-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(229, 149, 55, 0.2);
    color: var(--accent, #e59537);
}

.cpp-cookie-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary, #8b949e);
    margin: 0;
}

.cpp-cookie-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cpp-cookie-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    outline: none;
    white-space: nowrap;
}

.cpp-cookie-btn-primary {
    background: var(--accent, #e59537);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(229, 149, 55, 0.3);
}

.cpp-cookie-btn-primary:hover {
    background: #d48325;
    transform: translateY(-1px);
}

.cpp-cookie-btn-secondary {
    background: var(--bg-card, #21262d);
    color: var(--text-primary, #c9d1d9);
    border: 1px solid var(--border, #30363d);
}

.cpp-cookie-btn-secondary:hover {
    border-color: var(--accent, #e59537);
    color: var(--accent, #e59537);
}

.cpp-cookie-btn-ghost {
    background: transparent;
    color: var(--text-secondary, #8b949e);
    border: 1px solid transparent;
}

.cpp-cookie-btn-ghost:hover {
    color: var(--text-primary, #ffffff);
    text-decoration: underline;
}

/* Preferences Modal Overlay */
.cpp-cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.cpp-cookie-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cpp-cookie-modal {
    background: var(--bg-surface, #161b22);
    border: 1px solid var(--border, #30363d);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: cppModalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cppModalScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.cpp-cookie-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border, #30363d);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cpp-cookie-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpp-cookie-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #8b949e);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s;
}

.cpp-cookie-modal-close:hover {
    color: var(--text-primary, #ffffff);
}

.cpp-cookie-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cpp-cookie-pref-item {
    background: var(--bg-card, #21262d);
    border: 1px solid var(--border, #30363d);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cpp-cookie-pref-info {
    flex: 1;
}

.cpp-cookie-pref-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cpp-cookie-pref-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

.cpp-cookie-pref-tag.required {
    background: rgba(46, 160, 67, 0.15);
    color: #3fb950;
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.cpp-cookie-pref-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary, #8b949e);
    margin: 0;
}

/* Custom Switch Toggle */
.cpp-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.cpp-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cpp-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border, #30363d);
    transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.cpp-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

.cpp-switch input:checked + .cpp-switch-slider {
    background-color: var(--accent, #e59537);
}

.cpp-switch input:focus + .cpp-switch-slider {
    box-shadow: 0 0 1px var(--accent, #e59537);
}

.cpp-switch input:checked + .cpp-switch-slider:before {
    transform: translateX(20px);
}

.cpp-switch input:disabled + .cpp-switch-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cpp-cookie-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border, #30363d);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-card, #21262d);
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .cpp-cookie-banner {
        flex-direction: column;
        align-items: stretch;
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 16px;
        gap: 16px;
    }

    .cpp-cookie-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .cpp-cookie-btn {
        flex: 1;
        text-align: center;
    }
}

/* Never cover an open dialog (its Save/Cancel buttons sit at the bottom). */
body:has(.modal-overlay.open, .admin-drawer-overlay.active, dialog[open]) .cpp-cookie-banner {
    display: none;
}
