/* =====================================================
   LAPOZÓS RPG - Fő stíluslap
   ===================================================== */

:root {
    /* Színek */
    --color-primary: #e94560;
    --color-primary-dark: #c73659;
    --color-secondary: #0f3460;
    --color-accent: #16213e;
    --color-bg-dark: #1a1a2e;
    --color-bg-darker: #0f0f1a;
    --color-text: #f1f1f1;
    --color-text-muted: #888;
    --color-gold: #ffd700;
    --color-hp-full: #2ed573;
    --color-hp-mid: #ffa502;
    --color-hp-low: #ff4757;
    --color-success: #2ed573;
    --color-danger: #ff4757;

    /* Pergamen stílus */
    --parchment-bg: #f4e4bc;
    --parchment-dark: #d4c49c;
    --parchment-text: #2c1810;

    /* Tipográfia */
    --font-display: 'Cinzel', Georgia, serif;
    --font-body: 'Crimson Text', Georgia, serif;
    --font-ui: system-ui, -apple-system, sans-serif;

    /* Árnyékok */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(233, 69, 96, 0.5);

    /* Átmenetek */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Méretek */
    --header-height: 70px;
    --container-width: 1400px;
}

/* Reset & alap */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Háttér részecskék */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(233, 69, 96, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(15, 52, 96, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(22, 33, 62, 0.3) 0%, transparent 70%);
}

/* =====================================================
   Header
   ===================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
}

.header-content {
    max-width: var(--container-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text);
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-primary);
}

.btn-primary-small {
    background: var(--color-primary);
    color: white !important;
}

.btn-primary-small:hover {
    background: var(--color-primary-dark);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.username {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background: var(--color-primary);
    color: white;
}

/* =====================================================
   Fő tartalom
   ===================================================== */
.main-content {
    padding-top: var(--header-height);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Hero szekció */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    gap: 80px;
}

.hero-content {
    max-width: 550px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    margin-bottom: 35px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn-hero {
    padding: 16px 36px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Könyv preview animáció */
.hero-book {
    perspective: 1000px;
}

.book-preview {
    width: 280px;
    height: 380px;
    transform-style: preserve-3d;
    animation: bookFloat 4s ease-in-out infinite;
}

.book-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c1810 0%, #4a2c17 100%);
    border-radius: 5px 15px 15px 5px;
    box-shadow:
        -5px 5px 15px rgba(0, 0, 0, 0.5),
        inset -3px 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.book-cover::before {
    content: '📖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    opacity: 0.8;
}

.book-cover::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.4), transparent);
}

@keyframes bookFloat {
    0%, 100% {
        transform: rotateY(-10deg) rotateX(5deg) translateY(0);
    }
    50% {
        transform: rotateY(-10deg) rotateX(5deg) translateY(-15px);
    }
}

/* About szekció */
.about-section {
    padding: 100px 30px;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 52, 96, 0.2) 100%);
}

.about-section h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: var(--color-primary);
}

.features-grid {
    max-width: var(--container-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition-normal);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px);
    border-color: rgba(233, 69, 96, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--color-text);
}

.feature-card p {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* =====================================================
   Bejelentkezett nézetek
   ===================================================== */
.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 40px;
    padding: 40px 30px 0;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
}

.view {
    display: none;
    padding: 0 30px 60px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.view.active {
    display: block;
}

/* Könyv grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.book-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
}

.book-card-image {
    height: 200px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card-content {
    padding: 20px;
}

.book-card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.book-card-author {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.book-card-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
}

.book-difficulty {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.book-difficulty.easy { background: rgba(46, 213, 115, 0.2); color: var(--color-success); }
.book-difficulty.medium { background: rgba(255, 165, 2, 0.2); color: var(--color-hp-mid); }
.book-difficulty.hard { background: rgba(255, 71, 87, 0.2); color: var(--color-danger); }
.book-difficulty.nightmare { background: rgba(139, 0, 139, 0.2); color: #ff00ff; }

/* Karakter grid */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.character-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 25px;
    transition: var(--transition-normal);
    cursor: pointer;
}

.character-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.character-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.character-card .book-title {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* =====================================================
   Modal
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-primary);
}

/* =====================================================
   HP Bar
   ===================================================== */
.hp-bar-container {
    position: relative;
    margin: 15px 0;
}

.hp-bar {
    height: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-hp-full), #7bed9f);
    border-radius: 8px;
    transition: width 0.5s ease, background 0.3s ease;
    position: relative;
}

.hp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 8px 8px 0 0;
}

.hp-bar.mid .hp-fill {
    background: linear-gradient(90deg, var(--color-hp-mid), #ffc107);
}

.hp-bar.low .hp-fill {
    background: linear-gradient(90deg, var(--color-hp-low), #ff6b81);
    animation: hpPulse 1s ease-in-out infinite;
}

@keyframes hpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* =====================================================
   Admin panel
   ===================================================== */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.admin-tab {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.admin-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
}

.admin-tab.active {
    background: var(--color-primary);
    color: white;
}

.admin-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
}

/* Form stílusok */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--color-text);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Táblázat */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-edit {
    background: rgba(255, 165, 2, 0.2);
    color: var(--color-hp-mid);
}

.btn-delete {
    background: rgba(255, 71, 87, 0.2);
    color: var(--color-danger);
}

.btn-small:hover {
    transform: scale(1.05);
}

/* Reszponzív */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .main-nav {
        gap: 10px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .book-preview {
        width: 200px;
        height: 270px;
    }

    .game-container {
        flex-direction: column;
    }

    .character-panel {
        width: 100%;
        order: -1;
    }
}
