/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Paleta z vyrtlixecho.pl */
    --gold:        #B8956C;
    --gold-light:  #C9A877;
    --gold-dark:   #A37F5A;
    --gold-glow:   rgba(184, 149, 108, 0.25);
    --gold-border: rgba(184, 149, 108, 0.2);

    --black:       #000000;
    --black-light: #0D0D0D;
    --charcoal:    #161616;
    --dark:        #1F1F1F;
    --dark-hover:  #282828;

    --white:       #FFFFFF;
    --white-soft:  #FAFAFA;
    --gray-light:  #B5B5B5;
    --gray:        #8A8A8A;
    --gray-dark:   #5A5A5A;

    --danger:      #e74c3c;
    --danger-hover:#c0392b;
    --success:     #B8956C;

    --radius:      12px;
    --radius-sm:   8px;
    --shadow:      0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-gold: 0 10px 40px rgba(184, 149, 108, 0.15);
    --transition:  .2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--black);
    color: var(--white-soft);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ===== Animowane tło (jak na głównej vyrtlixecho.pl) ===== */

/* Siatka ukośnych linii */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(45deg, transparent 48%, rgba(184, 149, 108, 0.08) 48%, rgba(184, 149, 108, 0.08) 52%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(184, 149, 108, 0.08) 48%, rgba(184, 149, 108, 0.08) 52%, transparent 52%);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* Radialny glow */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(184, 149, 108, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(184, 149, 108, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Animacje keyframes */
@keyframes particleFloat {
    0% { transform: translateY(110vh) translateX(0) scale(0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(50vh) translateX(40px) scale(1.5); opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) translateX(-40px) scale(0.5); opacity: 0; }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

/* Unoszące się cząsteczki */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat linear infinite;
    box-shadow: 0 0 20px rgba(184, 149, 108, 1);
}

.particle:nth-child(1)  { left: 10%; animation-duration: 15s; animation-delay: 0s; }
.particle:nth-child(2)  { left: 20%; animation-duration: 18s; animation-delay: 2s; }
.particle:nth-child(3)  { left: 30%; animation-duration: 16s; animation-delay: 4s; }
.particle:nth-child(4)  { left: 40%; animation-duration: 17s; animation-delay: 1s; }
.particle:nth-child(5)  { left: 50%; animation-duration: 19s; animation-delay: 3s; }
.particle:nth-child(6)  { left: 60%; animation-duration: 16s; animation-delay: 5s; }
.particle:nth-child(7)  { left: 70%; animation-duration: 15s; animation-delay: 1.5s; }
.particle:nth-child(8)  { left: 80%; animation-duration: 18s; animation-delay: 2.5s; }
.particle:nth-child(9)  { left: 90%; animation-duration: 17s; animation-delay: 4.5s; }
.particle:nth-child(10) { left: 95%; animation-duration: 16s; animation-delay: 0.5s; }

/* Pulsujące glow */
.grid-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(184, 149, 108, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(184, 149, 108, 0.15) 0%, transparent 25%);
    animation: glowPulse 5s ease-in-out infinite;
}

/* Treść nad tłem */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; width: 100%; position: relative; z-index: 2; }

/* ===== Hero ===== */
.hero {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px 50px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(184, 149, 108, 0.12) 0%, transparent 70%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: 260px;
    height: auto;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 20px rgba(184, 149, 108, 0.35));
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--white);
}

.hero-title span {
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    margin-top: 14px;
    color: var(--gray-light);
    font-size: .9rem;
    font-weight: 300;
    max-width: 560px;
    margin-inline: auto;
    line-height: 1.75;
}

/* ===== Layout ===== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 36px;
    padding-bottom: 80px;
    flex: 1;
}

@media (min-width: 740px) {
    .main-grid {
        grid-template-columns: 350px 1fr;
        gap: 28px;
        align-items: start;
    }
    .form-section { position: sticky; top: 24px; }
}

/* ===== Section titles ===== */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--white);
}

