/* ── Global reset ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Navbar ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    z-index: 1000;
    padding: 1.8rem 0;
    border-bottom: 1px solid rgba(255, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.navbar:hover {
    background-color: rgba(0, 0, 0, 0.65);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 0, 0, 0.7);
}

.nav-back {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-back:hover {
    color: #ff0000;
    border-color: rgba(255, 0, 0, 0.3);
    background-color: rgba(255, 0, 0, 0.07);
}

/* ── Page wrapper ── */
.backend-page {
    min-height: 100vh;
    padding: 130px 2rem 4rem;
    max-width: 860px;
    margin: 0 auto;
    animation: pageFadeIn 0.35s ease forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.backend-header {
    text-align: center;
    margin-bottom: 3rem;
}

.backend-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow:
        0 0 8px rgba(255, 0, 0, 0.3),
        0 0 30px rgba(255, 0, 0, 0.15);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.backend-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

/* ── Section label ── */
.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 0, 0, 0.7);
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

/* ── Directory list ── */
.dir-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

/* ── Directory card ── */
.dir-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 0, 0, 0.18);
    border-left: 3px solid #ff0000;
    border-radius: 8px;
    backdrop-filter: blur(12px);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.3rem 1.6rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
}

.dir-card:hover {
    background-color: rgba(255, 0, 0, 0.07);
    border-color: rgba(255, 0, 0, 0.45);
    border-left-color: #ff0000;
    box-shadow: 0 8px 32px rgba(255, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dir-card-left {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    min-width: 0;
}

.dir-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff2222;
    font-size: 1.1rem;
}

.dir-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.dir-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.dir-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dir-arrow {
    flex-shrink: 0;
    color: rgba(255, 0, 0, 0.5);
    font-size: 1.2rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.dir-card:hover .dir-arrow {
    transform: translateX(4px);
    color: #ff2222;
}

/* ── Status bar ── */
.status-bar {
    margin-top: 3rem;
    padding: 1rem 1.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-label {
    color: rgba(255, 255, 255, 0.5);
}

/* ── Back to Backend button ── */
/* Usage: <a class="btn-backend" href="/backend">← Backend</a> */
.btn-backend {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    background: rgba(255, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-backend:hover {
    color: #ff0000;
    border-color: rgba(255, 0, 0, 0.45);
    background: rgba(255, 0, 0, 0.1);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.08);
}

.btn-backend svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-backend:hover svg {
    transform: translateX(-3px);
}

/* ── Embed / iframe container ── */
.embed-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 0, 0, 0.18);
    margin-bottom: 2rem;
}

.embed-container iframe {
    width: 100%;
    display: block;
    border: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .backend-title { font-size: 2rem; }
    .dir-card { padding: 1.1rem 1.2rem; }
}
