/* ══════════════════════════════════════════════════════════════════════════
   POWERS 60+ – Główny arkusz stylów
   Kolorystyka: Turkus (#009B8D) + szary (#8C8C8C) z logo
   WCAG 2.1 AA Compliance
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ───────────────────────────────────────────────────────── */
:root {
    --powers-teal: #009B8D;
    --powers-teal-dark: #007A6E;
    --powers-teal-light: #00BFA9;
    --powers-teal-pale: #E0F5F2;
    --powers-gray: #8C8C8C;
    --powers-gray-dark: #4A4A4A;
    --powers-gray-light: #B8B8B8;
    --powers-accent: #E8A838;
    --powers-accent-dark: #D4922A;
    --powers-bg: #FAFBFC;
    --powers-text: #2D3436;
    --powers-text-light: #636E72;
    --powers-white: #FFFFFF;
    --powers-danger: #D63031;
    --powers-success: #00B894;
    --powers-radius: 12px;
    --powers-radius-sm: 8px;
    --powers-shadow: 0 2px 16px rgba(0, 155, 141, 0.08);
    --powers-shadow-lg: 0 8px 32px rgba(0, 155, 141, 0.12);
    --powers-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-base: 1rem;
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--font-base);
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--powers-text);
    background-color: var(--powers-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Skip Link (WCAG) ───────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--powers-teal);
    color: var(--powers-white);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--powers-radius-sm) var(--powers-radius-sm);
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top var(--powers-transition);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--powers-accent);
    outline-offset: 2px;
}

/* ─── Focus styles (WCAG) ────────────────────────────────────────────────── */
*:focus-visible {
    outline: 3px solid var(--powers-accent);
    outline-offset: 2px;
}

/* ─── Accessibility Bar ──────────────────────────────────────────────────── */
.accessibility-bar {
    background: var(--powers-gray-dark);
    color: var(--powers-white);
    font-size: 0.8rem;
}

.accessibility-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.btn-accessibility {
    color: var(--powers-white);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: all var(--powers-transition);
    line-height: 1.3;
}

.btn-accessibility:hover,
.btn-accessibility:focus {
    background: rgba(255,255,255,0.2);
    color: var(--powers-white);
    border-color: rgba(255,255,255,0.6);
}

.btn-accessibility.active {
    background: var(--powers-accent);
    border-color: var(--powers-accent);
    color: #000;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────── */
.bg-powers {
    background: linear-gradient(135deg, var(--powers-teal-dark) 0%, var(--powers-teal) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-size: 1.1rem;
}

.brand-text {
    letter-spacing: 0.5px;
}

.brand-60 {
    color: var(--powers-gray-light);
    font-weight: 400;
}

.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: var(--powers-radius-sm);
    transition: all var(--powers-transition);
    font-size: 0.9rem;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    color: var(--powers-white);
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Hero Section ───────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(160deg, #045149 0%, #162423 40%, #05312C 100%);
    color: var(--powers-white);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,0,0,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero .lead {
    font-size: 1.2rem;
    opacity: 0.92;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

/* ─── Section Titles ─────────────────────────────────────────────────────── */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--powers-teal-dark);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--powers-text-light);
    font-size: 1.1rem;
    max-width: 600px;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--powers-teal), var(--powers-accent));
    border: none;
    border-radius: 2px;
    margin: 1rem 0 2rem;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card-powers {
    border: none;
    border-radius: var(--powers-radius);
    box-shadow: var(--powers-shadow);
    transition: all var(--powers-transition);
    overflow: hidden;
    background: var(--powers-white);
}

.card-powers:hover {
    box-shadow: var(--powers-shadow-lg);
    transform: translateY(-4px);
}

.card-powers .card-body {
    padding: 1.5rem;
}

.card-powers .card-title {
    font-weight: 700;
    color: var(--powers-teal-dark);
    margin-bottom: 0.75rem;
}

/* Obszar card z ikoną */
.obszar-card {
    text-align: center;
    padding: 2rem 1.5rem;
    cursor: pointer;
    position: relative;
}

.obszar-card .obszar-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: var(--powers-white);
    transition: all var(--powers-transition);
}

