/* Single article page */
.main-article {
    margin: 40px auto;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff, var(--background-radial-grad));
    border-radius: 10px;
    border: 2px solid var(--primary-green);
    min-width: 800px;
    width: 65%;
    text-align: center;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}


.main-article h2 {
    display: inline-block;
    margin: 0;
    font-size: 3rem;
    vertical-align: middle;
    color: var(--ternary-green);
}

.author {
    margin: 5px;
    font-size: 1.5rem;
    vertical-align: middle;
    color: var(--ternary-green);
}

.article-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.article-body {
    flex: 3;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: justify;
}

.article-body p {
    margin-bottom: 1.5rem;
}

/* articles page */
.articles {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    background: transparent;
    border: 2px solid var(--primary-green);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: fit-content;
}

.articles h1 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--ternary-green);
    margin-bottom: 20px;
}

.articles-section {
    display: grid;
    background: transparent;
    grid-template-columns: 1;
    margin: 0% 5% 0% 5%;
    gap: 1.5rem;
    justify-content: center;
}

article-preview {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2% 2% 2% 2%;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}


article-preview h2 {
    color: var(--ternary-green);
}

article-preview p {
    text-align: justify;
    display: block;
    word-wrap: break-word;
    font-size: 0.9rem;
    margin: 1rem 0;
    text-overflow: ellipsis;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

artarticle-preview a {
    color: var(--secondary-green);
    text-decoration: none;
    font-weight: bold;
}

article-preview a:hover {
    text-decoration: underline;
}

article-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 200px;
}

.sidebar ul li {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.sidebar ul li a {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    color: #66cc66;
    text-decoration: none;
    margin-bottom: 5px;
}

.sidebar ul li a:hover {
    color: #55aa55;
}

.sidebar ul li p {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.article-link {
    grid-column: span 2;
    text-align: center;
}

.article-link a {
    color: var(--secondary-green);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 2px solid var(--secondary-green);
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.article-link a:hover {
    background-color: var(--secondary-green);
    color: white;
}

/* Obecný kontejner pro obsah */
#main-content .col-md-6 {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff, var(--background-radial-grad));
    border: 2px solid var(--primary-green);
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Nadpis */
#main-content h1 {
    text-align: center;
    color: var(--ternary-green);
    margin-bottom: 2rem;
}

/* Skupina formulářových prvků */
.form-group {
    margin-bottom: 1.5rem;
}

/* Popisky */
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--ternary-green);
}

/* Vstupy a textová pole */
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--primary-green);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    resize: vertical;
}

/* Tlačítka */
.btn-submit {
    background-color: var(--secondary-green);
    color: white;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s;
    margin-right: 1rem;
}

.btn-submit:hover {
    background-color: #4cae4c;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.2);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

/* Speciální styl pro smazání */
form[action*="delete"] .btn-submit {
    background-color: #f44336;
}

form[action*="delete"] .btn-submit:hover {
    background-color: #d32f2f;
}

/* Styl pro úspěch/chybu */
p[style*="color:red"],
p[style*="color:green"] {
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
}

.add-article {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.article-add-button, .btn-edit {
    background-color: var(--secondary-green);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.article-add-button:hover {
    background-color: #4cae4c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.article-add-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}


@media (max-width: 1000px) and (min-width: 760px) {
    .main-article {
        width: 80%;
        padding: 15px;
        min-width: auto;
    }

    .main-article h2 {
        font-size: 2.5rem;
    }

    .author {
        font-size: 1.2rem;
    }

    .article-section {
        flex-direction: column;
        gap: 15px;
    }

    .article-body {
        flex: none;
        font-size: 1rem;
        padding: 15px;
    }

    .articles {
        max-width: 90%;
        padding: 15px;
    }

    .articles-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    article-preview {
        padding: 1.5rem;
        margin: 1.5%;
    }

    article-preview p {
        font-size: 0.8rem;
    }

    .sidebar {
        display: flex;
        flex-direction: row;
    }

    .sidebar ul {
        display: flex;
        font-size: 0.9rem;
        margin-left: 5px;
        width: 500px;
    }

    .sidebar ul li {
        padding: 8px;
        font-size: 0.9rem;
        margin: 10px 5px;
        width: 150px;
    }

    .sidebar ul li a {
        font-size: 1rem;
    }
}

@media (max-width: 760px) {
    .main-article {
        width: 90%;
        padding: 10px;
        min-width: auto;
    }

    .main-article h2 {
        font-size: 2rem;
    }

    .author {
        font-size: 1rem;
    }

    .article-section {
        flex-direction: column;
        gap: 10px;
    }

    .article-body {
        font-size: 0.9rem;
        padding: 10px;
    }

    .articles {
        max-width: 95%;
        padding: 10px;
    }

    article-preview {
        padding: 1rem;
        margin: 1%;
    }

    article-preview p {
        font-size: 0.8rem;
    }

    .sidebar ul {
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    .sidebar ul li {
        padding: 6px;
        font-size: 0.8rem;
    }

    .sidebar ul li a {
        font-size: 0.9rem;
    }
}