/* ===== Form ===== */
.form-section {
    position: relative;
    z-index: 2;
    background: var(--charcoal);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-light);
}

.req { color: var(--gold); }
.optional { color: var(--gray); font-weight: 400; }

.field input,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--black-light);
    border: 1px solid rgba(184, 149, 108, 0.15);
    border-radius: var(--radius-sm);
    color: var(--white-soft);
    font-family: inherit;
    font-size: .88rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--gray-dark);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.field input.input-error,
.field textarea.input-error {
    border-color: var(--danger);
}

.field-error {
    display: block;
    font-size: .75rem;
    color: var(--danger);
    min-height: 18px;
    margin-top: 4px;
}

/* ===== Formularz zablokowany ===== */
.form-locked {
    text-align: center;
    padding: 24px 12px;
}

.form-locked-icon {
    font-size: 2.4rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.form-locked-msg {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 6px;
}

.form-locked-sub {
    font-size: .82rem;
    color: var(--gray);
    font-weight: 300;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:active { transform: scale(.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--black);
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: var(--shadow-gold);
}

.btn-secondary {
    background: transparent;
    color: var(--gray);
    border: 1px solid rgba(184, 149, 108, 0.2);
    width: 100%;
    margin-top: 8px;
}

.btn-secondary:hover { background: var(--dark); color: var(--white-soft); }

.btn-sm {
    padding: 6px 14px;
    font-size: .78rem;
}

.btn-edit {
    background: var(--dark);
    color: var(--gold-light);
    border: 1px solid var(--gold-border);
}
.btn-edit:hover {
    background: var(--gold);
    color: var(--black);
}

.btn-delete {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.25);
}
.btn-delete:hover {
    background: var(--danger);
    color: var(--white);
}

/* ===== Posts ===== */
.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.post-count {
    font-size: .8rem;
    color: var(--gray);
    background: var(--charcoal);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--gold-border);
}

.loading {
    text-align: center;
    color: var(--gray);
    padding: 40px 0;
}

.post-card {
    background: var(--charcoal);
    border: 1px solid rgba(184, 149, 108, 0.12);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
    animation: fadeIn .35s ease;
}

.post-card:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 24px rgba(184, 149, 108, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--white);
}

.post-card-meta {
    font-size: .76rem;
    color: var(--gray);
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.post-card-meta .author { color: var(--gold-light); }

.post-card-body {
    font-size: .88rem;
    color: var(--gray-light);
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 300;
}

.post-card-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.post-card-updated {
    font-size: .72rem;
    color: var(--gray-dark);
    margin-top: 10px;
    font-style: italic;
}

.no-posts {
    text-align: center;
    color: var(--gray);
    padding: 48px 0;
    font-size: .9rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--charcoal);
    border: 1px solid var(--gold);
    color: var(--white-soft);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(184, 149, 108, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: transform .35s ease, opacity .35s ease;
    z-index: 999;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid var(--gold-border);
    padding: 22px 0;
    font-size: .78rem;
    color: var(--gray);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.footer a {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover { text-decoration: underline; }

/* ===== Admin toggle ===== */
.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-toggle {
    background: var(--dark);
    border: 1px solid var(--gold-border);
    color: var(--gray-light);
    font-family: inherit;
    font-size: .78rem;
    padding: 5px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.admin-toggle:hover { color: var(--gold-light); border-color: var(--gold); background: var(--dark-hover); }

.admin-toggle.active {
    background: var(--gold);
    color: var(--black);
    border-color: var(--gold);
    font-weight: 600;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--charcoal);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: fadeIn .25s ease;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--white);
    text-align: center;
}

/* ===== Admin badge na postach ===== */
.admin-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 739px) {
    .hero { padding: 44px 20px 32px; }
    .hero-logo { width: 64px; height: 64px; }
    .hero-title { font-size: 2rem; }
    .main-grid { gap: 28px; padding-top: 28px; padding-bottom: 48px; }
    .form-section { padding: 20px; }
    .post-card { padding: 18px; }
}
