/* ===================================================================
   STYLESHEET TERPADU
   -------------------------------------------------------------------
   File ini menggabungkan gaya dari tiga halaman menjadi satu
   stylesheet yang konsisten dan mudah dikelola.
   Struktur:
   1. Base & Layout
   2. Sidebar
   3. Logo
   4. Menu & Navigation
   5. Notification Indicators
   6. Buttons
   7. Sticky Profile (Bottom Sidebar)
   8. Mobile Header
   9. Forms & Inputs
   10. Cards (User, Post, Material)
   11. Page-Specific Sections
   12. Popup / Modal
   13. Utility & Helpers
   14. Responsive Design
   ================================================================= */

:root {
    --primary-blue: #007bff; /* Main blue for buttons, active links */
    --hover-blue: #0056b3; /* Darker blue on hover */
    --verified-blue: #1da1f2; /* Blue for verification icons */
    --light-gray-bg: #f8f8f8; /* Light background for sections/tabs */
    --medium-gray-bg: #e9ecef; /* Medium background for hover states */
	--medium-gray: #aaa;
    --dark-text: #333; /* Dark text color */
    --light-text: #666; /* Lighter text color */
    --border-color: #ddd; /* General border color */
    --soft-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); /* Subtle box shadow */
    --red-alert: #dc3545; /* Red for alerts/delete actions */
    --red-alert-hover: #a71d2a; /* Darker red on hover */
    --success-green: #28a745; /* Green for success messages/buttons */
    --success-green-hover: #218838; /* Darker green on hover */
}

/* --- 1. BASE & LAYOUT --- */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f3f4f6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.layout {
    display: flex;
    flex-grow: 1;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    background-color: #fff;
    overflow-y: auto;
}



/* --- 2. SIDEBAR --- */
.sidebar-left {
    width: 300px;
    min-width: 300px;
    background-color: #ffffff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease, min-width 0.3s ease;
    z-index: 50;
}

.sidebar-left.collapsed {
    width: 80px;
    min-width: 80px;
    overflow: hidden;
}

.sidebar-left.collapsed .menu-text-full,
.sidebar-left.collapsed .profil-info,
.sidebar-left.collapsed .btn-postnew .menu-text-full {
    display: none;
}

.sidebar-left.collapsed .menu-icon-only {
    display: inline-block;
}

.sidebar-left.collapsed .menu-side li a,
.sidebar-left.collapsed .unread-indicator {
    justify-content: center;
}

