/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f97316;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --gray-lighter: #f9fafb;
    --white: #ffffff;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-lighter);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* ===== BUTTONS ===== */
button, .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== FORMS ===== */
input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--white);
}

input:disabled, textarea:disabled, select:disabled {
    background-color: var(--gray-light);
    cursor: not-allowed;
    opacity: 0.6;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input[type="checkbox"], input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: var(--white);
    padding: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    min-width: 250px;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.navbar-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 100%;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    height: 100%;
    align-items: center;
}

.navbar-menu-item {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    margin: 0;
}

.navbar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    height: 100%;
}

.navbar-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.navbar-menu-link.active {
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    color: var(--white);
    border-bottom: 3px solid var(--primary-color);
}

.navbar-menu-link i {
    font-size: 1.1rem;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.navbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.navbar-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 1rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    z-index: 1001;
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-dropdown-item {
    padding: 0.75rem 1.25rem;
    color: var(--dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--gray-light);
    color: var(--primary-color);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--gray-light);
    margin: 0.5rem 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 250px;
    height: calc(100vh - 70px);
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: var(--white);
    padding: 1.5rem 0;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu-item {
    margin: 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-menu-link.active {
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    color: var(--white);
    border-right: 3px solid var(--primary-color);
}

.sidebar-menu-link i {
    font-size: 1.25rem;
    width: 24px;
}

.sidebar-section {
    margin: 1.5rem 0;
}

.sidebar-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
}

/* ===== SCROLLBAR SIDEBAR ===== */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== MAIN CONTAINER ===== */
.main-container {
    margin-left: 250px;
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    background-color: var(--gray-lighter);
}

/* ===== HERO BANNER ===== */
.hero-banner {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 3rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.87,168.19-17.28,250.61-.39C823.75,31,906.4,72,985.03,92.83c70.36,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    padding: 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* ===== ANNOUNCEMENT ===== */
.announcement-section {
    margin-bottom: 3rem;
}

.announcement-card {
    background: var(--white);
    border-left: 4px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.announcement-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.announcement-icon {
    font-size: 2rem;
    color: var(--secondary-color);
    min-width: 50px;
}

.announcement-content h3 {
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.announcement-content p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ===== SECTION HEADER ===== */
.section-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.section-title i {
    color: var(--primary-color);
}

.section-divider {
    flex-grow: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
}

/* ===== POSTS SECTION ===== */
.posts-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
}

.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ===== POST CARD ===== */
.post-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--gray-light);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.post-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--gray-light);
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: var(--transition);
}

.post-card:hover .post-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.post-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--gray-light) 0%, var(--gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

.post-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-title {
    margin-bottom: 1rem;
}

.post-title a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--gray-light);
    padding-top: 1rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--gray);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.read-more-btn:hover {
    background: var(--gray-light);
    color: var(--primary-dark);
    transform: translateX(4px);
}

.read-more-btn i {
    transition: var(--transition);
}

.read-more-btn:hover i {
    transform: translateX(2px);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* ===== PAGINATION ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination li {
    list-style: none;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    color: var(--dark);
    font-weight: 600;
    transition: var(--transition);
    background: var(--white);
    cursor: pointer;
    text-decoration: none;
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--gray-lighter);
}

.page-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-info {
    color: var(--gray);
    font-size: 0.95rem;
    font-weight: 500;
}

.page-info strong {
    color: var(--dark);
    font-weight: 700;
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: linear-gradient(135deg, var(--gray-lighter) 0%, var(--white) 100%);
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: 180px;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--dark);
}

.category-card:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.category-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.category-icon {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--gray);
    transition: var(--transition);
}

.category-card:hover .category-icon {
    background: rgba(255, 255, 255, 0.3);
    color: var(--white);
}

.category-name {
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
    transition: var(--transition);
    max-height: 3em;
    overflow: hidden;
    line-height: 1.3;
}

/* ===== CARDS & BOXES ===== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== GRID LAYOUT ===== */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid;
}

