/* ============================================ */
/* RESET & BASE */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================ */
/* HEADER */
/* ============================================ */
header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    color: #0078d4;
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.login-form {
    display: flex;
    gap: 10px;
}

input, button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background: #0078d4;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #005a9e;
}

button.register-btn {
    background: #28a745;
}

button.register-btn:hover {
    background: #218838;
}

/* ============================================ */
/* MODAL */
/* ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0078d4;
}

.modal-header h2 {
    margin: 0;
    color: #0078d4;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-body label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.modal-body input,
.modal-body select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: #0078d4;
}

.modal-body small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================ */
/* BREADCRUMB */
/* ============================================ */
.breadcrumb {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-link {
    color: #0078d4;
    text-decoration: none;
    cursor: pointer;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
}

.current-set {
    font-weight: bold;
    color: #333;
}

/* ============================================ */
/* CHILDREN NAV */
/* ============================================ */
.children-nav {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.children-nav h3 {
    margin-bottom: 15px;
    color: #0078d4;
}

.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.child-set {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.child-set:hover {
    border-color: #0078d4;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.child-set-name {
    font-weight: 600;
    color: #0078d4;
    margin-bottom: 5px;
}

.child-set-desc {
    font-size: 12px;
    color: #666;
}

/* ============================================ */
/* SETS LIST */
/* ============================================ */
.sets-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.set-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.set-item:hover {
    background: #f9f9f9;
}

.set-item:last-child {
    border-bottom: none;
}

/* ============================================ */
/* POSTS */
/* ============================================ */
.posts-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 15px;
}

/* Rolovací podokno pro příspěvky */
.posts-scroll-container {
    /* max-height bude nastaveno dynamicky podle počtu viditelných příspěvků v JavaScriptu */
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #fafafa;
    margin-bottom: 20px;
    /* Výchozí max-height pro případ, že JavaScript nenastaví hodnotu */
    max-height: 600px;
    /* Zajistit, že kontejner je viditelný a má správné vlastnosti */
    display: block;
    position: relative;
    /* Zajistit, že se kontejner může rolovat */
    min-height: 100px;
    /* Zajistit, že se kontejner správně zobrazí */
    box-sizing: border-box;
}

/* Scrollbar styling pro lepší vzhled */
.posts-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.posts-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.posts-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.posts-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.post {
    padding-top: 10px;
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.post-body {
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.6;
}

.create-post {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

/* ============================================ */
/* UTILITY */
/* ============================================ */
.hidden {
    display: none;
}

.error {
    color: #d32f2f;
    margin-top: 10px;
}

.success {
    color: #2e7d32;
    margin-top: 10px;
}

/* ============================================ */
/* CREATE CHILD SET - Formulář pro vytvoření potomka */
/* ============================================ */

.create-child-set h3 {
    margin-bottom: 15px;
    color: #0078d4;
}

.create-child-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-child-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.create-child-form button {
    padding: 10px;
}

.create-child-btn {
    background: #28a745 !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
}

.create-child-btn:hover {
    background: #218838 !important;
}

#usersInSetContainer {
    margin-bottom: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
}

.user-in-set {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: white;
    border-radius: 15px;
    border: 1px solid #ddd;
    font-size: 12px;
    transition: background 0.2s;
}

.user-in-set:hover {
    background: #f0f0f0;
}

/* ============================================ */
/* WATCHED SETS - Sledované skupiny */
/* ============================================ */
/* ============================================ */
/* WATCHED POSTS - Příspěvky ze sledovaných skupin */
/* ============================================ */
#watchedPostsList .post {
    margin-bottom: 15px;
}