.sidebar-left.collapsed .sticky-profil {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar-left.collapsed .profile-picture-sticky {
    margin-right: 0;
    margin-bottom: 5px;
}

.sidebar-left.collapsed .btn-popup {
    display: none;
}

.sidebar-left.collapsed .menu-pop-dot {
    display: none !important;
}

.sidebar-toggle-btn {
    background-color: white;
    color: var(--light-text);
    border: 1px solid var(--light-text);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: var(--soft-shadow);
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 1001;
    margin: 10px auto 20px auto; /* Di bawah logo, di tengah horizontal, jarak dari bawah */
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background-color: var(--light-text);
    color: white;
    transform: scale(1.1);
}


/* --- 3. LOGO --- */
.logo-text {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: #1f2937;
    transition: color 0.2s ease-in-out;
    margin-bottom: 20px;
    padding: 10px 0;
    text-decoration: none;
}

.logo-text:hover {
    color: #2563eb;
    background-color: transparent;
}

.logo-text.selected-menu-item,
.logo-text.selected-menu-item:hover {
    background-color: transparent;
    color: #1d4ed8;
}

.logo-text .menu-text-full {
    display: inline-block;
}

.logo-text .menu-icon-only {
    display: none;
}

.sidebar-left.collapsed .logo-text .menu-text-full {
    display: none;
}

.sidebar-left.collapsed .logo-text .menu-icon-only {
    display: inline-block;
}

/* CSS tambahan untuk menustyle2 saat sidebar collapsed */
.sidebar-left.collapsed .menustyle2 {
    justify-content: center; /* Memusatkan ikon di tengah */
}

/* Aturan di bawah ini secara teknis sudah dicakup oleh `.sidebar-left.collapsed .menu-text-full` 
  yang ada, namun menambahkannya secara eksplisit untuk `.menustyle2` akan memastikan 
  perilaku yang diinginkan jika ada override style lain.
*/
.sidebar-left.collapsed .menustyle2 .menu-text-full {
    display: none; /* Sembunyikan teks menu */
}


/* --- 4. MENU & NAVIGATION --- */
.menu-side ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-side li a,
.unread-indicator {
    position: relative; /* KUNCI: Menjadi acuan untuk child yang di-position:absolute */
    display: flex;
    align-items: center;
    padding: 5px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    gap: 12px;
}

.menu-side li a:hover,
.unread-indicator:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.selected-menu-item {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

.menu-side li a i,
.unread-indicator i {
    flex-shrink: 0;
    width: 24px;
    font-size: 1.1rem;
    text-align: center;
}

.menu-side li a .menu-text-full {
	font-weight: 100;
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- 5. NOTIFICATION INDICATORS --- */
.hamburger-menu-btn .notification-dot {
    position: absolute;
    top: 0px;
    right: -10px;
    width: 10px;
    height: 10px;
    background-color: #dc2626;
    border-radius: 50%;
    pointer-events: none;
}

.unread-indicator .unread-count {
    position: absolute;
    top: 50%;
    right: 15px; /* Sesuai dengan padding kanan parent */
    transform: translateY(-50%); /* Untuk sentralisasi vertikal */
    background-color: #dc2626;
    color: white;
    border-radius: 12px; /* Bentuk pil */
    padding: 3px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.sidebar-left.collapsed .unread-indicator {
    padding: 10px;
    gap: 0;
}

.sidebar-left.collapsed .unread-indicator .menu-text-full {
    display: none;
}

.sidebar-left.collapsed .unread-count {
    top: 4px;
    right: 4px;
    transform: none; /* Hapus transform dari state normal */
    padding: 0;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    line-height: 18px; /* Untuk sentralisasi angka */
    text-align: center;
}


/* --- 6. BUTTONS --- */
.btn-postnew {
    background-color: #10b981;
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    margin-bottom: 20px;
    transition: background-color 0.2s ease;
    text-decoration: none;
}
.btn-postnew:hover {
    background-color: #059669;
}
.btn-postnew i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.search-button {
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.search-button:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.load-more-btn {
    background-color: transparent;
    border: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.load-more-btn:hover {
    background-color: #eef2ff;
}

/* --- 7. STICKY PROFILE (BOTTOM SIDEBAR) --- */
.sticky-profil {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sticky-profil .profil-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
    flex-grow: 1;
    overflow: hidden;
}
.sticky-profil .profile-picture-sticky {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid #3b82f6;
    flex-shrink: 0;
}
.sticky-profil .profil-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sticky-profil .profil-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sticky-profil .profil-username {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sticky-profil .btn-popup {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #6b7280;
    margin-left: auto;
    flex-shrink: 0;
}
.sticky-profil .menu-pop-dot {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 10px 0;
    z-index: 100;
    min-width: 150px;
}
.sticky-profil .menu-pop-dot ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sticky-profil .menu-pop-dot ul li a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    text-decoration: none;
    color: #4b5563;
    font-size: 0.9rem;
}
.sticky-profil .menu-pop-dot ul li a:hover {
    background-color: #f3f4f6;
}
.sticky-profil .menu-pop-dot ul li a i {
    margin-right: 8px;
}
.sticky-profil .btn-login {
    background-color: #3b82f6;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}
.sticky-profil .btn-login:hover {
    background-color: #2563eb;
}
.sticky-profil .btn-login i {
    margin-right: 8px;
}

/* --- 8. MOBILE HEADER --- */
.mobile-header {
    display: none;
    background-color: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.mobile-logo-text {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 24px; /* Ukuran logo mobile */
    font-weight: 700;
    text-decoration: none;
    color: var(--dark-text);
    white-space: nowrap;
}


.hamburger-menu-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1f2937;
}

/* --- 9. FORMS & INPUTS --- */
.search-form-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.search-input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 15px;
    width: 100%;
    font-size: 1rem;
    color: #374151;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.search-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}
.search-checkbox-item {
    display: flex;
    align-items: center;
}
.search-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}
.search-checkbox-item label {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 500;
}

/* --- 10. CARDS (User, Post, Material) --- */
.user-card {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.user-card-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid #3b82f6;
}
.user-card-info {
    flex-grow: 1;
}
.user-card-username {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1f2937;
}
.user-card-fullname {
    font-size: 0.9rem;
    color: #6b7280;
}

.tag-link {
  display: inline-block;
  background-color: #e2e8f0; /* bg-gray-200 */
  color: #4a5568; /* text-gray-700 */
  border-radius: 9999px; /* rounded-full */
  padding: 4px 12px;
  font-size: 0.75rem; /* text-xs */
  font-weight: 600; /* font-semibold */
  margin-right: 0px;
  margin-bottom: 0px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.tag-link:hover {
  background-color: #cbd5e0; /* bg-gray-300 */
}


.post-card, .material-card-search, .material-card {
	padding: 15px 25px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.post-card:hover, .material-card-search:hover, .material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.post-card-content-wrapper, .material-card-content-wrapper {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.post-card-title, .material-card-search-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.post-card-meta, .material-card-search-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 10px;
}
.post-card-content, .material-card-search-abstract {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}
.post-card-stats, .material-card-search-stats, .material-card-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.875rem;
    color: #4b5563;
    padding: 10px 16px 16px;
    margin-top: auto;
}
.post-card-stats i, .material-card-search-stats i {
    margin-right: 5px;
}
.material-card-footer {
    justify-content: flex-end;
    gap: 8px;
    border-top: none;
    padding: 0 16px 16px;
}

/* --- 11. PAGE-SPECIFIC SECTIONS --- */
/* Search Results Header */
.result-section-header {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 30px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

/* Notifications Section */
.notification-section {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    padding: 20px;
}
.notification-section-header {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.notification-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.3s ease;
    border-radius: 8px;
    margin-bottom: 2px;
}
.notification-item.unread {
    background-color: #eef2ff; /* Light blue background for unread items */
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item-icon {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-right: 15px;
    flex-shrink: 0;
}
.notification-item-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}
.notification-content {
    flex-grow: 1;
}
.notification-text {
    font-size: 1rem;
    color: #374151;
    line-height: 1.4;
}
.notification-text .username {
    font-weight: 600;
    color: #1f2937;
}
.notification-text .post-title,
.notification-text .material-name {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}
.notification-text .post-title:hover,
.notification-text .material-name:hover {
    text-decoration: underline;
}
.notification-time {
    font-size: 0.85rem;
    color: #6b7280;
    text-align: left;
    flex-shrink: 0;
}
.notification-extra-hidden {
    display: none;
}
.load-more-container {
    padding-top: 15px;
    margin-top: 10px;
    text-align: center;
    border-top: 1px solid #f3f4f6;
}

/* Material Grid */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.material-action-btn {
    background-color: #e2e8f0;
    color: #4a5568;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.material-action-btn:hover {
    background-color: #cbd5e0;
    color: #2d3748;
}
.material-action-btn.delete {
    background-color: #fee2e2;
    color: #dc2626;
}
.material-action-btn.delete:hover {
    background-color: #fecaca;
    color: #b91c1c;
}
.material-action-btn.edit {
    background-color: #dbeafe;
    color: #2563eb;
}
.material-action-btn.edit:hover {
    background-color: #bfdbfe;
    color: #1e40af;
}

/* --- 12. POPUP / MODAL --- */
.popup, .modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
.popup-content, .modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: fadeInScale 0.3s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
}
.popup-content .close, .modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}
.popup-content .close:hover, .popup-content .close:focus,
.modal-close:hover, .modal-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}
.popup-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}
.popup-content label {
    display: block;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.popup-content input[type="text"],
.popup-content input[type="password"],
.popup-content input[type="url"],
.popup-content select,
.popup-content textarea {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    appearance: none;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    color: #374151;
    line-height: 1.25;
    outline: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.popup-content input:focus,
.popup-content select:focus,
.popup-content textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}
.popup-content .btn-submit {
    background-color: #3b82f6;
    color: white;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    outline: none;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    width: 100%;
    margin-top: 1rem;
    border: none;
    cursor: pointer;
}
.popup-content .btn-submit:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.popup-content .register-link,
.popup-content .download-template {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}
.popup-content .register-link a,
.popup-content .download-template a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}
.popup-content .register-link a:hover,
.popup-content .download-template a:hover {
    text-decoration: underline;
}


/* ===================================================================
   15. LEADERBOARD / RANKING PAGE STYLES
   -------------------------------------------------------------------
   Gaya khusus untuk halaman papan peringkat kontributor.
   ================================================================= */

/* Container untuk tab filter peringkat */
.ranking-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Agar tab bisa turun baris di layar kecil */
    gap: 10px;
    margin-bottom: 30px;
    padding: 8px;
    background-color: var(--light-gray-bg);
    border-radius: 12px;
}

/* Setiap item tab */
.tab-item {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--light-text);
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Efek hover pada tab */
.tab-item:hover {
    background-color: var(--medium-gray-bg);
    color: var(--dark-text);
}

/* Gaya untuk tab yang sedang aktif */
.tab-item.active {
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}

/* Container utama untuk daftar peringkat */
.ranking-list-container {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: var(--soft-shadow);
    overflow: hidden; /* Untuk memastikan border-radius diterapkan dengan benar */
}

/* Daftar peringkat (ordered list) */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Setiap baris item dalam peringkat */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f3f4f6; /* Garis pemisah antar item */
    transition: background-color 0.2s ease;
}

.ranking-item:last-child {
    border-bottom: none; /* Hapus border untuk item terakhir */
}

.ranking-item:hover {
    background-color: #f9fafb; /* Sedikit highlight saat di-hover */
}

/* Nomor peringkat (#1, #2, dst.) */
.rank-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--medium-gray);
    width: 50px; /* Lebar tetap agar rapi */
    flex-shrink: 0;
    text-align: center;
}

