/* Subnautica betűtípus definíciója */
@font-face {
    font-family: 'Subnautica';
    src: url('../fonts/subnautica.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Alapbeállítások */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #011635;
    color: #e0e6eb;
    margin: 0;
    overflow-x: hidden;
    animation: fadeIn 1s ease-in-out;
    box-sizing: border-box;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
    padding: 20px 20px;
}

main {
    flex: 1;
}

/* Fejléc */
header {
    background: #02294c;
    padding: 1rem;
    margin-bottom: 30px;
    animation: slideDown 0.8s ease-out;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
}

header h1 {
    display: inline-block;
    margin-left: 10px;
    font-size: 2.5em;
    font-weight: bold;
    color: #66d9ef;
    text-shadow: 0 0 10px rgba(102, 217, 239, 0.5);
    font-family: 'Subnautica', sans-serif;
}

header h1 a {
    color: #66d9ef;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    font-family: inherit;
}

header h1 a:hover {
    color: #00cc99;
    transform: scale(1.05);
}

header h1 img.header-icon {
    height: 2em;
    margin-right: 8px;
    vertical-align: middle;
}

header nav {
    float: right;
    margin-top: 8px;
}

header nav a {
    color: #00cc99;
    margin-left: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease, transform 0.2s ease;
}

header nav a:hover {
    color: #66d9ef;
    transform: translateY(-2px);
}

/* Lábléc */
footer {
    background: #02294c;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    text-align: left;
    margin-top: 30px;
    animation: slideUp 0.8s ease-out;
}

footer img.footer-icon {
    height: 2em;
    margin-right: 8px;
    vertical-align: middle;
}

footer .footer-title {
    font-family: 'Subnautica', sans-serif;
    font-size: 1.5em;
    font-weight: bold;
    color: #66d9ef;
    display: inline-block;
}

footer .disclaimer {
    font-size: 0.9rem;
    color: #e0e6eb;
    margin-top: 8px;
}

footer .attribution {
    font-size: 0.9rem;
    color: #e0e6eb;
    margin-top: 4px;
}

footer a {
    color: #66d9ef;
    text-decoration: underline;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #00cc99;
}

.footer-title-container {
    display: flex;
    align-items: center;
}

.footer-title-wrapper {
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.footer.Rights {
    font-size: 0.9rem;
    color: #e0e6eb;
}

.legal-footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #e0e6eb;
    flex-wrap: wrap;
}

.legal-footer-links a {
    color: #66d9ef;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.legal-footer-links a:hover {
    color: #00cc99;
}

.legal-footer-links .separator {
    color: #6a8299;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Konténer */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Kártyák */
.card {
    background-color: #02294c;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid #044b80;
    box-sizing: border-box;
    margin-bottom: 20px;
}

a.card.page-card {
    width: 350px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #02294c;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid #044b80;
    box-sizing: border-box;
    margin-bottom: 20px;
    text-decoration: none;
}

a.card.page-card:hover {
    background-color: #044b80;
    box-shadow: 0 10px 25px rgba(4, 75, 128, 0.6);
}

a.card.page-card span {
    color: #66d9ef;
    font-size: 1.5em;
    font-weight: bold;
    transition: color 0.3s ease;
}

a.card.page-card:hover span {
    color: #00cc99;
}

.content-card {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
    padding-top: 15px;
}

.content-card h2 {
    font-size: 3em;
    color: #66d9ef;
    text-shadow: 0 0 10px rgba(102, 217, 239, 0.5);
    margin-bottom: 20px;
    margin-top: 0;
    position: relative;
    text-align: center;
}

.content-card h2::after {
    content: '';
    display: block;
    width: 80%;
    height: 2px;
    background: #044b80;
    margin: 8px auto 0;
}

.card-content {
    text-align: left;
}

.card-content:after {
    content: '';
    display: block;
    clear: both;
}

.card-content h1,
.card-content h2,
.card-content h3,
.card-content h4,
.card-content h5,
.card-content h6 {
    color: #66d9ef;
    text-shadow: 0 0 10px rgba(102, 217, 239, 0.5);
    margin-bottom: 12px;
    text-align: left;
}

.card-content p,
.card-content ul,
.card-content li {
    color: #e0e6eb;
    margin-bottom: 12px;
    text-align: left;
}

.card-content a {
    color: #66d9ef;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.card-content a:hover {
    color: #00cc99;
}

.card-content table,
.card-content .infobox {
    text-align: left;
}

/* Laplista rács */
.page-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    animation: slideUp 0.6s ease forwards;
}

/* Infobox stílus */
.infobox {
    float: right;
    margin: 0 0 1em 1em;
    background: #02294c;
    border: 2px solid #66d9ef;
    border-radius: 12px;
    width: 260px;
    font-size: 0.9rem;
    color: #e0e6eb;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.infobox caption {
    background: #011635;
    color: #66d9ef;
    padding: 8px;
    font-weight: bold;
    font-size: 1rem;
    border-bottom: 2px solid #66d9ef;
    border-radius: 10px 10px 0 0;
}

.infobox th,
.infobox td {
    padding: 8px;
    vertical-align: top;
    color: #e0e6eb;
}

.infobox th {
    background: #011635;
    color: #66d9ef;
    width: 40%;
}

.infobox td {
    background: #02294c;
}

.infobox tr:nth-child(even) td {
    background: #013056;
}

.infobox-image img {
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    width: 100% !important;
    max-width: 240px;
    height: auto;
}

.infobox-image {
    text-align: center;
    background: #02294c;
    padding: 8px;
}

.infobox-caption {
    text-align: center;
    color: #e0e6eb;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Gombok */
.btn {
    padding: 12px;
    background-color: #033a60;
    border: none;
    color: #e0e6eb;
    border-radius: 12px;
    transition: all 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn:hover {
    background-color: #05507a;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 80, 122, 0.5);
}

.btn-secondary {
    background: #02294c;
    border: 2px solid #66d9ef;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #044b80;
}

/* Gombok csoportja */
.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* Űrlapok */
.form-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.editor-card {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
}

.form-card label,
.editor-card label {
    display: block;
    margin-bottom: 8px;
    color: #66d9ef;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 12px;
    background-color: #033a60;
    border: none;
    color: #e0e6eb;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

/* CKEditor stílusok */
.ck-editor__editable {
    min-height: 300px;
    background: #02294c !important;
    color: #e0e6eb !important;
    border: 2px solid #66d9ef !important;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.ck-toolbar {
    background: #011635 !important;
    border: 2px solid #66d9ef !important;
    border-bottom: none !important;
    border-radius: 12px 12px 0 0;
}

.ck-button {
    color: #66d9ef !important;
}

.ck-button:hover {
    background: #66d9ef !important;
    color: #011635 !important;
}

/* Előnézet doboz */
.preview-box {
    background: #02294c;
    border: 2px solid #66d9ef;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Szerkesztő fülek */
.editor-tabs {
    margin-bottom: 10px;
}

.editor-tab {
    background: #02294c;
    color: #66d9ef;
    border: 2px solid #66d9ef;
    padding: 8px 15px;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
}

.editor-tab.active,
.editor-tab:hover {
    background: #66d9ef;
    color: #011635;
}

/* Vissza a tetejére gomb */
.top-button {
    display: none;
    align-items: center;
    justify-content: center;
    background-color: #033a60;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    border: none;
}

.top-button:hover {
    background-color: #05507a;
    box-shadow: 0 5px 15px rgba(0, 80, 122, 0.5);
}

.top-button.animate-slide-in {
    animation: slideInFromBottom 0.4s ease-out forwards;
}

.top-button.animate-slide-out {
    animation: slideOutToBottom 0.4s ease-out forwards;
}

.top-icon {
    color: #66d9ef;
    font-size: 1.8em;
    font-weight: bold;
}

/* Hiba és siker üzenetek */
.error {
    color: #ff6666;
    margin-bottom: 15px;
}

.success {
    color: #66d9ef;
    margin-bottom: 15px;
}

/* Cookie-sáv stílusok */
#cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(1, 22, 53, 0.8); /* Sötét, Subnautica kékes háttér */
    backdrop-filter: blur(5px); /* Homályosítás */
    z-index: 1000;
    display: none;
}

#cookie-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #02294c;
    border: 2px solid #66d9ef;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    color: #e0e6eb;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

#cookie-banner p {
    margin: 0 0 15px;
    font-size: 1rem;
}

#cookie-banner .cookie-link {
    color: #66d9ef;
    text-decoration: underline;
    transition: color 0.3s ease;
}

#cookie-banner .cookie-link:hover {
    color: #00cc99;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

#accept-cookies {
    flex: 0 0 80%;
    background: #66d9ef;
    color: #011635;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

#accept-cookies:hover {
    background: #00cc99;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 204, 153, 0.5);
}

#reject-cookies {
    flex: 0 0 20%;
    background: #033a60;
    color: #6a8299; /* Szürkébb, kevésbé feltűnő */
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-weight: normal; /* Nem vastag */
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

#reject-cookies:hover {
    background: #05507a;
    box-shadow: 0 5px 15px rgba(0, 80, 122, 0.5);
}

