/* Override browser default */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styles */
body.dark-mode {
    background: #1a1a1a;
    color: #fff;
}

/* Navbar styling */
.navbar {
    position: fixed; /* Change to fixed instead of sticky */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #212529;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin: 0; /* Tambahkan ini */
    padding-top: 0.5rem; /* Sesuaikan padding */
    padding-bottom: 0.5rem;
}

.navbar.scrolled {
    background-color: #212529;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15); /* Enhanced shadow when scrolled */
}

.navbar-nav .nav-item {
    margin-right: 0.1rem;
    display: flex;
    align-items: center;
}

.navbar-nav .nav-item .dropdown-toggle {
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    height: 100%;
}

.navbar-nav .nav-item img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

.navbar-nav .nav-link i {
    font-size: 0.8rem;
    margin-right: 0.2rem;
}

.navbar .dropdown-menu {
    font-size: 0.8rem;
}

.community-hero {
    background: linear-gradient(90deg, #0d6efd 0%, #6ea8fe 100%);
    color: #fff;
    padding-top: 80px; /* Reduced from 140px */
    padding-bottom: 2rem; /* Reduced from 4rem */
    margin-top: 0;
    min-height: 300px; /* Reduced from 400px */
    display: flex;
    align-items: center;
}

.community-hero h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

.community-hero .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

.community-search {
    max-width: 500px; /* Increased width */
    margin: 0 auto;
}

.community-search .form-control {
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    border-radius: 30px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: #fff;
    color: #212529;
    transition: all 0.3s ease;
}

.dark-mode .community-search .form-control {
    background: #2d2d2d;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.dark-mode .community-search .form-control::placeholder {
    color: #888;
}

.community-list-section {
    min-height: 60vh;
}

.community-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    margin-bottom: 30px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

/* Dark mode untuk community card */
.dark-mode .community-card {
    background: #2d2d2d;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
}

.community-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.13);
    transform: translateY(-4px);
}

.dark-mode .community-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

.community-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e9ecef;
}

.dark-mode .community-card-img {
    background: #404040;
}

.community-card-body {
    padding: 1.2rem 1rem 1rem 1rem;
}

.community-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.dark-mode .community-card-title {
    color: #fff;
}

.community-card-desc {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.7rem;
}

.dark-mode .community-card-desc {
    color: #a7a7a7;
}

.community-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    color: #666;
}

.dark-mode .community-card-meta {
    color: #888;
}

.community-card-meta i {
    color: #0d6efd;
}

.dark-mode .community-card-meta i {
    color: #6ea8fe;
}

.community-card-join {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1.1rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.dark-mode .community-card-join {
    background: #0d6efd;
    color: #fff;
}

.community-card-join.joined {
    background: #198754;
}

.dark-mode .community-card-join.joined {
    background: #198754;
}

.community-filter-tabs .btn {
    transition: all 0.3s ease;
}

.dark-mode .community-filter-tabs .btn-outline-light {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.dark-mode .community-filter-tabs .btn-outline-light:hover,
.dark-mode .community-filter-tabs .btn-outline-light.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}