.alert-info {
    background: #dbeafe;
    color: #0c4a6e;
    border-color: var(--primary-color);
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: var(--success-color);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: var(--secondary-color);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    margin-left: auto;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--white);
}

.badge-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.badge-success {
    background: var(--success-color);
    color: var(--white);
}

.badge-danger {
    background: var(--danger-color);
    color: var(--white);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.post-card, .category-card {
    animation: fadeIn 0.5s ease-out;
}

.post-card:nth-child(2) {
    animation-delay: 0.1s;
}

.post-card:nth-child(3) {
    animation-delay: 0.2s;
}

.post-card:nth-child(4) {
    animation-delay: 0.3s;
}

.post-card:nth-child(5) {
    animation-delay: 0.4s;
}

.post-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th {
    background: var(--gray-light);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--dark);
    border-bottom: 2px solid var(--gray);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-light);
}

tr:hover {
    background: var(--gray-lighter);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-light);
}

/* ===== UTILITIES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: var(--gray);
}

.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--secondary-color);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.m-0 { margin: 0; }
.p-0 { padding: 0; }

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .main-container {
        margin-left: 250px;
        padding: 1.5rem;
    }

    .posts-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .categories-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .navbar-menu {
        display: none;
    }

    .navbar-toggle {
        display: flex;
    }

    .sidebar {
        left: -250px;
        transition: var(--transition);
    }

    .sidebar.active {
        left: 0;
    }

    .main-container {
        margin-left: 0;
        padding: 1.5rem;
    }

    .navbar-content {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-divider {
        width: 100%;
        height: 1px;
    }

    .posts-section {
        padding: 1.5rem;
    }

    .posts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .categories-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }

    .announcement-card {
        flex-direction: column;
        text-align: center;
    }

    .pagination-container {
        gap: 1rem;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .navbar-brand {
        min-width: auto;
    }

    .navbar-title {
        display: none;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 1rem;
        margin-top: 70px;
    }

    .navbar {
        height: 60px;
    }

    .sidebar {
        top: 60px;
        height: calc(100vh - 60px);
        width: 100%;
    }

    .posts-section {
        padding: 1rem;
    }

    .post-body {
        padding: 1rem;
    }

    .categories-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .card {
        padding: 1.5rem;
    }

    button, .btn {
        width: 100%;
    }

    input, textarea, select {
        font-size: 16px;
    }

    .alert {
        flex-direction: column;
        align-items: flex-start;
    }

    .alert-close {
        margin-left: 0;
        align-self: flex-end;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .navbar-brand {
        padding: 0 1rem;
    }

    .navbar-logo {
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    .navbar-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar, .sidebar, .pagination-container {
        display: none;
    }

    .main-container {
        margin-left: 0;
        margin-top: 0;
        padding: 0;
    }

    body {
        background: white;
    }

    .post-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===== DARK MODE (Optional) ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f9fafb;
        --dark-light: #e5e7eb;
        --gray: #9ca3af;
        --white: #111827;
        --gray-light: #374151;
        --gray-lighter: #1f2937;
    }

    body {
        background-color: var(--gray-lighter);
        color: var(--dark);
    }

    .post-card, .card, .announcement-card {
        background: #1f2937;
        border-color: #374151;
    }

    input, textarea, select {
        background: #374151;
        color: var(--dark);
        border-color: #4b5563;
    }

    input:focus, textarea:focus, select:focus {
        background: #1f2937;
    }
}


/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 250px;
    height: calc(100vh - 70px);
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    color: var(--white);
    padding: 0;
    overflow: hidden;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-wrapper {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0 1rem 0;
    list-style: none;
    margin: 0;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    margin-top: auto;
}

.sidebar-menu-item {
    list-style: none;
    margin: 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-menu-link.active {
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    color: var(--white);
    border-right: 3px solid var(--primary-color);
}

.sidebar-menu-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu-link span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-section {
    margin: 1.5rem 0;
}

.sidebar-section:first-child {
    margin-top: 0;
}

.sidebar-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

/* ===== SIDEBAR DIVIDER ===== */
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

