/* --- RESET & BASIC STYLING --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
}

/* --- AUTHENTICATION PAGES (LOGIN & REGISTER) --- */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0284c7 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.auth-card h2 {
    color: #0284c7;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.auth-card p.subtitle {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 25px;
}

.auth-card .form-group {
    text-align: left;
    margin-bottom: 18px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.auth-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.auth-card input:focus {
    outline: none;
    border-color: #0284c7;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.auth-link {
    margin-top: 22px;
    font-size: 14px;
    color: #64748b;
}

.auth-link a {
    color: #0284c7;
    font-weight: 600;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* --- ALERT MESSAGES --- */
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: left;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* --- LAYOUT UTILITIES --- */
.text-center { text-align: center; }

/* Dashboard Layout & Admin Panel */
.dashboard-body { margin: 0; background-color: #f1f5f9; font-family: system-ui, -apple-system, sans-serif; }
.topbar { height: 60px; background-color: #0f172a; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.btn-toggle { background: none; border: none; color: white; font-size: 20px; cursor: pointer; }
.brand-title { font-weight: bold; font-size: 18px; }
.btn-logout { color: #ef4444; text-decoration: none; font-weight: 500; margin-left: 15px; }

.dashboard-container { display: flex; margin-top: 60px; min-height: calc(100vh - 60px); }
.sidebar { width: 240px; background-color: #1e293b; color: #fff; transition: all 0.3s ease; }
.sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar-menu { list-style: none; padding: 15px 0; margin: 0; }
.sidebar-menu .menu-title { font-size: 11px; text-transform: uppercase; color: #64748b; padding: 10px 20px 5px; font-weight: bold; }
.sidebar-menu li a { display: block; padding: 10px 20px; color: #cbd5e1; text-decoration: none; font-transition: 0.2s; }
.sidebar-menu li.active a, .sidebar-menu li a:hover { background-color: #334155; color: #fff; }

.main-content { flex: 1; padding: 25px; overflow-y: auto; }
.card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.margin-top { margin-top: 20px; }

/* Grid Form */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.full-width { grid-column: span 2; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; }
.form-group input { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; }

/* Table Style */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.data-table th { background-color: #f8fafc; font-weight: 600; }

/* Badges & Buttons */
.badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.btn-action { padding: 4px 10px; border-radius: 4px; text-decoration: none; font-size: 12px; font-weight: 500; }
.btn-danger { background-color: #ef4444; color: white; }
.btn-success { background-color: #22c55e; color: white; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100%; z-index: 99; left: -240px; }
    .sidebar.active { left: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .dashboard-sections { flex-direction: column; }
}

/* Stats Grid & Quick Actions */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; }
.stat-card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-left: 4px solid #cbd5e1; }
.stat-card h3 { margin: 0; font-size: 28px; color: #0f172a; }
.stat-card p { margin: 5px 0; font-weight: 600; color: #475569; }
.stat-card small { color: #64748b; font-size: 12px; }

.border-blue { border-left-color: #3b82f6; }
.border-orange { border-left-color: #f97316; }
.border-green { border-left-color: #22c55e; }
.border-purple { border-left-color: #a855f7; }

.dashboard-sections { display: flex; gap: 20px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 260px; }
.flex-2 { flex: 2; min-width: 320px; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.link-more { font-size: 13px; color: #2563eb; text-decoration: none; font-weight: 600; }

.quick-links { list-style: none; padding: 0; margin: 0; }
.quick-links li { margin-bottom: 10px; }
.btn-link { display: block; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; text-decoration: none; color: #1e293b; font-weight: 500; transition: 0.2s; }
.btn-link:hover { background: #e2e8f0; }

/* Profile Styling */
.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0284c7;
    margin-bottom: 12px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item strong {
    font-size: 20px;
    color: #0f172a;
}

.stat-item span {
    font-size: 13px;
    color: #64748b;
}

/* User & Friend List Styling */
.user-list { list-style: none; padding: 0; margin: 0; }
.user-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.user-item:last-child { border-bottom: none; }
.user-info-box { font-size: 14px; color: #1e293b; }

/* Story Bar Styling */
.story-bar::-webkit-scrollbar { height: 6px; }
.story-bar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 65px;
    flex-shrink: 0;
}

.story-avatar-holder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #0284c7;
    margin-bottom: 4px;
}

.story-avatar-holder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-item span {
    font-size: 11px;
    color: #334155;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Styling Post Media agar Terkontrol & Proper */
.post-media {
    max-width: 100%;
    max-height: 450px; /* Membatasi tinggi gambar/video */
    width: auto;
    height: auto;
    object-fit: contain; /* Menjaga rasio asli gambar tanpa terpotong */
    border-radius: 10px;
    margin-top: 10px;
    display: block;
    background-color: #0f172a; /* Warna latar belakang netral jika gambar rasio unik */
}

/* Styling Tombol Like & Komentar */
.btn-like {
    background: none;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-like:hover {
    background-color: #f1f5f9;
}

.btn-like.liked {
    border-color: #ef4444;
    color: #ef4444;
    background-color: #fef2f2;
}
