:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #6366f1;
    --accent-secondary: #ec4899;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --success: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 2rem;
}

/* Tło i Efekty */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 50%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    transform: translateX(-50%);
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Typography & Header */
.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.hero {
    text-align: center;
    animation: fadeInDown 0.8s ease-out forwards;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Builder Layout (Grid) */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
}

/* Filtry */
.filters-section {
    padding: 1rem 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.category-description {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.program-format-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.program-format-info em {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

/* Katalog Programów */
.programs-catalog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.program-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.program-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.3s ease;
}

.program-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.program-card.selected {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.program-card.selected::before {
    background: var(--accent-primary);
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.program-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.program-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.program-full-desc {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border-left: 2px solid var(--accent-secondary);
    margin: 0.5rem 0;
    animation: fadeInDown 0.3s ease-out forwards;
}

.expand-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    padding: 0;
    margin-top: 0.25rem;
    font-family: inherit;
    transition: color 0.2s;
}

.expand-btn:hover {
    color: var(--accent-secondary);
}

.program-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.target-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.target-badge.student {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.target-badge.parent {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
}

.target-badge.teacher {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

/* Panel Boczny / Koszyk */
.sticky-sidebar {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideInRight 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.summary-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.75rem;
}

.selected-count {
    font-size: 0.875rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.selected-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
.selected-list::-webkit-scrollbar {
    width: 6px;
}

.selected-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.selected-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.selected-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.selected-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: var(--danger);
}

.empty-selection {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-selection .emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Formularz Kontaktowy */
.form-section {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
    transition: opacity 0.3s ease;
}

.form-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1rem;
}

.row-group {
    display: flex;
    gap: 1rem;
}

.row-group input {
    flex: 1;
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

option {
    background: #1a1a1a;
    color: white;
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), #818cf8);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    margin-top: 1rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

/* Utils & Animacje */
.hidden {
    display: none !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- WCAG Widget --- */
.wcag-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.wcag-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
    outline: none;
}

.wcag-btn:hover,
.wcag-btn:focus-visible {
    transform: scale(1.1);
    background: var(--accent-secondary);
}

.wcag-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    transform-origin: bottom right;
    transition: opacity 0.3s, transform 0.3s;
}

.wcag-menu.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.wcag-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s, border-color 0.2s;
    text-align: left;
    font-family: 'Outfit', sans-serif;
}

.wcag-option:hover,
.wcag-option:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-primary);
    outline: none;
}

/* --- Stan Aktywny WCAG --- */

/* 1. Wysoki Kontrast */
body.wcag-high-contrast {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: #dddddd;
    --accent-primary: #ffff00;
    --accent-secondary: #ffcc00;
}

body.wcag-high-contrast * {
    text-shadow: none !important;
}

body.wcag-high-contrast .glass-panel,
body.wcag-high-contrast .program-card,
body.wcag-high-contrast textarea,
body.wcag-high-contrast input,
body.wcag-high-contrast select {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

body.wcag-high-contrast .chip,
body.wcag-high-contrast .target-badge {
    border: 1px solid #ffffff !important;
}

/* 2. Powiększony Tekst */
body.wcag-large-text {
    font-size: 130%;
}

body.wcag-large-text h1,
body.wcag-large-text h2,
body.wcag-large-text h3 {
    font-size: 140%;
}

body.wcag-large-text .btn-submit,
body.wcag-large-text .wcag-option,
body.wcag-large-text .program-desc {
    font-size: 1.1rem;
}

/* 3. Podświetlenie Focusu (dla klawiatury) */
body.wcag-show-focus *:focus,
body.wcag-show-focus *:focus-visible {
    outline: 4px solid var(--accent-primary) !important;
    outline-offset: 3px !important;
}