body {
    font-family: Arial, sans-serif, Pattanakarn;
    margin: 0;
    padding: 0;
    color: #333;
}

@font-face {
    font-family: Pattanakarn;
    src: url(./fonts/fonnts.com-Pattanakarn_Medium.ttf);
}

.ql-container.ql-snow { 
    border: none !important;
}

.ql-toolbar.ql-snow { 
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.container {
    width: 80%;
    margin: 0 auto;
    padding: 20px 0;
}

.lang-switcher {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.lang-button {
    background-color: #0048a7;
    color: #fff;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 3px;
    margin: 0 5px;
    transition: background-color 0.3s;
}

.lang-button:hover {
    background-color: #0062ff;
}

.head {
    background-color: #1a73e8;
    background-image: url("./images/background/robo.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: #fff;
    height: 600px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.head h1 {
    font-family: Pattanakarn;
    font-size: 8em;
    line-height: 1em;
    margin-bottom: 0.2em;
    user-select: none;
}

header h0 {
    font-family: Pattanakarn;
    font-size: 10em;
    line-height: 1em;
    margin: 0;
    margin-bottom: 0.2em;
    text-align: center;
    user-select: none;
    margin-left: 15px;
}

.hpa-button {
    background-color: #0048a7;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: .3s linear;
}

.hpa-button:hover {
    background: #4285f0;
}

nav ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

.hero {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    /*background-color: #1d6dec;*/
    background-image: linear-gradient(135deg, #0053d8, #4d85df, #3975d6, #4d85df, #0053d8);
    color: #fff;
    text-align: center;
    padding: 40px 0;
}

.hero h2 {
    margin: 0;
    font-size: 3em;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.2em;
    margin: 20px 0;
    margin-bottom: 30px;
}

.cta-button {
    background-color: #004db3;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: .3s linear;
}

.cta-button:hover {
    background-color: #0062ff;
}

.blog {
    border-color: #e8f0fe;
    padding: 50px 0;
}

.blog h3 {
    text-align: center;
    margin-bottom: 40px;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.blog-grid article {
    background-color: #f7f7f7;
    padding: 20px;
    border-radius: 5px;
}

.load-more-button {
    background-color: #0048a7;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    margin-top: 20px;
    display: block;
    width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.load-more-button:hover {
    background-color: #0062ff;
}

.contact {
    background-color: #ecf0f1;
    padding: 50px 0;
    height: 120px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; 
}

footer {
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
    background-color: #174ea6;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    position: relative;
}

footer p {
    font-size: 0.9em;
    margin: 0;
    display: inline-block;
}

.login-button {
    background-color: #0048a7;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: absolute;
    right: 20px; 
    bottom: 30px; 
}

.login-button:hover {
    background-color: #0062ff;
}

/* Admin Panel Styles */
.admin-section {
    margin: 20px;
    padding: 20px;
    border: 1px solid #ccc;
}

.admin-only {
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
    background-image: linear-gradient(135deg, #0053d8, #4d85df, #3975d6, #4d85df, #0053d8);
    color: #fff;
    padding: 40px 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.admin-table th, .admin-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
    color: black;
}

.admin-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: black;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.admin-only .admin-section {
    background-color: #fff;
}

.admin-only h3 {
    color: black;
}

.admin-only h2 {
    font-size: 3em;
    margin-left: 25px;
}

.admin-section h2 {
    margin-bottom: 10px;
}

/* .admin-section button {
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #0048a7;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.admin-section button:hover {
    background-color: #0062ff;
} */

#news-list {
    margin-top: 20px;
}

#news-list .news-item {
    border: 1px solid #ccc; /* Border around each news item */
    padding: 15px;          /* Space inside the border */
    margin-bottom: 10px;    /* Space between news items */
    border-radius: 5px;     /* Optional: Rounded corners */
    background-color: #f9f9f9; /* Optional: Background color */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: Add a subtle shadow */
}

#news-list .news-item h4 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2em;
}

#news-list .news-item p {
    margin: 0;
    color: #555;
}

.news-list .edit-button, .news-list .delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0048a7;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
}

.news-item .delete-button {
    background-color: #d9534f;
}

.news-item .edit-button:hover {
    background-color: #0062ff;
}

.news-item .delete-button:hover {
    background-color: #c9302c;
}

#projects-list {
    margin-top: 20px;
}

.d-flow-root {
    display: flow-root;
}

#projects-list .projects-item {
    border: 1px solid #ccc;
    padding: 15px;         
    margin-bottom: 10px;    
    border-radius: 5px;     
    background-color: #f9f9f9; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
    font-size: 12px;
}

#projects-list .projects-item h4 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2em;
}

