:root {
    --bg-main: #0a0f0b;          /* Fonto tis selidas */
    --container-bg: #131c15;     /* Fonto tou megalou ramatos */
    --card-bg: #1a261c;          /* Fonto ton karton */
    --border: #233626;
    --accent-lime: #b6f24a;
    --discord-blue: #5865f2;     /* Mple xroma Discord */
    --discord-blue-hover: #4752c4;
    --text-main: #f0f7f1;
    --text-muted: #8fa691;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    position: relative;
}

/* Site background (assets/background.*) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(10, 15, 11, .72), rgba(10, 15, 11, .72)),
        url("assets/background.webp"),
        url("assets/background.png"),
        url("assets/background.jpg"),
        url("assets/background.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Header */
.top-bar {
    border-bottom: 1px solid var(--border);
    background-color: rgba(10, 15, 11, .88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-nav {
    max-width: 1050px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.top-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.top-title h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Discord Button Panw Deksia */
.nav-discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--discord-blue);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-discord-btn:hover {
    background-color: var(--discord-blue-hover);
    transform: translateY(-1px);
}

.nav-discord-btn svg {
    width: 18px;
    height: 18px;
}

/* Main Layout */
.page {
    flex: 1;
    max-width: 1050px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Projects Container */
.projects-container {
    background-color: var(--container-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

/* Header entos tou container (Titlos + Filtra) */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-lime);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.filter-btn.active {
    background-color: var(--accent-lime);
    color: #000;
    border-color: var(--accent-lime);
    font-weight: 600;
}

/* Projects Grid - 2 ana seira */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Project Card */
.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    border-color: var(--accent-lime);
    transform: translateY(-2px);
}

.project-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.project-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.category-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-lime);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.project-name {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 18px;
    line-height: 1.4;
}

.btn {
    display: inline-block;
    padding: 8px 18px;
    background-color: var(--accent-lime);
    color: #000;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: opacity 0.2s ease;
}

.btn:hover {
    opacity: 0.85;
}

/* Megalutero Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background-color: var(--container-bg);
    padding: 48px 20px 28px;
    margin-top: auto;
}

.footer-content {
    max-width: 1050px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.footer-brand h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 400px;
}

.socials {
    list-style: none;
    display: flex;
    gap: 16px;
}

.socials a {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.socials a:hover {
    color: var(--accent-lime);
    border-color: var(--accent-lime);
    transform: translateY(-2px);
}

.socials svg {
    width: 22px;
    height: 22px;
}

.footer-bottom {
    max-width: 1050px;
    margin: 24px auto 0;
    text-align: center;
}

.footer-note {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive gia kinita */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 18px;
    }

    .project-img {
        width: 64px;
        height: 64px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .nav-discord-btn span {
        display: none; /* Deixnei mono to icon se mikres othones */
    }

    .nav-discord-btn {
        padding: 8px;
    }
}

.filter-btn.is-disabled { opacity: .45; cursor: not-allowed; }



[hidden] { display: none !important; }

.project-card[hidden] { display: none !important; }

body.no-scroll { overflow: hidden; }

.filter-btn.is-disabled { opacity: .45; cursor: not-allowed; }

.toast-container {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top));
    right: calc(14px + env(safe-area-inset-right));
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 28px));
    pointer-events: none;
}

.toast {
    --c: #4cc2ff;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 16px 14px;
    background: #1a261d;
    color: #e8f3ea;
    border: 1px solid #223326;
    border-left: 4px solid var(--c);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    overflow: hidden;
    pointer-events: auto;
    animation: toast-in .25s cubic-bezier(.2, .8, .2, 1);
}

