:root {
    --primary-red: #D32F2F;
    --dark-red: #9A0007;
    --primary-yellow: #FFC107;
    --light-yellow: #FFF8E1;
    --dark-text: #212121;
    --light-text: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f4f4f4;
    color: var(--dark-text);
    line-height: 1.6;
}

/* Nagłówek z animacją wejścia */
header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: var(--light-text);
    text-align: center;
    padding: 2.5rem 1rem;
    border-bottom: 6px solid var(--primary-yellow);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.header-content {
    animation: heroEnter 1.1s ease both;
}

.logo-container {
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
    border: 4px solid var(--primary-yellow);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background-color: var(--primary-yellow);
    transition: transform 0.4s ease;
}

.logo-container:hover {
    transform: scale(1.05);
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

header h1 {
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.4rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    animation: titleEnter 1.3s ease both;
}

header p {
    font-size: 1.15rem;
    color: var(--primary-yellow);
    font-weight: bold;
    letter-spacing: 1px;
}

/* Sekcja pod nagłówkiem z efektem paralaksy */
.main-wrapper {
    background-color: #f4f4f4;
    background-image: linear-gradient(rgba(244, 244, 244, 0.72), rgba(244, 244, 244, 0.72)), url('tlo-shotokan.png');
    background-size: cover;
    background-position: center 0px;
    background-repeat: no-repeat;
    padding: 2rem 0 1rem 0;
    overflow: hidden;
}

/* Główna zawartość */
.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Karty sekcji z animacją wyłaniania */
.card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-top: 4px solid var(--primary-red);

    /* Stan początkowy przed pojawieniem się na ekranie */
    opacity: 0;
    transform: translateY(45px);
    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dekoracyjne koło Enso w rogu każdej sekcji */
.card::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 170px;
    height: 170px;
    border: 12px solid rgba(211, 47, 47, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

/* Nagłówki sekcji z efektem japońskiego pędzla */
h2 {
    position: relative;
    display: table;
    color: var(--primary-red);
    padding-bottom: 14px;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 7px;
    background: var(--primary-red);
    border-radius: 70% 10% 60% 20%;
    clip-path: polygon(
        0 20%, 100% 0, 95% 70%,
        12% 100%, 3% 70%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s ease 0.2s;
}

.card.visible h2::after {
    transform: scaleX(1);
}

/* Sekcja O klubie */
.about-text {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feature-badge {
    position: relative;
    overflow: hidden;
    background-color: #fafafa;
    border: 1px solid #eee;
    border-top: 3px solid var(--primary-yellow);
    padding: 1.1rem 0.9rem;
    border-radius: 6px;
    text-align: center;
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        background-color 0.35s ease;
}

.feature-badge:hover {
    transform: translateY(-8px);
    background-color: var(--light-yellow);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.feature-badge::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 4px;
    background: var(--primary-red);
    transition: width 0.35s ease;
}

.feature-badge:hover::after {
    width: 100%;
}

.feature-badge strong {
    display: block;
    color: var(--dark-red);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.feature-badge span {
    font-size: 0.9rem;
    color: #555;
}

.instructor-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--light-yellow);
    border-left: 5px solid var(--primary-yellow);
    padding: 1.2rem;
    border-radius: 6px;
    font-size: 1.15rem;
}

.instructor-photo {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 3px solid var(--primary-red);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background-color: #fff;
}

.instructor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.instructor-info span {
    display: block;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.2rem;
}

.instructor-info strong {
    color: var(--dark-red);
    font-size: 1.25rem;
}

@media (max-width: 600px) {
    .instructor-box {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .instructor-photo {
        width: 130px;
        height: 130px;
    }
}

.instructor-box strong {
    color: var(--dark-red);
}

/* Tabela Rozkładu Zajęć */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
    font-size: 0.95rem;
}

thead th {
    background-color: var(--primary-red);
    color: var(--light-text);
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--dark-red);
    font-weight: bold;
}

tbody tr {
    transition: background-color 0.25s ease;
}

tbody td {
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
}

tbody tr:nth-child(even) {
    background-color: var(--light-yellow);
}

tbody tr:hover {
    background-color: #ffecb3;
}

.city-cell {
    font-weight: bold;
    color: var(--dark-red);
    display: block;
    font-size: 1.05rem;
}

.place-cell {
    font-size: 0.88rem;
    color: #555;
}

.time-badge {
    display: inline-block;
    background-color: #fff;
    border: 1px solid var(--primary-yellow);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: var(--dark-text);
    white-space: nowrap;
}

.empty-cell {
    color: #bbb;
    text-align: center;
}

/* Kontakt i przyciski */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.contact-item {
    background: #fafafa;
    padding: 1.2rem;
    border-radius: 6px;
    border: 1px solid #eee;
    border-bottom: 3px solid var(--primary-red);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
}

.contact-item h3 {
    color: var(--dark-red);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-item a {
    color: var(--dark-text);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.25s ease;
}

.contact-item a:hover {
    color: var(--primary-red);
}

/* Przycisk Facebook z animacją połysku */
.fb-btn {
    display: inline-block;
    position: relative;
    overflow: hidden;
    background-color: #1877F2;
    color: #fff !important;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    margin-top: 0.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.fb-btn:hover {
    background-color: #145dbf;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35);
}

.fb-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        110deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s ease;
}

.fb-btn:hover::before {
    left: 120%;
}

/* Stopka */
footer {
    background-color: var(--dark-text);
    color: #ccc;
    text-align: center;
    padding: 1.5rem;
    border-top: 4px solid var(--primary-yellow);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

/* Definicje klatek kluczowych (keyframes) */
@keyframes heroEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes titleEnter {
    from {
        opacity: 0;
        letter-spacing: 8px;
    }
    to {
        opacity: 1;
        letter-spacing: 1.5px;
    }
}

/* Wersja mobilna */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.7rem;
    }
    .card {
        padding: 1.2rem;
    }
}

/* Dostępność: ograniczenie animacji dla osób wrażliwych na ruch */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .card {
        opacity: 1;
        transform: none;
    }

    h2::after {
        transform: scaleX(1);
    }
}