.obszar-card:hover .obszar-icon {
    transform: scale(1.1);
}

.obszar-card .card-title {
    font-size: 1rem;
}

/* ─── Badges & Tags ──────────────────────────────────────────────────────── */
.badge-powers {
    background: var(--powers-teal-pale);
    color: var(--powers-teal-dark);
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
}

.badge-level-easy {
    background: #D5F5E3;
    color: #1E8449;
}

.badge-level-medium {
    background: #FEF9E7;
    color: #B7950B;
}

.badge-level-hard {
    background: #FADBD8;
    color: #C0392B;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-powers {
    background: linear-gradient(135deg, var(--powers-teal) 0%, var(--powers-teal-dark) 100%);
    color: var(--powers-white);
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: var(--powers-radius-sm);
    font-weight: 600;
    transition: all var(--powers-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-powers:hover {
    background: linear-gradient(135deg, var(--powers-teal-dark) 0%, #005F55 100%);
    color: var(--powers-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 155, 141, 0.3);
}

.btn-powers-outline {
    background: transparent;
    color: var(--powers-teal);
    border: 2px solid var(--powers-teal);
    padding: 0.6rem 1.5rem;
    border-radius: var(--powers-radius-sm);
    font-weight: 600;
    transition: all var(--powers-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-powers-outline:hover {
    background: var(--powers-teal);
    color: var(--powers-white);
}

.btn-accent {
    background: linear-gradient(135deg, var(--powers-accent) 0%, var(--powers-accent-dark) 100%);
    color: #000;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: var(--powers-radius-sm);
    font-weight: 700;
    transition: all var(--powers-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 168, 56, 0.3);
    color: #000;
}

/* ─── Wyszukiwarka - Filtry ──────────────────────────────────────────────── */
.filter-panel {
    background: var(--powers-white);
    border-radius: var(--powers-radius);
    box-shadow: var(--powers-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-panel label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--powers-text);
    margin-bottom: 0.35rem;
}

.filter-panel .form-select,
.filter-panel .form-control {
    border-radius: var(--powers-radius-sm);
    border: 2px solid #E0E0E0;
    transition: all var(--powers-transition);
}

.filter-panel .form-select:focus,
.filter-panel .form-control:focus {
    border-color: var(--powers-teal);
    box-shadow: 0 0 0 3px rgba(0, 155, 141, 0.15);
}

/* Aktywność result card */
.aktywnosc-result {
    border-left: 4px solid var(--powers-teal);
    margin-bottom: 1rem;
    transition: all var(--powers-transition);
}

.aktywnosc-result:hover {
    border-left-color: var(--powers-accent);
}

/* ─── Scenariusz Steps ───────────────────────────────────────────────────── */
.step-timeline {
    position: relative;
    padding-left: 3rem;
}

.step-timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--powers-teal) 0%, var(--powers-teal-pale) 100%);
    border-radius: 2px;
}

.step-item {
    position: relative;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--powers-white);
    border-radius: var(--powers-radius-sm);
    box-shadow: var(--powers-shadow);
}

.step-item::before {
    content: attr(data-step);
    position: absolute;
    left: -2.75rem;
    top: 1.25rem;
    width: 2rem;
    height: 2rem;
    background: var(--powers-teal);
    color: var(--powers-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ─── Grywalizacja (Element 6) ───────────────────────────────────────────── */
.gamification-path {
    position: relative;
}

.gamy-step {
    background: var(--powers-white);
    border-radius: var(--powers-radius);
    box-shadow: var(--powers-shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all var(--powers-transition);
    border-left: 5px solid var(--powers-gray-light);
    position: relative;
}

.gamy-step.done {
    border-left-color: var(--powers-success);
    background: linear-gradient(135deg, #F0FFF4 0%, var(--powers-white) 100%);
}

.gamy-step .step-number {
    width: 50px;
    height: 50px;
    background: var(--powers-teal);
    color: var(--powers-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
}

.gamy-step.done .step-number {
    background: var(--powers-success);
}

.gamy-progress-bar {
    height: 12px;
    border-radius: 6px;
    background: #E0E0E0;
    overflow: hidden;
}

.gamy-progress-bar .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--powers-teal), var(--powers-success));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.points-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--powers-teal);
}

/* ─── Mapa ───────────────────────────────────────────────────────────────── */
#map-container {
    height: 500px;
    border-radius: var(--powers-radius);
    overflow: hidden;
    box-shadow: var(--powers-shadow);
}

/* ─── Opinie / Cytaty ────────────────────────────────────────────────────── */
.cytat-card {
    background: var(--powers-white);
    border-radius: var(--powers-radius);
    box-shadow: var(--powers-shadow);
    padding: 2rem;
    position: relative;
    margin-bottom: 1.5rem;
}

.cytat-card::before {
    content: '\201C';
    font-size: 4rem;
    color: var(--powers-teal-pale);
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-family: Georgia, serif;
    line-height: 1;
}

.cytat-card .cytat-text {
    font-style: italic;
    font-size: 1.05rem;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.cytat-card .cytat-autor {
    font-weight: 600;
    color: var(--powers-teal-dark);
}

/* ─── Main content area ──────────────────────────────────────────────────── */
main {
    min-height: calc(100vh - 200px);
    padding-bottom: 3rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
    background: #1A2332 !important;
    margin-top: auto;
}

.footer a {
    transition: all var(--powers-transition);
}

.footer a:hover {
    opacity: 1 !important;
    color: var(--powers-teal-light) !important;
}

/* ─── Admin Panel ────────────────────────────────────────────────────────── */
.admin-sidebar {
    background: #1A2332;
    min-height: 100vh;
    padding-top: 1rem;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 1rem;
    border-radius: var(--powers-radius-sm);
    margin: 0.1rem 0.5rem;
    font-size: 0.9rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(0, 155, 141, 0.3);
    color: var(--powers-white);
}

.stat-card {
    border: none;
    border-radius: var(--powers-radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--powers-teal);
}

/* ─── Wysoki kontrast (WCAG) ─────────────────────────────────────────────── */
body.high-contrast {
    --powers-bg: #000000;
    --powers-text: #FFFFFF;
    --powers-white: #1A1A1A;
    --powers-teal: #00E5D4;
    --powers-teal-dark: #00FFE5;
    --powers-teal-pale: #002A26;
    --powers-shadow: 0 2px 16px rgba(0, 229, 212, 0.15);
}

body.high-contrast .navbar {
    background: #000 !important;
    border-bottom: 2px solid var(--powers-teal);
}

body.high-contrast .card-powers,
body.high-contrast .filter-panel,
body.high-contrast .step-item,
body.high-contrast .gamy-step,
body.high-contrast .cytat-card {
    background: #1A1A1A;
    border: 1px solid #444;
}

body.high-contrast .footer {
    background: #000 !important;
    border-top: 2px solid var(--powers-teal);
}

body.high-contrast a {
    color: var(--powers-teal);
}

/* ─── Dyslexia font (WCAG) ──────────────────────────────────────────────── */
body.dyslexia-font {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Trebuchet MS', sans-serif;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
}

/* ─── Font scaling ───────────────────────────────────────────────────────── */
body.font-size-sm { font-size: 0.875rem; }
body.font-size-md { font-size: 1rem; }
body.font-size-lg { font-size: 1.125rem; }
body.font-size-xl { font-size: 1.25rem; }
body.font-size-xxl { font-size: 1.375rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .filter-panel {
        padding: 1rem;
    }

    #map-container {
        height: 350px;
    }

    .gamy-step {
        padding: 1.25rem;
    }
}

@media (max-width: 576px) {
    .accessibility-bar .container {
        flex-wrap: wrap;
        justify-content: center !important;
    }

    .hero h1 {
        font-size: 1.5rem;
    }
}

/* ─── Animacje wejścia ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .fade-in-up {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .fade-in-up.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Print ──────────────────────────────────────────────────────────────── */
@media print {
    .accessibility-bar,
    .navbar,
    .footer,
    .skip-link,
    .btn-powers,
    .btn-accent {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }
}