/* ===== SIDEBAR AUTH SECTION ===== */
.sidebar-auth-info {
    padding: 1.25rem 1rem;
    margin: 0 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.sidebar-auth-info h4 {
    color: var(--white);
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.sidebar-auth-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.auth-benefits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    text-align: center;
    transition: var(--transition);
}

.benefit-item:hover {
    background: rgba(37, 99, 235, 0.2);
    color: var(--white);
}

.benefit-item i {
    font-size: 1.1rem;
    color: var(--primary-light);
}

.sidebar-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.9rem;
}

.sidebar-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sidebar-auth-hint {
    margin: 0.75rem 0 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-auth-hint a {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.sidebar-auth-hint a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* ===== LOGIN & REGISTER LINKS ===== */
.sidebar-menu-link.login-link {
    color: rgba(255, 255, 255, 0.8);
    border-left: 2px solid transparent;
}

.sidebar-menu-link.login-link:hover {
    border-left-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    color: var(--white);
}

.sidebar-menu-link.register-link {
    color: rgba(255, 255, 255, 0.8);
    border-left: 2px solid transparent;
}

.sidebar-menu-link.register-link:hover {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
    color: var(--white);
}

/* ===== USER PROFILE ===== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--transition);
    min-width: 0;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--white);
    font-size: 0.9rem;
    min-width: 36px;
    flex-shrink: 0;
}

.user-info-small {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-info-small h6 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--white);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info-small p {
    margin: 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== ADMIN LINK STYLES ===== */
.sidebar-menu-link.admin-link {
    color: rgba(255, 255, 255, 0.9);
    border-left: 2px solid transparent;
}

.sidebar-menu-link.admin-link:hover {
    border-left-color: var(--secondary-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.sidebar-menu-link.admin-link.active {
    border-left-color: var(--secondary-color);
    background: linear-gradient(90deg, var(--secondary-color) 0%, transparent 100%);
}

/* ===== SCROLLBAR SIDEBAR ===== */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE SIDEBAR ===== */
@media (max-width: 992px) {
    .sidebar {
        left: -250px;
        width: 250px;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-menu-link {
        padding: 0.875rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-menu-link {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .sidebar-section-title {
        padding: 0 1rem;
    }

    .sidebar-footer {
        padding: 1rem;
    }

    .sidebar-auth-info {
        padding: 1rem;
        margin: 0 0.5rem 1rem;
    }

    .auth-benefits {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .benefit-item {
        padding: 0.5rem;
        font-size: 0.65rem;
    }

    .sidebar-auth-btn {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .user-avatar-small {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.8rem;
    }

    .user-info-small h6 {
        font-size: 0.8rem;
    }

    .user-info-small p {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .sidebar-menu {
        padding: 1rem 0 0.75rem 0;
    }

    .sidebar-section {
        margin: 1rem 0;
    }

    .sidebar-section-title {
        padding: 0 1rem;
        font-size: 0.65rem;
    }

    .sidebar-menu-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar-footer {
        padding: 0.875rem;
    }

    .sidebar-auth-info {
        padding: 0.875rem 0.75rem;
        margin: 0 0.25rem 0.875rem;
    }

    .sidebar-auth-info h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .sidebar-auth-info p {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .auth-benefits {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        margin-bottom: 0.75rem;
    }

    .benefit-item {
        padding: 0.4rem;
        font-size: 0.6rem;
    }

    .sidebar-auth-btn {
        padding: 0.65rem;
        font-size: 0.8rem;
    }

    .sidebar-auth-hint {
        margin-top: 0.5rem;
        font-size: 0.7rem;
    }

    .user-profile {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .user-avatar-small {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.75rem;
    }

    .user-info-small h6 {
        font-size: 0.75rem;
    }

    .user-info-small p {
        font-size: 0.6rem;
    }
}