:root {
    --primary: #a5d8ff;
    --primary-dark: #74c0fc;
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #2d3436;
    --gray: #adb5bd;
    --pink: #ffccd5;
    --heart: #ff6b6b;
    --mint: #a5f0d4;
}

* { box-sizing: border-box; margin:0; padding:0; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
    color: var(--text);
    padding: 16px 12px 80px;
    min-height: 100vh;
}

.header { text-align: center; margin: 24px 0 32px; }
h1 {
    font-size: 2.5rem;
    color: #4dabf7;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(165,216,255,0.5);
}
.subtitle { color: #555; font-size: 1.15rem; }

.top-likes-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    margin: 0 auto 28px;
    max-width: 420px;
    text-align: center;
}
.top-likes-card h3 { color: var(--heart); margin-bottom: 12px; font-size: 1.2rem; }
#top-likes p { margin: 8px 0; font-size: 1.05rem; color: #444; }
#top-likes a { color: #339af0; text-decoration: none; font-weight: 600; }
#top-likes a:hover { text-decoration: underline; }

.notice-board {
    background: #fff9e6;
    border: 2px dashed #ffd43b;
    border-radius: 14px;
    padding: 16px;
    margin: 0 auto 28px;
    max-width: 520px;
    text-align: center;
    font-size: 0.98rem;
    color: #5c3f00;
}

.post-form-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    margin-bottom: 32px;
}
#teacherName, #postContent {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 1.05rem;
}
#postContent { resize: vertical; min-height: 120px; }
.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4dabf7;
    font-weight: 600;
    cursor: pointer;
    margin: 10px 0 18px;
}
.post-form-card button {
    background: linear-gradient(90deg, #74c0fc, #4dabf7);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(116,192,252,0.4);
}
.post-form-card button:active { transform: translateY(1px); }

.post {
    background: white;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    position: relative;
}
.post::before {
    content: "💌";
    position: absolute;
    top: -14px;
    right: 16px;
    font-size: 3rem;
    opacity: 0.13;
    transform: rotate(12deg);
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}
.post-header span {
    font-weight: 700;
    font-size: 1.22rem;
    color: #2f80ed;
}

.admin-actions {
    display: flex;
    gap: 10px;
}
.admin-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}
.approve-btn { background: #40c057; }
.approve-btn:hover { background: #37b24d; transform: translateY(-1px); }
.delete-btn { background: #fa5252; }
.delete-btn:hover { background: #f03e3e; transform: translateY(-1px); }
.edit-btn { background: #4dabf7; }
.edit-btn:hover { background: #339af0; transform: translateY(-1px); }

.post-content {
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 0;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px;
    font-size: 1.05rem;
    color: #343a40;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.post-content p {
    margin: 0;
}

.post-media { margin: 0 0 16px; border-radius: 12px; overflow: hidden; }
.post-media img, .post-media video {
    width: 100%;
    display: block;
    border-radius: 12px;
    cursor: pointer;
}
.post-media.multiple { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #e9ecef;
    font-size: 0.95rem;
    color: var(--gray);
}
.post-date {
    font-size: 0.9rem;
    color: #6c757d;
    background: #f1f3f5;
    padding: 4px 10px;
    border-radius: 12px;
}
.like-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.like-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.25s ease;
}
.like-btn:hover { transform: scale(1.12); color: var(--heart); }
.like-btn.liked { color: var(--heart); }
.like-btn i { font-size: 1.5rem; transition: transform 0.2s; }
.like-btn.liked i { transform: scale(1.25); }
.like-count { font-weight: 600; color: #495057; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-content { position: relative; max-width: 92%; max-height: 90vh; }
.modal-media { max-width: 100%; max-height: 85vh; border-radius: 12px; }
.close {
    position: absolute;
    top: -45px;
    right: 0;
    color: white;
    font-size: 2.8rem;
    cursor: pointer;
}

#back-btn {
    display: block;
    margin: 40px auto 20px;
    padding: 12px 32px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(255,107,107,0.4);
    cursor: pointer;
}

.loading, .empty { text-align: center; color: #666; padding: 50px 0; font-size: 1.15rem; }

@media (min-width: 600px) {
    .container { max-width: 620px; margin: 0 auto; }
}