#projects-list .projects-item p {
    margin: 0;
    color: #555;
}

#projects-list .projects-item h1 {
    font-size: 2rem;
}

/*
#projects-list .projects-item img {
    max-width: 100%; 
    height: auto;    
    margin-bottom: 10px; 
}
*/

.projects-list .edit-button, .projects-list .delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0048a7;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
    margin-right: 5px;
}

.projects-item .delete-button {
    background-color: #d9534f;
}

.projects-item .edit-button:hover {
    background-color: #0062ff;
}

.projects-item .delete-button:hover {
    background-color: #c9302c;
}

.projects-item .button-container {
    display: flex;          
    justify-content: flex-start; 
    gap: 10px;              
    margin-top: 10px;       
}

.about-list {
    margin-top: 20px;
}

#about-list .about-item {
    border: 1px solid #ccc; 
    padding: 15px;         
    margin-bottom: 10px;    
    border-radius: 5px;     
    background-color: #f9f9f9; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
}

#about-list .about-item h4 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2em;
}   

#about-list .about-item p {
    margin: 0;
    color: #555;
}

.about-list .edit-button, .about-list .delete-button {  
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0048a7;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
}

.about-item .delete-button {
    background-color: #d9534f;
}

.about-item .edit-button:hover {
    background-color: #0062ff;
}

.about-item .delete-button:hover {
    background-color: #c9302c;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    text-align: center;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

#editorContainer {
    margin-bottom: 20px;
    text-align: left;
}

.logout-button {
    background-color: #d9534f;
    font-size: 1em;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: fixed;
    top: 20px;
    right: 20px;
}

.logout-button:hover {
    background-color: #c9302c;
}

.ql-editor img {
    max-width: 100%;
    height: auto;
}

.float-left {
    float: left;
    margin-right: 10px;
}

.float-right {
    float: right;
    margin-left: 10px;
}

.modal-dialog, .modal-content {
    width: fit-content !important;
    max-width: none !important;
}

/* =========================================================
   FIX: Za duże odstępy przed/po obrazkach w Projects / News / About
   (Quill często wstawia <p> oraz puste <p><br></p> z domyślnymi marginesami)
   ========================================================= */

/* 1) Kontrolowane marginesy akapitów w treści wpisów */
#projects-list .projects-item .ql-editor p,
#projects-list .projects-item p,
#news-list .news-item .ql-editor p,
#news-list .news-item p,
#about-list .about-item .ql-editor p,
#about-list .about-item p {
    margin: 0.35em 0;
}

/* 2) Obraz jako blok + rozsądny odstęp tylko przy obrazku */
#projects-list .projects-item img,
#news-list .news-item img,
#about-list .about-item img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

/* 3) Puste linie Quilla typu <p><br></p> – wyłącz (tam gdzie wspierane jest :has) */
#projects-list .projects-item .ql-editor p:has(br:only-child),
#projects-list .projects-item p:has(br:only-child),
#news-list .news-item .ql-editor p:has(br:only-child),
#news-list .news-item p:has(br:only-child),
#about-list .about-item .ql-editor p:has(br:only-child),
#about-list .about-item p:has(br:only-child) {
    margin: 0;
    display: none;
}

/* 4) Akapit, który zawiera tylko obrazek: usuń marginesy akapitu */
#projects-list .projects-item .ql-editor p:has(> img:only-child),
#projects-list .projects-item p:has(> img:only-child),
#news-list .news-item .ql-editor p:has(> img:only-child),
#news-list .news-item p:has(> img:only-child),
#about-list .about-item .ql-editor p:has(> img:only-child),
#about-list .about-item p:has(> img:only-child) {
    margin: 0;
}
