﻿:root {
    --ig-bg: #fafafa;
    --ig-surface: #ffffff;
    --ig-border: #dbdbdb;
    --ig-text: #262626;
    --ig-muted: #8e8e8e;
    --ig-blue: #0095f6;
    --ig-blue-strong: #1877f2;
    --ig-danger: #ed4956;
    --ig-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ig-text);
    font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 6%, rgba(255, 120, 120, 0.06), transparent 26%),
        radial-gradient(circle at 92% 4%, rgba(0, 149, 246, 0.08), transparent 24%),
        var(--ig-bg);
}

a {
    color: var(--ig-text);
    text-decoration: none;
}

a:hover {
    color: #111111;
}

.page-shell {
    width: min(1160px, calc(100% - 20px));
    margin: 0 auto;
    padding: 0 10px 28px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    margin-top: 0;
    margin-bottom: 18px;
    padding: 12px 12px;
    border: 1px solid var(--ig-border);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    border-bottom: 1px solid var(--ig-border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af, #515bd4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-nav a,
.link-button {
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--ig-border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ig-text);
    padding: 8px 12px;
    cursor: pointer;
}

.nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-chip .nav-ico {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #555;
}

.nav-chip:hover {
    transform: translateY(-1px);
}

.nav-chip.is-active {
    border-color: #c2e4fb;
    background: #eef7ff;
}

.nav-chip.is-active .nav-ico {
    color: var(--ig-blue);
}

.top-nav a:hover,
.link-button:hover {
    background: #f6f6f6;
}

.center-card {
    max-width: 560px;
    margin: 40px auto 0;
    border: 1px solid var(--ig-border);
    border-radius: 16px;
    box-shadow: var(--ig-shadow);
    background: var(--ig-surface);
    padding: 30px;
}

.hero-card {
    text-align: center;
}

.hero-card h1 {
    margin: 0;
    font-size: 2rem;
}

.hero-card p {
    color: var(--ig-muted);
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.dashboard-shell {
    padding-bottom: 38px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 14px;
}

.student-layout,
.feed-layout {
    display: grid;
    gap: 14px;
}

.feed-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.panel {
    border: 1px solid var(--ig-border);
    border-radius: 14px;
    background: var(--ig-surface);
    box-shadow: var(--ig-shadow);
    padding: 16px;
    animation: rise 0.35s ease;
}

.panel.warning {
    border-color: #f2b9be;
    background: #fff9fa;
}

.notice {
    border-color: #f0d18a;
    background: #fffbf2;
}

.status-box {
    border: 1px dashed var(--ig-border);
    border-radius: 10px;
    background: #fcfcfc;
    padding: 10px;
    min-height: 64px;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.stack-form label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea {
    border: 1px solid var(--ig-border);
    border-radius: 10px;
    background: #fafafa;
    color: var(--ig-text);
    padding: 10px 12px;
    font: inherit;
    width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
textarea:focus {
    outline: none;
    border-color: #9fd2f9;
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.12);
}

input[type="range"] {
    width: 100%;
}

textarea {
    resize: vertical;
}

.button,
button,
.link-button {
    font: inherit;
}

.button,
button {
    border: 1px solid var(--ig-border);
    border-radius: 10px;
    padding: 9px 14px;
    background: #fff;
    color: var(--ig-text);
    font-weight: 600;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #f6f6f6;
}

.button:active,
button:active {
    transform: translateY(1px);
}

.button:disabled,
button:disabled,
input:disabled,
textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.button.primary {
    border-color: var(--ig-blue);
    background: var(--ig-blue);
    color: #fff;
}

.button.primary:hover {
    background: var(--ig-blue-strong);
}

.button.primary:active {
    filter: saturate(1.1);
}

.button.danger {
    border-color: #f3c2c7;
    background: #fff6f7;
    color: var(--ig-danger);
}

.button.ghost {
    background: transparent;
}

.status-text {
    min-height: 20px;
    margin: 0;
    color: var(--ig-muted);
}

.status-text.error,
.error {
    color: var(--ig-danger);
}

.status-text.success,
.success {
    color: #1f9d52;
}

.muted {
    color: var(--ig-muted);
}

.hidden {
    display: none !important;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--ig-border);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notification-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-color: #c9e4fa;
    background: linear-gradient(92deg, #f5fbff 0%, #ffffff 100%);
}

.notif-content p {
    margin: 2px 0 0;
    color: var(--ig-muted);
    font-size: 0.9rem;
}

.story-row {
    padding: 10px 12px;
}

.story-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.story-track::-webkit-scrollbar {
    height: 8px;
}

.story-track::-webkit-scrollbar-thumb {
    background: #dfdfdf;
    border-radius: 999px;
}

.story-item {
    min-width: 72px;
    max-width: 86px;
    display: grid;
    gap: 6px;
    justify-items: center;
    text-align: center;
    animation: rise 0.35s ease;
    text-decoration: none;
}

.story-item span {
    font-size: 0.75rem;
    color: #5f5f5f;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-item:hover span {
    color: #1d1d1d;
}

.story-ring {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(145deg, #f58529 0%, #dd2a7b 52%, #8134af 78%, #515bd4 100%);
    display: grid;
    place-items: center;
}

.story-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #f2f2f2;
    color: #313131;
    font-size: 0.86rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.story-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-thumb-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.story-ring-create {
    background: linear-gradient(145deg, #1ea7ff 0%, #006cf7 100%);
}

.story-core-create {
    background: linear-gradient(145deg, #25afff 0%, #0576ff 100%);
    color: #fff;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1;
}

.story-create span {
    color: #0078ff;
    font-weight: 700;
}

.story-empty {
    font-size: 0.9rem;
    padding: 10px 6px;
}

.story-bubble.placeholder {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: linear-gradient(90deg, #efefef, #f9f9f9, #efefef);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
    display: grid;
    place-items: center;
    color: #aaa;
}

.editor-panel {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid var(--ig-border);
    border-radius: 12px;
    background: #ffffff;
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) minmax(220px, 1fr);
    gap: 12px;
}

.preview-box,
.controls-box {
    border: 1px solid var(--ig-border);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.controls-box {
    display: grid;
    gap: 10px;
    align-content: start;
}

.emoji-tools {
    border-top: 1px dashed var(--ig-border);
    padding-top: 10px;
    display: grid;
    gap: 8px;
}

.emoji-tools select {
    width: 100%;
}

.emoji-hint {
    margin: 0;
    font-size: 0.82rem;
}

.inline-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

#imageCanvas,
#videoPreview {
    width: 100%;
    max-height: 440px;
    object-fit: contain;
    background: #f4f4f4;
    border-radius: 8px;
    display: block;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.post-tile {
    border: 1px solid var(--ig-border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.post-tile img,
.post-tile video {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f4f4f4;
}

.tile-caption {
    padding: 8px;
    font-size: 0.9rem;
}

.feed-list {
    width: min(680px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.feed-post {
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 36px -28px rgba(8, 23, 41, 0.44), 0 6px 16px rgba(8, 23, 41, 0.1);
    animation: rise 0.35s ease;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feed-post:hover {
    border-color: #d8d8d8;
    transform: translateY(-2px);
    box-shadow: 0 24px 40px -28px rgba(8, 23, 41, 0.5), 0 10px 20px rgba(8, 23, 41, 0.12);
}

.feed-post-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ig-border);
    font-size: 0.92rem;
}

.feed-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #ff7b54 0%, #ff3c78 55%, #7f49ff 100%);
    box-shadow: 0 4px 10px rgba(255, 60, 120, 0.24);
}

.feed-author {
    display: grid;
    gap: 2px;
}

.profile-link {
    color: #0a65e8;
    text-decoration: none;
}

.profile-link:hover {
    text-decoration: underline;
}

.profile-public-head h2 {
    margin: 0 0 4px;
}

.profile-public-head p {
    margin: 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.profile-tile {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.profile-tile-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f4f4f4;
}

.profile-tile-media img,
.profile-tile-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-tile-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.58) 100%);
}

.feed-time {
    color: var(--ig-muted);
    font-size: 0.82rem;
}

.feed-media img,
.feed-media video {
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    background: #f4f4f4;
    display: block;
}

.feed-caption {
    margin: 0;
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--ig-border);
    line-height: 1.45;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--ig-border);
    flex-wrap: wrap;
}

.icon-action {
    border: 0;
    background: transparent;
    color: #252525;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.icon-action:hover {
    background: #f5f7fb;
    color: #111;
}

.icon-action:active {
    transform: translateY(1px);
}

.action-ico {
    font-size: 1rem;
    line-height: 1;
}

.like-btn.is-liked {
    color: #eb3569;
}

.like-btn.is-disabled,
.like-btn:disabled {
    opacity: 0.46;
    cursor: not-allowed;
}

.likes-count {
    margin-left: auto;
    font-size: 0.88rem;
    color: #4f4f4f;
    font-weight: 600;
}

.post-highlight {
    border-color: #72c8ff !important;
    box-shadow: 0 0 0 3px rgba(0, 149, 246, 0.22), 0 20px 38px -30px rgba(0, 149, 246, 0.55);
}

.comment-section {
    padding: 12px 14px 14px;
}

.comment-list {
    display: grid;
    gap: 7px;
    margin-bottom: 10px;
}

.comment-item {
    font-size: 0.92rem;
    padding: 7px 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, #fcfcfc 0%, #f9f9f9 100%);
    border: 1px solid #ededed;
}

.comment-form input[type="text"] {
    border-radius: 999px;
    background: #fff;
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.edge-notification-stack {
    position: fixed;
    right: 16px;
    top: 86px;
    z-index: 70;
    display: grid;
    gap: 10px;
    width: min(340px, calc(100vw - 24px));
    pointer-events: none;
}

.notif-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(16, 20, 26, 0.78);
    backdrop-filter: blur(6px);
    color: #fff;
    pointer-events: auto;
}

.notif-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.84rem;
    font-weight: 700;
}

.notif-bell {
    font-size: 0.72rem;
}

.notif-badge {
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: #ff3d75;
    color: #fff;
    font-size: 0.73rem;
    font-weight: 700;
}

.notif-badge.is-empty {
    background: #5d6775;
}

.notif-toggle {
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.77rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.notif-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notif-toggle.is-active {
    background: rgba(42, 213, 255, 0.22);
}

.notif-items {
    display: grid;
    gap: 10px;
}

.edge-notification {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: rgba(20, 24, 30, 0.85);
    color: #fff;
    box-shadow: 0 18px 32px -26px rgba(0, 0, 0, 0.62), 0 7px 18px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(7px);
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}

.edge-notification.is-read {
    opacity: 0.72;
}

.edge-notification-stack.unread-only .edge-notification.is-read {
    display: none;
}

.edge-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.edge-notification.out {
    opacity: 0;
    transform: translateX(16px);
}

.edge-notif-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #2ad5ff;
    box-shadow: 0 0 0 4px rgba(42, 213, 255, 0.22);
}

.edge-notif-body {
    display: grid;
    gap: 2px;
}

.edge-notif-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.edge-notif-body strong {
    font-size: 0.86rem;
    letter-spacing: 0.02em;
}

.edge-notif-body p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.86rem;
}

.edge-notif-action {
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.edge-notif-action:hover {
    background: rgba(255, 255, 255, 0.22);
}

.edge-notif-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.edge-notif-mark {
    border: 0;
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.edge-notif-mark:hover {
    background: rgba(255, 255, 255, 0.2);
}

.student-edge-stack {
    top: 76px;
}

.notif-kind-post {
    border-left: 3px solid #2ad5ff;
}

.notif-kind-post .edge-notif-icon {
    background: rgba(42, 213, 255, 0.24);
}

.notif-kind-like {
    border-left: 3px solid #ff5f8e;
}

.notif-kind-like .edge-notif-icon {
    background: rgba(255, 95, 142, 0.24);
}

.notif-kind-comment {
    border-left: 3px solid #ffc34f;
}

.notif-kind-comment .edge-notif-icon {
    background: rgba(255, 195, 79, 0.24);
}

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

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 980px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

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

    .post-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .edge-notification-stack {
        right: 12px;
        top: 72px;
    }
}

@media (max-width: 760px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .top-nav {
        flex-wrap: wrap;
    }

    .nav-chip {
        min-height: 34px;
    }

    .top-nav a,
    .link-button {
        padding: 7px 10px;
        font-size: 0.84rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .page-shell {
        width: 100%;
        padding: 0 8px 22px;
    }

    .story-item {
        min-width: 64px;
    }

    .story-ring,
    .story-bubble.placeholder {
        width: 56px;
        height: 56px;
    }

    .profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .feed-post {
        border-radius: 12px;
    }

    .edge-notification-stack {
        width: calc(100vw - 14px);
        right: 7px;
        top: 68px;
    }
}
