:root {
    --bg: #03070d;
    --panel: rgba(15, 22, 33, 0.82);
    --line: rgba(145, 175, 255, 0.35);
    --muted: #b8c1d9;
    --text: #edf3ff;
    --accent: #79a7ff;
    --accent-2: #9ae4ff;
    --danger: #ff6b81;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    position: relative;
    overflow-x: hidden;
}

.stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at top, rgba(81, 116, 201, 0.22), transparent 40%);
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 7px rgba(173, 216, 255, 0.9);
    animation: twinkle var(--duration) ease-in-out infinite alternate;
    opacity: 0.8;
}

.star.shooting {
    width: 70px;
    height: 2px;
    border-radius: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.8), rgba(255,255,255,0));
    box-shadow: 0 0 16px rgba(173, 216, 255, 0.7);
    animation: shoot var(--duration) linear infinite;
}

@keyframes twinkle {
    from { opacity: 0.2; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.6); }
}

@keyframes shoot {
    0% {
        transform: translate3d(-30vw, 0, 0) rotate(-15deg);
        opacity: 0;
    }
    15% { opacity: 1; }
    100% {
        transform: translate3d(80vw, 24vh, 0) rotate(-15deg);
        opacity: 0;
    }
}

.page {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.topbar {
    display: flex;
    justify-content: center;
    gap: 24px;
    align-items: center;
    padding-top: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    position: relative;
    flex-wrap: wrap;
}

.nav-link {
    position: relative;
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 12px 18px;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
    text-decoration: none;
}

.nav-link + .nav-link::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.35);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-2);
    text-shadow: 0 0 12px rgba(154, 228, 255, 0.6);
}

.selection-note {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 28px;
    padding: 0 8px;
}

.content-section {
    display: none;
    animation: fadeIn 0.25s ease;
}

.content-section.active {
    display: block;
}

.content-section[data-tab="add"] {
    overflow: hidden;
}

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

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 26px;
}

.catalog-column {
    background: rgba(9, 14, 22, 0.7);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 18px 12px;
    box-shadow: 0 0 18px rgba(58, 91, 146, 0.14);
    display: flex;
    flex-direction: column;
    min-height: 360px;
}

.left-column {
    order: 1;
}

.right-column {
    order: 2;
}

.catalog-column h3 {
    text-align: center;
    margin: 0 0 18px;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.search-box {
    width: 100%;
    background: rgba(15, 22, 33, 0.9);
    border: 1px solid rgba(154, 228, 255, 0.25);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    outline: none;
}

.search-box::placeholder {
    color: rgba(255,255,255,0.38);
}

.media-scroll {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.media-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.media-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 160px;
}

.media-list li {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(18, 29, 41, 0.82);
    border: 1px solid rgba(121, 167, 255, 0.1);
    color: var(--text);
    font-size: 0.97rem;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 20px 16px;
    border: 1px dashed rgba(154, 228, 255, 0.2);
    border-radius: 10px;
    font-style: italic;
}

.form-shell {
    max-width: 500px;
    margin: 26px auto 0;
    background: rgba(9, 14, 22, 0.7);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px 22px;
    box-shadow: 0 0 20px rgba(58, 91, 146, 0.2);
}

.form-shell h2 {
    text-align: center;
    margin: 0 0 22px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: 0.05em;
    color: var(--text);
}

.admin-gate {
    max-width: 420px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    border: 1px solid rgba(154, 228, 255, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(15, 22, 33, 0.9);
    color: var(--text);
    font-size: 1rem;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.send-btn {
    border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04111d;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 18px rgba(121, 167, 255, 0.35);
}

.send-btn:hover {
    transform: translateY(-1px);
}

.flash-message {
    margin-top: 16px;
    text-align: center;
    color: #9ef7c8;
    min-height: 24px;
}

@media (max-width: 760px) {
    .stars {
        opacity: 0.28;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        gap: 10px;
    }

    .nav-link {
        font-size: 1rem;
        padding: 12px 8px 16px;
    }
}