/* Info pengguna (foto, nama, username) */
.rank-user-info {
    flex-grow: 1; /* Mengisi ruang yang tersedia */
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 10px;
}

.rank-user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.rank-user-name {
    font-weight: 600;
    color: var(--dark-text);
    text-decoration: none;
}
.rank-user-name:hover {
    text-decoration: underline;
    color: var(--primary-blue);
}

.rank-user-username {
    font-size: 0.9rem;
    color: var(--light-text);
}

/* Kontainer untuk statistik di sisi kanan */
.rank-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Rata kanan */
    gap: 15px;
    flex-wrap: wrap; /* Agar bisa turun baris jika tidak cukup ruang */
}

/* Setiap item statistik */
.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background-color: #f3f4f6;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.stat-item i {
    color: #9ca3af;
}

/* Item statistik yang aktif (sesuai filter) */
.stat-item.active {
    background-color: #eef2ff; /* Warna biru muda */
    color: #4338ca; /* Warna biru tua */
    font-weight: 600;
}

.stat-item.active i {
    color: #4f46e5;
}

/* Pesan saat tidak ada data kontributor */
.ranking-item-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--light-text);
    font-style: italic;
}

/* ===================================================================
   16. GAYA TAMBAHAN UNTUK SOROTAN PENGGUNA
   ------------------------------------------------------------------- */

