/* ==========================================
    BASIC SETUP & THEME
    ========================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

body { 
    background-color: #f0f2f5; 
    color: #1c1e21; 
    line-height: 1.6; 
}

.hidden { display: none !important; }

/* ==========================================
    AUTH / LOGIN PAGE
    ========================================== */
.auth-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
}

button {
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

button:active { transform: scale(0.95); }

/* ==========================================
    HEADER & NAVIGATION (ICON ONLY)
    ========================================== */
header {
    background: #27ae60;
    color: white;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 { font-size: 1.2rem; margin-bottom: 15px; letter-spacing: 1px; }

nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    background: white;
    padding: 10px;
    border-radius: 50px;
    margin: 0 10px;
}

nav ul li a {
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: 0.3s;
}

nav ul li a:hover, nav ul li a:active { color: #27ae60; }
.material-symbols-outlined { font-size: 28px; }

/* ==========================================
    FEED & CONTENT (FIXED ENTER/NEWLINE)
    ========================================== */
main { padding: 15px; max-width: 600px; margin: 0 auto; padding-bottom: 80px; }

.info-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

/* Biar postingan bisa di-enter / garis baru */
.info-card p, .post-bar {
    white-space: pre-wrap; 
    word-wrap: break-word;
}

.img-hero {
    width: 100%;
    border-radius: 10px;
    margin: 10px 0;
    object-fit: cover;
}

/* POSTINGAN BAR */
.post-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.nav-avatar-main {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #27ae60;
}

.post-bar {
    flex: 1;
    background: #f0f2f5;
    padding: 10px 15px;
    border-radius: 20px;
    color: #65676b;
    cursor: pointer;
}

/* ==========================================
    HUB KESISWAAN (V5 SPECIAL)
    ========================================== */
.hub-intro { text-align: center; margin-bottom: 20px; }
.hub-list { display: flex; flex-direction: column; gap: 12px; }

.hub-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #eee;
}

.hub-item:active { background: #f9f9f9; transform: translateX(5px); }

.hub-icon-box {
    width: 50px;
    height: 50px;
    background: #e8f5e9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.hub-info-text { flex: 1; }
.hub-info-text b { display: block; color: #2c3e50; font-size: 1rem; }
.hub-info-text p { font-size: 0.8rem; color: #7f8c8d; }
.hub-item .material-symbols-outlined { font-size: 18px; color: #ccc; }

.ppdb-highlight {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
}

.ppdb-highlight .hub-info-text b, 
.ppdb-highlight .hub-info-text p { color: white; }
.ppdb-highlight .hub-icon-box { background: rgba(255,255,255,0.2); }

/* BACK NAVIGATION */
.back-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #27ae60;
    font-weight: bold;
    margin-bottom: 15px;
    cursor: pointer;
}

/* ==========================================
    PRESENCE / STUDENT LIST
    ========================================== */
.student-status-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 15px;
}

.student-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    position: relative;
}

.student-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
}

.online-border { border: 3px solid #2ecc71; padding: 2px; background: white; }

.status-label {
    position: absolute;
    top: -5px;
    background: #27ae60;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.student-item span { font-size: 0.7rem; margin-top: 5px; font-weight: 500; }

/* ==========================================
    CHAT SYSTEM
    ========================================== */
#chat-box {
    height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
}

.chat-bubble-container { display: flex; gap: 10px; align-items: flex-start; }
.chat-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }

.chat-content {
    background: white;
    padding: 10px;
    border-radius: 15px;
    border-top-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 80%;
}

.chat-content p { 
    font-size: 0.9rem; 
    white-space: pre-wrap; /* Chat juga bisa di-enter */
}

#input-area { display: flex; gap: 10px; margin-top: 10px; }
#message-input { height: 45px; resize: none; }
#send-btn { background: #27ae60; color: white; padding: 0 20px; border-radius: 10px; }

/* ==========================================
    GURU & OSIS GRID
    ========================================== */
.grid-container-guru, .grid-container-osis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.card-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.card-item img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 10px; object-fit: cover; }
.card-item h3 { font-size: 0.9rem; color: #2c3e50; }
.card-item p { font-size: 0.75rem; color: #7f8c8d; }

/* ==========================================
    ANIMATION & OTHERS
    ========================================== */
.post-animate { animation: slideIn 0.4s ease-out; }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.delete-btn { background: none; color: #ccc; font-size: 1.5rem; line-height: 1; }
.delete-btn:hover { color: #e74c3c; }

/* PINNED PPDB IN FEED */
.pinned-ppdb { border: 2px solid #27ae60; overflow: hidden; padding: 0; }
.badge-new {
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 4px 10px;
    position: absolute;
    top: 10px;
    left: 10px;
    border-radius: 50px;
    font-weight: bold;
    z-index: 10;
}

.btn-daftar-link {
    display: block;
    background: #27ae60;
    color: white;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: bold;
}

/* NOTIFICATION TOAST */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-left: 5px solid #27ae60;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9999;
    min-width: 280px;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.hidden {
    top: -100px; /* Sembunyi ke atas */
    opacity: 0;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

#toast-icon { color: #27ae60; font-size: 30px; }

.toast-msg b { display: block; font-size: 0.9rem; color: #333; }
.toast-msg p { font-size: 0.8rem; color: #666; margin: 0; }

/* STYLE ANGKA MERAH (BADGE) */
.badge {
    position: absolute;
    top: 2px;          /* Jarak dari atas icon */
    right: 2px;        /* Jarak dari kanan icon */
    background-color: #ff3b30; /* Merah cerah */
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;    /* Biar tetep bulat meski angkanya cuma 1 */
    height: 18px;
    padding: 0 2px;
    border-radius: 10px; /* Bikin lonjong kalo angkanya banyak */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff; /* Garis putih biar kontras sama icon */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    pointer-events: none; /* Biar kalau diklik, tetep tembus ke tombol menunya */
}

/* ANIMASI */
.badge:not(.hidden) {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* SEMBUNYIIN KALO 0 */
.hidden {
    display: none !important;
}

.bio-preview {
    display: block;
    font-size: 10px;
    color: #888;
    max-width: 65px;      /* Batasin lebar teks sesuai foto profil */
    white-space: nowrap;  /* Paksa teks jadi 1 baris aja */
    overflow: hidden;     /* Sembunyiin teks yang luber */
    text-overflow: ellipsis; /* Kasih titik-titik (...) kalau kepanjangan */
    cursor: pointer;
    margin: 2px auto 0;
}

.bio-preview:hover {
    color: #2ecc71; /* Berubah hijau pas diarahkan kursor */
}