.toast-info { --c: #4cc2ff; }
.toast-warning { --c: #f5b942; }
.toast-error { --c: #ff5d5d; }

.toast.leaving { animation: toast-out .22s ease-in forwards; }

.toast-icon { width: 22px; height: 22px; flex: none; color: var(--c); margin-top: 1px; }
.toast-icon svg { width: 100%; height: 100%; }

.toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast-body strong { font-size: .95rem; }
.toast-body span { color: #9db3a2; font-size: .88rem; overflow-wrap: anywhere; }

.toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9db3a2;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.toast-close:hover { color: #e8f3ea; background: rgba(255, 255, 255, .07); }

.toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--c);
    transform-origin: left;
    animation: toast-bar var(--duration, 4000ms) linear forwards;
}

.toast:hover .toast-bar { animation-play-state: paused; }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.open { display: flex; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 3, .78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: modal-fade .2s ease-out;
}

.modal-box {
    position: relative;
    width: min(680px, 100%);
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #0f1611;
    color: #e8f3ea;
    border: 1px solid #223326;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    animation: modal-in .22s cubic-bezier(.2, .8, .2, 1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover { background: #1bd96a; color: #04140a; }

.modal-gallery { background: #060a07; border-bottom: 1px solid #223326; }

.gal-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gal-stage img { width: 100%; height: 100%; object-fit: contain; }

.gal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    cursor: pointer;
}

.gal-nav:hover { background: #1bd96a; color: #04140a; }
.gal-nav.prev { left: 10px; }
.gal-nav.next { right: 10px; }

.gal-count {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: .76rem;
}

.gal-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }

.gal-thumbs button {
    flex: none;
    width: 76px;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #131c15;
    overflow: hidden;
    cursor: pointer;
    opacity: .6;
}

.gal-thumbs button:hover { opacity: 1; }
.gal-thumbs button.active { opacity: 1; border-color: #1bd96a; }
.gal-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.modal-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px 22px 24px;
}

.modal-body h3 { margin: 0; font-size: clamp(1.2rem, 4.5vw, 1.5rem); line-height: 1.2; padding-right: 36px; }
.modal-body p { margin: 0 0 6px; color: #b9cbbd; line-height: 1.6; }

.modal-body .btn-solid { background: #1bd96a; color: #04140a; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 640px) {
    .toast-container { left: 14px; right: 14px; width: auto; }

    .modal { padding: 0; align-items: flex-end; }

    .modal-box {
        width: 100%;
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom);
        animation: sheet-in .25s cubic-bezier(.2, .8, .2, 1);
    }

    .modal-body .btn { width: 100%; text-align: center; }

    .gal-nav { width: 36px; height: 36px; }
    .gal-thumbs button { width: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .toast, .toast-bar, .modal-box, .modal-backdrop { animation-duration: .01ms !important; }
}

/* Markdown body (Modrinth project description) */
.modal-body .md { width: 100%; color: #b9cbbd; line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { color: #e8f3ea; line-height: 1.25; margin: 18px 0 8px; }
.md h1 { font-size: 1.3rem; }
.md h2 { font-size: 1.15rem; }
.md h3, .md h4 { font-size: 1.02rem; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md a { color: var(--accent-lime); text-decoration: underline; }
.md img { max-width: 100%; height: auto; border-radius: 8px; }
.md hr { border: 0; border-top: 1px solid #223326; margin: 16px 0; }
.md blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid #223326; color: #8fa691; }
.md code { background: #131c15; padding: 1px 6px; border-radius: 5px; font-size: .88em; }
.md pre { background: #131c15; padding: 12px; border-radius: 8px; overflow-x: auto; margin: 0 0 10px; }
.md pre code { background: none; padding: 0; }
.md table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 10px; }
.md th, .md td { border: 1px solid #223326; padding: 6px 10px; }


/* Modal action buttons (Modrinth / CurseForge) */
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; }
.modal-body #modal-cf { background: #f16436; color: #fff; }

/* Skin cards with 3D viewer */
.skin-card { flex-direction: column; align-items: stretch; min-width: 0; }

.skin-viewer {
    position: relative;
    width: 100%;
    height: 340px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: radial-gradient(circle at 50% 35%, #233626 0%, #0f1611 78%);
    overflow: hidden;
    cursor: grab;
}

.skin-viewer:active { cursor: grabbing; }
.skin-viewer canvas { position: absolute; inset: 0; display: block; }
.skin-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.skin-hint {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: var(--text-muted);
    font-size: .75rem;
    pointer-events: none;
}

@media (max-width: 640px) {
    .modal-actions .btn { flex: 1 1 100%; }
    .skin-viewer { height: 300px; }
}

/* ---- Enlarge button (inside the modal gallery) ---- */
.gal-expand {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    cursor: pointer;
}
.gal-expand svg { width: 20px; height: 20px; }
.gal-expand:hover { background: #1bd96a; color: #04140a; }

/* ---- Enlarged viewer (big panel, NOT browser fullscreen) ---- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.lightbox.open { display: flex; }

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 3, .86);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modal-fade .2s ease-out;
}

.lightbox-box {
    position: relative;
    width: min(1400px, 100%);
    height: 86vh;
    height: 86dvh;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #060a07;
    border: 1px solid #223326;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    animation: modal-in .22s cubic-bezier(.2, .8, .2, 1);
}

.lightbox-img { width: 100%; height: 100%; object-fit: contain; }

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.lightbox-close:hover { background: #1bd96a; color: #04140a; }

@media (max-width: 600px) {
    .lightbox { padding: 10px; }
}