/* Gaya untuk menyorot baris pengguna yang sedang login di papan peringkat */
.ranking-item.current-user {
    background-color: #ecebff;
    border-color: #4f46e5;
    border-left-width: 4px; /* Samakan tebal border dengan peraih medali */
}

/* Membuat nama pengguna yang disorot sedikit lebih menonjol */
.ranking-item.current-user .rank-user-name {
    font-weight: 700; /* Sedikit lebih tebal */
    color: var(--active-blue-text); 
}


/* --- RESPONSIVE UNTUK LEADERBOARD --- */
@media (max-width: 992px) {
    .rank-stats {
        gap: 10px;
    }
    .stat-item {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}


@media (max-width: 768px) {
    .ranking-item {
        flex-direction: column; /* Ubah jadi tumpukan vertikal */
        align-items: flex-start; /* Rata kiri */
        gap: 15px;
    }

    .rank-number {
        position: absolute; /* Posisikan di kanan atas */
        top: 15px;
        right: 20px;
        font-size: 1rem;
        color: #d1d5db;
    }

    .rank-stats {
        width: 100%;
        justify-content: flex-start; /* Rata kiri di mobile */
        gap: 8px;
        padding-top: 10px;
        border-top: 1px solid #f3f4f6;
    }
}



@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- 13. UTILITY & HELPERS --- */
.verified-icon {
    color: #3b82f6;
    font-size: 0.8em;
}

.icon-type {
    font-size: 24px;
    margin-right: 8px;
    color: #4f46e5;
}
.icon-pdf { color: #dc2626; }
.icon-excel { color: #10b981; }
.icon-word { color: #2563eb; }
.icon-youtube { color: #ef4444; }
.icon-ppt { color: #f59e0b; }

.truncate-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.4;
    min-height: 37px;
}

.close-sidebar-btn {
  display: none; /* disembunyikan secara default */
}

@media (max-width: 768px) {
  .close-sidebar-btn {
    display: block; /* hanya tampil di layar mobile */
  }
}



/* --- 14. RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .sidebar-left {
        position: fixed;
        left: -300px; /* Sembunyikan di luar layar */
        top: 0;
        height: 100vh;
        width: 280px; /* Sedikit lebih lebar untuk mobile */
        z-index: 1002;
        transition: left 0.3s ease-in-out;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar-left.active {
        left: 0;
    }
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
    }
    .layout {
        flex-direction: column;
    }
    .main-content {
        padding-top: 70px; /* Sesuaikan dengan tinggi header mobile Anda */
    }
    .page-with-extra-mobile-padding {
        padding-top: 0;
    }
    /* Reset collapsed state on mobile, as it's controlled by 'active' class */
    .sidebar-left.collapsed {
        width: 80px;
        min-width: 80px;
    }
    .sidebar-left.collapsed .menu-text-full,
    .sidebar-left.collapsed .profil-info,
    .sidebar-left.collapsed .btn-postnew .menu-text-full {
        display: flex; /* atau block, sesuai defaultnya */
    }
    .sidebar-left.collapsed .menu-icon-only {
        display: none;
    }
    .sidebar-left.collapsed .menu-side li a,
    .sidebar-left.collapsed .unread-indicator {
        justify-content: flex-start;
    }
    .sidebar-left.collapsed .sticky-profil {
        flex-direction: row;
        align-items: center;
    }
	
	/* CSS untuk STICKY PROFILE saat sidebar collapsed */

	/* 1. Kondisi LOGGED IN: Sembunyikan info & tombol, sisakan foto profil */
	.sidebar-left.collapsed .profil-info,
	.sidebar-left.collapsed .btn-popup {
		display: none;
	}

	.sidebar-left.collapsed .profil-link {
		/* Pastikan link tidak memakan ruang ekstra */
		padding: 0;
		margin: 0;
	}

	.sidebar-left.collapsed .profile-picture-sticky {
		margin-right: 0; /* Hapus margin agar gambar pas di tengah */
		margin-bottom: 0;
	}

	/* 2. Kondisi LOGGED OUT: Ubah tombol login menjadi ikon saja */
	.sidebar-left.collapsed .btn-login {
		width: 48px;  /* Lebar tombol dibuat pas untuk ikon */
		height: 48px; /* Tinggi tombol dibuat sama dengan lebarnya */
		padding: 0;   /* Hapus padding internal */
		font-size: 0; /* Trik untuk menyembunyikan teks "Login" */
		border-radius: 50%; /* Membuat tombol menjadi bulat */
	}

	.sidebar-left.collapsed .btn-login i {
		margin-right: 0;   /* Hapus margin dari ikon */
		font-size: 1.1rem; /* Tetapkan ukuran font spesifik untuk ikon */
	}
	
	.sidebar-left.collapsed .btn-postnew {
        width: 48px;         /* Ubah lebar menjadi ukuran ikon */
        height: 48px;        /* Samakan tinggi dengan lebar */
        padding: 0;          /* Hapus padding agar ikon pas di tengah */
        border-radius: 50%;  /* Opsional: Jadikan tombolnya bulat agar seragam */
    }

    .sidebar-left.collapsed .btn-postnew .menu-text-full {
        display: none;       /* Sembunyikan teks "Unggah Materi" */
    }

    .sidebar-left.collapsed .btn-postnew i {
        margin: 0;           /* Hapus margin dari ikon agar benar-benar di tengah */
    }

	
	
}