/* Animációk */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromBottom {
    0% { opacity: 0; transform: translateY(100px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideOutToBottom {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(100px); }
}

/* Reszponzív dizájn */
@media (max-width: 768px) {
    .page-wrapper {
        min-height: calc(100vh - 30px);
        padding: 15px 10px;
    }

    header {
        text-align: center;
    }

    header h1 {
        display: block;
        margin-bottom: 10px;
        font-size: 1.5em;
    }

    header h1 img.header-icon {
        height: 1.5em;
    }

    header h1 a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3em;
    }

    header h1 a::before,
    header h1 a::after {
        content: '';
        display: block;
        font-family: 'Subnautica', sans-serif;
        font-weight: bold;
        color: #66d9ef;
        font-size: 1.2em;
    }

    header h1 a::before {
        content: 'SUBNAUTICA';
    }

    header h1 a::after {
        content: 'MAGYARORSZÁG';
    }

    header h1 a span {
        display: none;
    }

    header nav {
        float: none;
        text-align: center;
    }

    header nav a {
        display: inline-block;
        margin: 5px;
    }

    footer {
        text-align: center;
        margin-top: 30px;
    }

    footer img.footer-icon {
        height: 1.5em;
    }

    footer .footer-title {
        font-size: 1.2em;
    }

    footer .disclaimer {
        font-size: 0.8rem;
    }

    footer .attribution {
        font-size: 0.8rem;
    }

    footer .legal-footer-links {
        justify-content: center;
        gap: 8px;
        font-size: 0.8rem;
    }

    footer .legal-footer-links .separator {
        font-size: 0.8rem;
    }

    .footer-title-container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .footer-title-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    footer .footer-title-container .footer.Rights {
        margin-top: 6px !important;
        text-align: center;
    }

    .page-grid {
        flex-direction: column;
        align-items: center;
    }

    a.card.page-card {
        width: 100%;
        max-width: 400px;
    }

    .content-card {
        width: 100%;
        max-width: 100%;
    }

    .infobox {
        float: none;
        width: 100%;
        margin: 0 auto 1em;
    }

    .top-button {
        width: 40px;
        height: 40px;
    }

    .top-icon {
        font-size: 1.5em;
    }

    .button-group {
        flex-direction: column;
        gap: 5px;
    }

    .editor-card {
        max-width: 100%;
    }

    #cookie-banner {
        width: 100%;
        max-width: 100%; /* Még kisebb méret mobilon, hogy elférjen */
        padding: 10px; /* Minimális padding a belső tér növeléséhez */
        top: 50%;
        transform: translate(-50%, -50%);
        box-sizing: border-box;
    }

    .cookie-buttons {
        display: flex;
        gap: 4px; /* Minimális rés a gombok között */
        justify-content: space-between;
        width: 100%; /* Teljes szélesség a kártyán belül */
    }

    #accept-cookies {
        flex: 0 0 80%;
        padding: 6px; /* Minimális padding a gomb méretének csökkentéséhez */
        font-size: 1.00rem; /* Kisebb betűméret a jobb illeszkedésért */
        box-sizing: border-box;
    }

    #reject-cookies {
        flex: 0 0 20%;
        padding: 6px; /* Minimális padding */
        font-size: 0.85rem;
        box-sizing: border-box;
    }
}

