/* =========================================
   1. STYLE GLOBALNE I RESET
   ========================================= */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    color: #333;
}

/* =========================================
   2. NAWIGACJA (Navbar)
   ========================================= */
.navbar {
    background-color: #d63384;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.navbar a, .navbar button {
    color: white;
    text-decoration: none;
    background: none;
    border: 1px solid white;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    transition: 0.3s;
}

.navbar a:hover, .navbar button:hover {
    background: white;
    color: #d63384;
}

/* =========================================
   3. SEKCJA POWITALNA (Hero)
   ========================================= */
.hero {
    background: linear-gradient(rgba(214, 51, 132, 0.8), rgba(214, 51, 132, 0.6)), 
                url('https://images.unsplash.com/photo-1560750588-73207b1ef5b8?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 { 
    font-size: 3rem; 
    margin-bottom: 10px; 
    color: white; 
}

/* =========================================
   4. UKŁAD GŁÓWNY (Main Layout)
   ========================================= */
.main-layout {
    display: flex;
    gap: 30px;
    max-width: 1300px; /* Nieco szerzej dla lepszego oddechu */
    margin: 40px auto; /* Większy odstęp od banera Hero */
    padding: 0 20px;
    align-items: flex-start;
}

.services-column {
    flex: 2.5;
}

/* =========================================
   5. KARTY USŁUG
   ========================================= */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.service-row {
    background: white;
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    text-align: center;
    min-height: 280px;
}

.service-row:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(214, 51, 132, 0.1);
    border-color: #d63384;
}

.service-icon {
    font-size: 2.5rem;
    color: #d63384;
    margin-bottom: 15px;
}

.service-details h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3rem;
}

.service-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4;
}

.service-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #d63384;
    margin-bottom: 15px;
}

.btn-book {
    background-color: #d63384;
    color: white;
    padding: 10px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-book:hover {
    background-color: #b02a6a;
}

/* =========================================
   6. SIDEBAR I KALENDARZ (FullCalendar)
   ========================================= */
/* Kontener Sidebaru */
.calendar-sidebar {
    flex: 1.2;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    /* Usuwamy ewentualny margines górny, by wyrównać z usługami */
    margin-top: 0; 
}

.sidebar-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* Układ Toolbara: Przyciski obok Tytułu */
.fc .fc-toolbar {
    display: flex !important;
    flex-direction: row !important;
    /* Centrujemy całość, by przyciski były blisko tekstu */
    justify-content: center !important; 
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
}

/* Układamy elementy wewnątrz toolbara w jednej linii */
.fc-toolbar-chunk {
    display: flex !important;
    align-items: center !important;
}

.fc .fc-toolbar-title {
    font-size: 0.9rem !important;
    color: #d63384 !important;
    text-transform: capitalize;
    margin: 0 !important; /* Reset marginesu dla precyzji */
    font-weight: bold;
}

/* Stylizacja małych przycisków < > */
.fc .fc-button {
    background-color: transparent !important;
    border: 1px solid #d63384 !important;
    color: #d63384 !important;
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    height: 24px !important;
    width: 24px !important;
}

.fc .fc-button:hover {
    background-color: #d63384 !important;
    color: white !important;
}

/* Naprawa siatki dni - symetria */
#calendar {
    max-width: 100%;
    font-size: 0.75rem;
}

.fc-col-header-cell-cushion {
    font-size: 0.65rem !important;
    text-transform: uppercase;
    color: #555;
    padding: 8px 0 !important;
    display: block !important;
}

.fc-daygrid-day-number {
    font-size: 0.75rem;
    padding: 4px !important;
    text-decoration: none !important;
    color: #333;
}

.fc-daygrid-day-frame {
    min-height: 35px !important;
    border: none !important; /* Usuwamy ramki wewnętrzne dla czystszego widoku */
}

/* =========================================
   7. MODALE I ALERTY
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    position: relative;
}

.close {
    position: absolute; right: 20px; top: 10px;
    font-size: 24px; cursor: pointer; color: #aaa;
}

.alert {
    padding: 15px;
    margin: 10px;
    border-radius: 5px;
    color: white;
    background-color: #28a745;
    text-align: center;
}

/* =========================================
   8. SLOTY CZASOWE W MODALU (Grafik Dnia)
   ========================================= */

/* Kontener siatki godzin */
.time-slot-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

