/* Alapvető reset és box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Alapvető body stílusok */
body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(to bottom right, #6366F1, #818CF8); /* Indigo gradiens */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Középre igazítás helyett fentre igazítjuk az appot */
    padding: 1rem; /* p-4 Tailwind megfelelője */
    overflow-x: hidden; /* Megakadályozza a vízszintes scrollbarokat */
}

/* Fő konténer stílusok */
.main-container {
    max-width: 48rem; /* Alapértelmezett maximális szélesség */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0; /* Ne legyen extra felső margó, hogy teljesen fent legyen */
    margin-bottom: 1rem; /* Kisebb alsó margó */
}

/* Fő akció konténer magassága */
#main-action-container {
    /* Eltávolítva a fix magasság: a doboz pontosan akkora lesz, mint a benne lévő gomb vagy kártya */
}

/* Glassmorphism effekt */
.glassmorphism {
    background-color: rgba(255, 255, 255, 0.2); /* Enyhén áttetsző fehér */
    backdrop-filter: blur(10px); /* Homályosítás */
    -webkit-backdrop-filter: blur(10px); /* Safari támogatás */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Vékony, világos keret */
    border-radius: 1rem; /* rounded-2xl Tailwind megfelelője */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-xl Tailwind megfelelője */
    padding: 1rem; /* p-4 Tailwind megfelelője */
}

/* Gombok alapstílusai */
button {
    cursor: pointer;
    border: none;
    outline: none;
}

/* "Indulás Haza" gomb */
#go-home-button {
    width: 100%;
    padding: 1rem; /* Kisebb belső térköz, hogy ne legyen olyan hatalmas a gomb */
    background-color: #4F46E5; /* bg-indigo-600 Tailwind megfelelője */
    color: white;
    font-size: 1.5rem; /* text-2xl Tailwind megfelelője */
    font-weight: 700; /* font-bold Tailwind megfelelője */
    border-radius: 1rem; /* rounded-2xl Tailwind megfelelője */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-lg Tailwind megfelelője */
    transition: all 0.3s ease-in-out; /* transition-all duration-300 ease-in-out Tailwind megfelelője */
}
#go-home-button:hover {
    background-color: #4338CA; /* hover:bg-indigo-700 Tailwind megfelelője */
}
#go-home-button:focus {
    outline: none; /* focus:outline-none Tailwind megfelelője */
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.5); /* focus:ring-4 focus:ring-indigo-300 Tailwind megfelelője */
}
#go-home-button:active {
    transform: scale(0.95); /* active:scale-95 Tailwind megfelelője */
}

/* Sikeres mentés kártya */
#success-card {
    background-color: #22C55E; /* bg-green-500 Tailwind megfelelője */
    color: white;
    text-align: center;
    border-radius: 1rem; /* rounded-2xl Tailwind megfelelője */
    display: none; /* Alapból teljesen kikerül az elrendezésből, 0 pixel helyet foglal */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* p-4 Tailwind megfelelője */
}
#success-card.visible {
    display: flex; /* Ha megjelenik, flex elrendezést kap */
    animation: fadeInSlideDown 0.3s forwards; /* Animálva úszik be */
}
#success-card svg {
    width: 4rem; /* w-16 Tailwind megfelelője */
    height: 4rem; /* h-16 Tailwind megfelelője */
    color: white;
}
#success-card p {
    margin-top: 0.5rem; /* mt-2 Tailwind megfelelője */
    font-size: 1.25rem; /* text-xl Tailwind megfelelője */
    font-weight: 600; /* font-semibold Tailwind megfelelője */
}
/* Szöveg színe a zöld háttéren */
#success-card p {
    color: #E0E7FF; /* Világosabb indigó, hogy jobban olvasható legyen a zöldön */
}
#success-card .overtime-summary { /* Pontosabb szelektort használunk */
    margin-top: 0.25rem; /* mt-1 Tailwind megfelelője */
    font-size: 0.875rem; /* text-sm Tailwind megfelelője */
}
/* Opcionális feladat leírás mező */
#task-input-container {
    margin-top: 0.75rem; /* Kisebb hely a gomb/kártya alatt */
    display: none; /* visibility: hidden helyett display: none, hogy ne foglaljon helyet */
}
#task-input-container.visible {
    display: block; /* Amikor látható, visszakapja a blokk szintű megjelenést */
    animation: fadeInSlideDown 0.3s forwards; /* Lágyan úszik be a helyére */
}
#task-input-container label {
    display: block;
    color: white;
    font-size: 1.125rem; /* text-lg Tailwind megfelelője */
    font-weight: 600; /* font-semibold Tailwind megfelelője */
    margin-bottom: 0.5rem; /* mb-2 Tailwind megfelelője */
}
#task-description {
    width: 100%;
    padding: 0.75rem; /* p-3 Tailwind megfelelője */
    border-radius: 0.5rem; /* rounded-lg Tailwind megfelelője */
    background-color: rgba(255, 255, 255, 0.3); /* bg-white bg-opacity-30 Tailwind megfelelője */
    color: white;
    resize: vertical; /* resize-y Tailwind megfelelője */
    min-height: 5rem; /* min-h-[80px] Tailwind megfelelője */
}
#task-description::placeholder {
    color: rgba(255, 255, 255, 0.7); /* placeholder-white placeholder-opacity-70 Tailwind megfelelője */
}
#task-description:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5); /* focus:ring-2 focus:ring-indigo-300 Tailwind megfelelője */
}

