/* Banner */
.banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #fff;
    padding: 1.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.banner.hidden {
    transform: translateY(100%);
}

.banner__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.banner__message {
    font-size: 0.95rem;
}

.banner__message a {
    color: #e0e7ff;
    text-decoration: underline;
    font-weight: 600;
}

.banner__message a:hover {
    text-decoration: none;
}

.banner__message a:focus {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
}

.banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.banner__button {
    background: #ffffff;
    color: #1e293b;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 600;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.banner__button:hover {
    background: #f1f5f9;
}

.banner__button:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.banner__button:active {
    background: #e2e8f0;
}

.banner__button--secondary {
    background: #f1f5f9;
    color: #1e293b;
}

.banner__button--secondary:hover {
    background: #e2e8f0;
}

.banner__button--secondary:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.banner__button--outline {
    background: transparent;
    border: 2px solid #e0e7ff;
    color: #ffffff;
}

.banner__button--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

.banner__button--outline:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* Panel */
.panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: #fff;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.panel.active {
    transform: translateX(0);
}

.panel__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.panel__overlay.active {
    opacity: 1;
    pointer-events: all;
}

.panel__content {
    overflow-y: auto;
    flex: 1;
}

.panel__header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.panel__header h2 {
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 600;
    margin: 0;
}

.panel__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1e293b;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.panel__close:hover {
    background: #f1f5f9;
}

.panel__close:focus {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
}

.panel__close:active {
    background: #e2e8f0;
}

.panel__body {
    padding: 1.5rem;
    color: #334155;
}

.panel__footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    background: #f9fafb;
}

.panel__button {
    background: #0369a1;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 600;
    flex: 1;
    min-height: 44px;
}

.panel__button:hover {
    background: #0284c7;
}

.panel__button:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.panel__button:active {
    background: #0c4a6e;
}

.panel__button--secondary {
    background: transparent;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.panel__button--secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.panel__button--secondary:focus {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
}

.panel__button--secondary:active {
    background: #e2e8f0;
}

/* Category */
.category {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.category:last-child {
    border-bottom: none;
}

.category__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.category__title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    margin-bottom: 0.25rem;
}

.category__desc {
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
    margin: 0;
}

/* Toggle */
.toggle {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle__slider:before {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle__slider {
    background: #3b82f6;
}

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

.toggle input:disabled + .toggle__slider {
    opacity: 0.6;
    cursor: not-allowed;
    background: #cbd5e1;
}

.toggle input:focus + .toggle__slider {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
}

/* Body state */
body.panel-open {
    overflow: hidden;
}

/* Skip Link (for keyboard navigation) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e293b;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Responsive */
@media (max-width: 767px) {
    .panel {
        max-width: 100%;
    }

    .panel__header h2 {
        font-size: 1.125rem;
    }

    .panel__body {
        padding: 1rem;
    }

    .panel__footer {
        padding: 1rem;
        flex-direction: column;
    }

    .panel__button {
        width: 100%;
    }

    .category {
        padding: 1rem 0;
    }
}

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

    .banner__message {
        flex: 1;
        margin-right: 2rem;
    }

    .banner__actions {
        flex-shrink: 0;
    }

    .panel {
        max-width: 420px;
    }
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
    .banner {
        transition: none;
    }

    .panel {
        transition: none;
    }

    .panel__overlay {
        transition: none;
    }

    .banner__button,
    .panel__button,
    .panel__close,
    .toggle__slider,
    .toggle__slider:before {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .banner__button:focus,
    .panel__button:focus,
    .panel__close:focus,
    .toggle input:focus + .toggle__slider {
        outline-width: 3px;
    }
}
