:root {
    --primary-color: #c5a35a;
    --secondary-color: #3c3c3c;
    --background-color: #f5f5f5;
    --text-color: #333;
    --card-bg: #ffffff;
    --footer-bg: #f8f9fa;
    --error-color: #721c24;
    --correct-color: #155724;
    --font-serif: 'Lora', serif;
    --font-sans: 'Montserrat', sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}

header {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
}

.logo {
    max-width: 100px;
    margin-bottom: 1rem;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

h1 {
    font-family: var(--font-serif);
    color: var(--secondary-color);
    font-size: 2rem;
    margin: 0;
}

main {
    flex: 1;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.code-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#code-input {
    font-size: 2.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #e9ecef;
    margin-bottom: 1.5rem;
}

#catalog-password {
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
    max-width: 320px;
    padding: 0.85rem 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #e9ecef;
    margin-bottom: 1rem;
}

#catalog-username {
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
    max-width: 320px;
    padding: 0.85rem 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #e9ecef;
    margin-bottom: 1rem;
}

.catalog-auth-input {
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
    max-width: 320px;
    padding: 0.85rem 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #e9ecef;
    margin-bottom: 1rem;
}

.catalog-auth-separator {
    width: 100%;
    max-width: 320px;
    border: 0;
    border-top: 1px solid #e2e2e2;
    margin: 1.25rem auto;
}

.info-message {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.catalog-auth-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.register-trigger {
    max-width: 320px;
}

.catalog-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
}

.catalog-modal.is-open {
    display: block;
}

.catalog-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.catalog-modal-card {
    position: relative;
    width: calc(100% - 2rem);
    max-width: 460px;
    margin: 5vh auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    padding: 1.2rem 1rem 1.1rem;
}

.catalog-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.catalog-consent-row {
    width: 100%;
    max-width: 320px;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.92rem;
    color: #555;
    margin: 0.35rem auto 0.9rem;
    text-align: left;
}

.catalog-consent-row input[type="checkbox"] {
    margin-top: 0.22rem;
    transform: scale(1.08);
}

.catalog-register-note {
    width: 100%;
    max-width: 320px;
    margin: -0.1rem auto 0.7rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: #f8f5ee;
    border: 1px solid #e8decb;
    color: #5f573f;
    font-size: 0.88rem;
    text-align: center;
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 320px;
}

.submit-btn:hover {
    background-color: #b38f4a;
}

.submit-btn:disabled {
    background-color: #d6d6d6;
    cursor: not-allowed;
    color: #ffffff;
    opacity: 0.75;
}

.error-message {
    color: var(--error-color);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    margin-top: 1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

footer {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    color: #6c757d;
    font-size: 0.9rem;
}

/* View.php styles */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.1rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 10;
    padding: 0.35rem 0.75rem;
}

.item-card h2, .quiz-container h2 {
    font-family: var(--font-serif);
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.item-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.item-gallery img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.item-viewer {
    display: none;
}

.item-viewer .item-viewer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f7f7f7;
}