/* Napló nézet */
.history-section {
    position: relative; /* Hozzáadva: a z-index miatt */
    z-index: 10; /* Hozzáadva: hogy a többi elem fölött legyen */
    margin-top: 1rem; /* Még kisebb térköz az előzmények és a gomb/leírás között */
}
.history-section h2 {
    color: white;
    font-size: 1.25rem; /* text-xl Tailwind megfelelője */
    font-weight: 700; /* font-bold Tailwind megfelelője */
    margin-bottom: 0.75rem; /* Kisebb térköz a cím és a lista között */
}
#history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Kisebb lyuk a listaelemek között */
}
.history-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1); /* bg-white bg-opacity-10 Tailwind megfelelője */
    padding: 0.4rem 0.75rem; /* Jelentősen csökkentett függőleges padding */
    border-radius: 0.5rem; /* rounded-lg Tailwind megfelelője */
    color: white;
}
/* A szövegdoboz rugalmasan kitölti a teret, de hagy helyet a gombnak */
.history-list-item > div {
    flex: 1;
    margin-right: 1rem;
    min-width: 0; /* Flexbox text-overflow levágásához kötelező */
    color: #E0E7FF; /* Világosabb indigó */
}
/* Egymás mellé tesszük a dátumot és a túlórát */
.history-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.history-date {
    font-size: 0.65rem; /* Kifejezetten apró dátum */
    opacity: 0.7;
}
.history-overtime {
    font-size: 0.85rem;
    font-weight: 600;
}
.history-task {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.15rem; /* Nagyon pici térköz */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- RESZPONZÍV VISELKEDÉS NAGYOBB KÉPERNYŐKRE --- */
@media (min-width: 768px) { /* md breakpoint, 768px-től felfelé */
    .main-container {
        max-width: 64rem; /* Még szélesebb konténer asztali nézeten (1024px) */
    }

    .history-task {
        white-space: normal; /* Engedélyezzük a sortörést */
        overflow: visible; /* A szöveg látható lesz, ha több soros */
        text-overflow: clip; /* Nincs szükség levágásra (...) */
    }
}

/* "Szerkesztés" gomb modern, "kapszula" stílusa */
.history-list-item .edit-button {
    color: #E0E7FF;
    background-color: rgba(99, 102, 241, 0.25);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.history-list-item .edit-button:hover {
    background-color: rgba(99, 102, 241, 0.5);
    color: white;
}

/* Havi összesítés szekció */
.monthly-summary-section {
    margin-top: 1rem; /* Kompaktabb térköz az előzmények és összesítések között */
}
/* Modális ablak */
/* Modális ablakok alapstílusai */
#edit-modal, #login-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5); /* bg-black bg-opacity-50 Tailwind megfelelője */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* p-4 Tailwind megfelelője */
    z-index: 50; /* z-50 Tailwind megfelelője */
    visibility: hidden; /* Kezdetben rejtett */
    opacity: 0; /* Kezdetben átlátszó */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; /* Átmenet a sima megjelenéshez */
}
#edit-modal.visible, #login-modal.visible {
    visibility: visible;
    opacity: 1;
}
.modal-content {
    padding: 1.5rem; /* p-6 Tailwind megfelelője */
    border-radius: 1rem; /* rounded-2xl Tailwind megfelelője */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-2xl Tailwind megfelelője */
    width: 100%;
    max-width: 24rem; /* max-w-sm Tailwind megfelelője */
}
/* Modális ablak fejléc (Cím és Kuka gomb elrendezése) */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.modal-header h3 {
    margin-bottom: 0 !important; /* Felülírja az alap margót */
}
/* Törlés (Kuka) gomb a modális ablakban */
#modal-delete {
    background: none;
    border: none;
    color: #EF4444; /* Piros szín */
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease-in-out;
}
#modal-delete:hover {
    background-color: rgba(239, 68, 68, 0.2); /* Halvány piros háttér hoverre */
}
#modal-delete svg { width: 1.5rem; height: 1.5rem; }