/* Infobox fejléc */
.infobox-header {
    background: #011635;
    color: #66d9ef;
    text-align: center;
    font-weight: bold;
    padding: 8px;
    border-bottom: 2px solid #66d9ef;
}

/* Forráskód szerkesztő */
#markdown-editor {
    width: 100%;
    min-height: 300px;
    resize: vertical;
}

/* Címsorok hierarchiája */
.card-content h1 {
    font-size: 2em !important;
    margin: 20px 0 10px !important;
    position: relative !important;
    color: #66d9ef;
    text-shadow: 0 0 10px rgba(102, 217, 239, 0.5);
    text-align: left;
}

.card-content h1.has-infobox {
    clear: right !important;
}

.card-content h1::after {
    content: '' !important;
    display: block !important;
    border-bottom: 1.5px solid #044b80 !important;
    margin-top: 5px !important;
    width: 100% !important;
    position: absolute !important;
    left: 0 !important;
    bottom: -5px !important;
}

.card-content h2 {
    font-size: 1.5em !important;
    margin: 15px 0 10px !important;
    color: #66d9ef;
    text-shadow: 0 0 10px rgba(102, 217, 239, 0.5);
    text-align: left;
}

.card-content h2::after {
    content: none !important;
}

.card-content h3 {
    font-size: 1.2em !important;
    margin: 10px 0 10px !important;
    color: #66d9ef;
    text-shadow: 0 0 10px rgba(102, 217, 239, 0.5);
    text-align: left;
}

/* Színválasztó csoport */
.title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.title-group input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.title-group input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 2px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.title-group input[type="text"]#title_color_hex {
    width: 100px;
    text-transform: uppercase;
}

/* Lapok címsor ikon */
.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon {
    height: 2em;
    margin-right: 8px;
    vertical-align: middle;
}

/* Reszponzív dizájn a section-icon-hoz */
@media (max-width: 768px) {
    .section-icon {
        height: 1.5em;
    }
}