.item-info p {
    margin-bottom: 1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quiz-question {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.quiz-question:last-child {
    border-bottom: none;
}

.quiz-question h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.quiz-answers label {
    display: block;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.quiz-answers label:hover {
    background-color: #e9ecef;
}

.quiz-answers input[type="radio"] {
    display: none;
}

.quiz-answers input[type="radio"]:checked + span {
    font-weight: bold;
}

.quiz-answers label.correct {
    background-color: #d4edda;
    color: var(--correct-color);
    border: 1px solid var(--correct-color);
}

.quiz-answers label.wrong {
    background-color: #f8d7da;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

#quiz-result {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 10px;
    background-color: #e9ecef;
}

/* Képnézegető (Modal/Lightbox) */
.item-gallery img {
    cursor: pointer;
    transition: transform 0.2s;
}

.item-gallery img:hover {
    transform: scale(1.05);
}

.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.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 900px) {
    .item-viewer {
        display: flex;
        position: relative;
        width: 100%;
        margin-bottom: 2rem;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
        overflow: hidden;
        justify-content: center;
        align-items: center;
        aspect-ratio: var(--viewer-aspect-ratio, 4 / 3);
    }

    .item-viewer .nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        border: none;
        background: rgba(0, 0, 0, 0.45);
        color: #fff;
        font-size: 1.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
        transition: background 0.18s ease, transform 0.18s ease;
    }

    .item-viewer .nav:hover,
    .item-viewer .nav:focus-visible {
        background: rgba(0, 0, 0, 0.65);
        transform: translateY(-50%) scale(1.05);
        outline: none;
    }

    .item-viewer .nav.prev {
        left: 0.75rem;
    }

    .item-viewer .nav.next {
        right: 0.75rem;
    }

    .item-viewer-counter {
        position: absolute;
        bottom: 0.75rem;
        right: 1rem;
        padding: 0.4rem 0.75rem;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.55);
        color: #fff;
        font-size: 0.9rem;
        letter-spacing: 0.12em;
    }

    .item-viewer-meta {
        position: absolute;
        top: 0.85rem;
        left: 0.85rem;
        display: inline-flex;
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.7rem 0.95rem;
        border-radius: 1rem;
        background: linear-gradient(140deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.45));
        color: #fff;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
        pointer-events: none;
        max-width: calc(100% - 1.7rem);
        z-index: 2;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.35s ease, transform 0.35s ease;
    }

    .item-viewer-meta-label {
        text-transform: uppercase;
        font-size: 0.68rem;
        letter-spacing: 0.24em;
        color: rgba(255, 255, 255, 0.7);
    }

    .item-viewer-meta-code {
        font-size: 1.7rem;
        font-weight: 700;
        letter-spacing: 0.28em;
        font-feature-settings: 'tnum';
        overflow-wrap: anywhere;
    }

    .item-viewer-meta-name {
        font-family: var(--font-serif);
        font-size: 1.05rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .item-viewer-meta.is-hidden {
        opacity: 0;
        transform: translateY(-6px);
    }

    .item-gallery {
        display: none;
    }
}

.full-catalog-page {
    background-color: var(--background-color);
}

.full-catalog-container {
    max-width: 1200px;
}

.full-catalog-title {
    font-family: var(--font-serif);
    color: var(--secondary-color);
    text-align: center;
    margin: 0;
    font-size: 1.9rem;
}

.full-catalog-subtitle {
    text-align: center;
    margin: 0.5rem 0 1.6rem;
    color: #6c757d;
}

.catalog-search-form {
    display: flex;
    gap: 0.65rem;
    margin: 0 auto 1.25rem;
    max-width: 640px;
}

.catalog-search-input {
    flex: 1;
    min-width: 0;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 0.72rem 0.9rem;
    font-size: 1rem;
    background: #fff;
}

.catalog-search-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.72rem 1rem;
    font-weight: 700;
    cursor: pointer;
}

.full-catalog-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.1rem;
}

.full-catalog-card,
.full-catalog-card:link,
.full-catalog-card:visited {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: var(--text-color) !important;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.full-catalog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 163, 90, 0.4);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.full-catalog-media {
    width: 100%;
    height: 210px;
    aspect-ratio: 1 / 1;
    background: #f7f7f7;
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-catalog-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.full-catalog-card h3,
.full-catalog-card p {
    color: var(--text-color);
    text-decoration: none;
}

.full-catalog-placeholder {
    font-size: 0.95rem;
    color: #6c757d;
    padding: 1rem;
    text-align: center;
}

.full-catalog-content {
    padding: 0.9rem;
}

.full-catalog-content h3 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.3;
    min-height: 2.6em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.full-catalog-code {
    margin: 0.65rem 0 0;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--secondary-color);
}

.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.catalog-page-btn {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 0.58rem 1.05rem;
    font-weight: 600;
}

.catalog-page-btn.is-disabled {
    background-color: #d6d6d6;
    color: #fff;
    cursor: not-allowed;
}

.catalog-page-info {
    font-weight: 700;
    color: var(--secondary-color);
}

@media (max-width: 1100px) {
    .full-catalog-container {
        max-width: 1000px;
    }

    .full-catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .full-catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .catalog-search-form {
        flex-direction: column;
    }

    .full-catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .full-catalog-media {
        height: 170px;
    }

    .full-catalog-content h3 {
        font-size: 0.95rem;
    }
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(245, 245, 245, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid #e5e5e5;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