.modal-content h3 {
    color: white;
    font-size: 1.5rem; /* text-2xl Tailwind megfelelője */
    font-weight: 700; /* font-bold Tailwind megfelelője */
    margin-bottom: 1rem; /* mb-4 Tailwind megfelelője */
}
.modal-content .form-group {
    margin-bottom: 1rem; /* mb-4 Tailwind megfelelője */
}
.modal-content label {
    display: block;
    color: white;
    font-size: 0.875rem; /* text-sm Tailwind megfelelője */
    font-weight: 600; /* font-semibold Tailwind megfelelője */
    margin-bottom: 0.25rem; /* mb-1 Tailwind megfelelője */
}
.modal-content input[type="text"],
.modal-content input[type="time"],
.modal-content textarea {
    width: 100%;
    padding: 0.5rem; /* p-2 Tailwind megfelelője */
    border-radius: 0.5rem; /* rounded-lg Tailwind megfelelője */
    background-color: rgba(255, 255, 255, 0.3); /* bg-white bg-opacity-30 Tailwind megfelelője */
    color: white;
}
.modal-content textarea {
    resize: vertical; /* resize-y Tailwind megfelelője */
    min-height: 3.75rem; /* min-h-[60px] Tailwind megfelelője */
}
.modal-content .button-group {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem; /* space-x-3 Tailwind megfelelője */
}
.modal-content .button-group button {
    padding: 0.5rem 1rem; /* px-4 py-2 Tailwind megfelelője */
    border-radius: 0.5rem; /* rounded-lg Tailwind megfelelője */
    color: white;
}
#modal-cancel {
    background-color: #4B5563; /* bg-gray-600 Tailwind megfelelője */
}
#modal-cancel:hover {
    background-color: #374151; /* hover:bg-gray-700 Tailwind megfelelője */
}
#modal-save {
    background-color: #4F46E5; /* bg-indigo-600 Tailwind megfelelője */
}
#modal-save:hover {
    background-color: #4338CA; /* hover:bg-indigo-700 Tailwind megfelelője */
}

/* Bejelentkezés gomb stílusai */
#login-button {
    background-color: #4F46E5; /* bg-indigo-600 Tailwind megfelelője */
}
#login-button:hover {
    background-color: #4338CA; /* hover:bg-indigo-700 Tailwind megfelelője */
}

/* Hibaüzenet stílus */
.error-message {
    color: #EF4444; /* Piros szín */
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    visibility: hidden;
}
.error-message.visible { visibility: visible; }

/* Animációk */
@keyframes fadeOutSlideUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}
@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(99, 102, 241, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
@keyframes floatIn {
    to { opacity: 1; transform: translateY(0); }
}
.pulse-animation {
    animation: pulse 1s infinite;
}
.fade-out-slide-up {
    animation: fadeOutSlideUp 0.3s forwards;
}
.fade-in-slide-down {
    animation: fadeInSlideDown 0.3s forwards;
}
.float-in {
    animation: floatIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}
/* Utility osztályok a JS-hez */
.hidden-element {
    display: none !important;
}
.visible-element {
    display: flex !important; /* Vagy block, attól függően, mi az alapértelmezett */
}