/* Podstawowy styl kafelka godziny */
.time-slot {
    padding: 12px 8px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.time-slot span {
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
}

.time-slot small {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.9;
}

/* Styl dla WOLNEGO terminu (Zielony) */
.time-slot.free {
    background-color: #f0fff4;
    border-color: #28a745;
    color: #28a745;
    cursor: pointer;
}

.time-slot.free:hover {
    background-color: #28a745;
    color: white;
    transform: scale(1.05);
}

/* Styl dla ZAJĘTEGO terminu (Czerwony) */
.time-slot.occupied {
    background-color: #fff5f5;
    border-color: #dc3545;
    color: #dc3545;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Dopasowanie szerokości modalu dla grafiku */
#dayDetailsModal .modal-content {
    max-width: 500px; /* Nieco szerszy, by zmieścić 3-4 kafelki w rzędzie */
}

/* =========================================
   9. MODAL - TWOJE REZERWACJE
   ========================================= */

.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Karta pojedynczej wizyty */
.appointment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.appointment-item:hover {
    border-color: #d63384;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.1);
}

/* Sekcja z informacjami o wizycie (lewa strona) */
.app-info strong {
    color: #d63384;
    font-size: 1.1rem;
    display: inline-block;
    margin-bottom: 5px;
}

.app-info span {
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
}

.app-info small {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Przycisk akcji (prawa strona) */
.btn-cancel {
    background-color: white;
    color: #dc3545; /* Ostrzegawczy czerwony */
    border: 1px solid #dc3545;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.3s;
    white-space: nowrap; /* Zapobiega łamaniu tekstu w przycisku */
}

.btn-cancel:hover {
    background-color: #dc3545;
    color: white;
}

/* Komunikat o braku wizyt */
.empty-msg {
    text-align: center;
    color: #777;
    padding: 20px;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 10px;
}

/* =========================================
   10. MODALE LOGOWANIA I REJESTRACJI
   ========================================= */

/* 1. Stylizacja samej karty modalu (Spójna z "Twoje Rezerwacje") */
.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px; /* Zaokrąglone rogi karty */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1); /* Delikatny cień */
    border: 1px solid #eee;
}

/* 2. Stylizacja tytułu h2 w modalu (np. "Zaloguj się") */
.modal-content h2 {
    color: #d63384; /* Twój różowy kolor przewodni */
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
}

/* 3. Stylizacja pól wejściowych (Inputów) wewnątrz formularzy modalu */
.modal-content form input[type="text"],
.modal-content form input[type="password"] {
    width: 100%; /* Pełna szerokość karty */
    padding: 12px; /* Więcej miejsca wewnątrz */
    margin-bottom: 15px; /* Odstęp od kolejnego pola */
    border: 1px solid #ccc; /* Delikatne obramowanie */
    border-radius: 8px; /* Zaokrąglone rogi */
    font-family: inherit; /* Użyj czcionki projektu */
    font-size: 0.95rem;
    color: #555;
    transition: 0.3s; /* Płynna zmiana koloru */
    box-sizing: border-box; /* Zapewnia poprawną szerokość */
}

/* Efekt po kliknięciu w pole (Focus) */
.modal-content form input[type="text"]:focus,
.modal-content form input[type="password"]:focus {
    border-color: #d63384; /* Różowe obramowanie */
    box-shadow: 0 0 5px rgba(214, 51, 132, 0.1); /* Delikatna poświata */
    outline: none; /* Usuń standardową ramkę */
}

/* 4. Stylizacja przycisku wysyłania (Submit) */
.modal-content form input[type="submit"],
.modal-content form button[type="submit"] {
    width: 100%; /* Pełna szerokość */
    background-color: #d63384; /* Różowe tło */
    color: white; /* Biały tekst */
    border: none; /* Usuń surowe obramowanie */
    padding: 12px;
    border-radius: 20px; /* Zaokrąglone rogi przycisku */
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.modal-content form input[type="submit"]:hover,
.modal-content form button[type="submit"]:hover {
    background-color: #b02a6a; /* Ciemniejszy róż na hover */
}

/* Styl dla: No-Show (Szary) */
.btn-secondary-light {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #9ca3af;
}
.btn-secondary-light:hover { background-color: #6b7280; color: white; }
.bg-secondary { background-color: #6b7280; }

/* =========================================
   11. RESPONSYWNOŚĆ
   ========================================= */
@media (max-width: 992px) {
    .main-layout { 
        flex-direction: column; 
    }
    .calendar-sidebar { 
        width: 100%; 
        position: static; 
    }
    .navbar {
        padding: 15px 20px;
    }
}