/* ======================= RESET I PODSTAWOWE ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f7f9fc;
    color: #2c3e50;
    line-height: 1.6;
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ======================= NAVBAR ======================= */
header {
    position: relative;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #2c3e50;
    color: #ecf0f1;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links li a {
    color: #ecf0f1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links li a:hover {
    color: #e74c3c;
    transform: translateY(-2px);
}

.btn-login {
    padding: 10px 20px;
    background: #e74c3c;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: #ecf0f1;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 40px;
    background-color: #2c3e50;
    padding: 20px;
    border-radius: 8px;
    gap: 15px;
}

/* ======================= HERO ======================= */
.hero, .login-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
}

.hero::after, .login-hero::before {
    content: '';
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.35);
    z-index:0;
}

.hero h1, .hero p, .login-card {
    position: relative;
    z-index: 1;
}

.hero {
    padding: 160px 20px 120px;
    background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url('/uploads/ministranci1.jpg') no-repeat center center/cover;
    background-attachment: fixed;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.5);
}

.btn-primary {
    padding: 14px 32px;
    background-color: #e74c3c;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ======================= SEKCE ======================= */
.section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    color: #34495e;
    position: relative;
}

.section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: #e74c3c;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ======================= KARTY ======================= */
.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.card {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0px 6px 20px rgba(0,0,0,0.1);
    flex: 1 1 300px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.card.appear {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0px 12px 30px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.card p {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.card small {
    color: #7f8c8d;
    font-style: italic;
}

.read-more {
    color: #e74c3c;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}

/* ======================= FADE-IN ======================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* ======================= LOGIN ======================= */
.login-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url('/images/hero-default.jpg') no-repeat center center/cover;
    position: relative;
}

.login-hero::before {
    background: rgba(44, 62, 80, 0.7);
}

.login-card {
    position: relative;
    background: rgba(255,255,255,0.95);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0px 8px 25px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.login-card.appear {
    opacity: 1;
    transform: translateY(0);
}

.login-card h1 {
    margin-bottom: 25px;
    color: #2c3e50;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-card input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231,76,60,0.5);
    outline: none;
}

.login-card button.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.login-card button.btn-primary:hover {
    background-color: #c0392b;
    transform: scale(1.03);
}

.login-footer {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 15px;
}

.btn-secondary {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #34495e;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn-secondary:hover {
    background-color: #2c3e50;
    transform: scale(1.03);
}

/* ======================= FOOTER ======================= */
footer {
    text-align: center;
    padding: 40px 20px;
    background-color: #2c3e50;
    color: #ecf0f1;
}

/* ======================= RESPONSYWNOŚĆ ======================= */
@media(max-width: 992px) {
    .cards { gap: 20px; }
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.2rem; }
}

@media(max-width: 768px) {
    .hamburger { display: flex; }
    .nav-links { display: none; }
    .cards { flex-direction: column; align-items: center; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1.1rem; }
    .login-card { max-width: 90%; padding: 30px 20px; }
}

@media(max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .login-card input, .login-card button { font-size: 0.95rem; padding: 10px; }
}

/* Poprawa wyglądu dat w tabeli niedziel */
.duty-table .date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.95rem;
}

.duty-table .date-cell .weekday {
    font-size: 0.85rem;
    color: #34495e;
}

.duty-table .date-cell .full-date {
    font-size: 0.95rem;
}

/* Stylowanie dla przypisanych użytkowników */
.duty-card {
    padding: 3px 6px;
    margin: 2px 0;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.duty-card.my-duty {
    background-color: #d1e7dd;
    font-weight: bold;
}

.badge {
    margin-left: 5px;
    padding: 1px 4px;
    background-color: #0d6efd;
    color: white;
    font-size: 0.7rem;
    border-radius: 3px;
}

.no-duty {
    color: #999;
    font-style: italic;
}


.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.scrollable-table {
    max-height: 300px;
    overflow-y: auto;
}

.scrollable-table table {
    width: 100%;
    border-collapse: collapse;
}

.scrollable-table th, .scrollable-table td {
    border: 1px solid #ccc;
    padding: 6px;
    text-align: left;
}

.action-btn {
    padding: 3px 6px;
    font-size: 0.8em;
    border-radius: 3px;
    margin-right: 3px;
    cursor: pointer;
}

.action-btn.edit { background: #2980b9; color: white; }
.action-btn.delete { background: #c0392b; color: white; }


.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.scrollable-table {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.scrollable-table table {
    width: 100%;
    border-collapse: collapse;
}

.scrollable-table th, .scrollable-table td {
    border: 1px solid #ccc;
    padding: 6px;
    text-align: left;
    vertical-align: middle;
}

.action-btn {
    padding: 3px 6px;
    font-size: 0.8em;
    border-radius: 3px;
    margin-right: 3px;
    cursor: pointer;
    border: none;
}

.action-btn.edit { background: #2980b9; color: white; }
.action-btn.delete { background: #c0392b; color: white; }

.role-label {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.85em;
    color: white;
}

.role-Admin { background: #e74c3c; }
.role-Ksiądz { background: #8e44ad; }
.role-Lektor { background: #3498db; }
.role-Animator { background: #27ae60; }
.role-Kandydat { background: #f39c12; }
.role-Gość { background: #7f8c8d; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    background: #f4f6f8;
    color: #333;
}
nav {
    width: 220px;
    background: #2c3e50;
    color: white;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}
nav h2 {
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
}
.nav-links { list-style: none; padding: 0; }
.nav-links li { margin-bottom: 12px; }
.nav-links a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    transition: 0.3s;
}
.nav-links a:hover { background: #34495e; }

main {
    flex: 1;
    padding: 25px;
    overflow-x: auto;
}

/* Tabele */
.table-container { overflow-x:auto; margin-bottom: 25px; }
table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
th, td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
th { background: #ecf0f1; font-weight: 600; }
tbody tr:hover { background: #f9f9f9; }

/* Buttons */
.btn {
    background: #2980b9;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9em;
}
.btn:hover { background: #3498db; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #e74c3c; }
form.inline { display: inline-block; margin: 0 3px; }

/* Dyżury jako karty */
.duty-card {
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 6px;
    background: #eaf2f8;
    border-left: 4px solid #2980b9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.duty-card.admin { border-color: #c0392b; background: #fdecea; }
.duty-card.Ksiądz { border-color: #27ae60; background: #e9f7ef; }
.duty-card span { font-weight: 500; }

/* Formularze */
form { display: flex; flex-direction: column; gap: 12px; max-width: 600px; margin-bottom: 25px; }
form input, form select, form textarea, form button {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.95em;
}
form button { width: fit-content; background: #2980b9; color: #fff; }
form button:hover { background: #3498db; }

/* Miniaturki zdjęć */
img.thumb { max-width: 80px; max-height: 50px; border-radius: 4px; object-fit: cover; }

/* Responsywność */
@media(max-width: 900px){
    nav { width: 180px; padding: 15px; }
    .nav-links a { padding: 8px 10px; font-size: 0.9em; }
    table, th, td { font-size: 0.85em; }
}
@media(max-width: 600px){
    body { flex-direction: column; }
    nav { width: 100%; min-height: auto; }
    main { padding: 15px; }
}

.table-container {
    max-height: 400px; /* wysokość przewijanej tabeli */
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Nagłówki tabeli zawsze widoczne */
.table-container table th {
    position: sticky;
    top: 0;
    background: #ecf0f1;
    z-index: 2;
}


.duty-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
}

.duty-table th {
    position: sticky;
    top: 0;
    background: #ecf0f1;
    z-index: 2;
}



