/* ===================================================
   Blog Andi - Stylesheet
   =================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg: #f9fafb;
    --card: #ffffff;
    --text: #111827;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}
.nav-menu a:hover { color: var(--primary); }
.nav-admin {
    color: var(--primary) !important;
    font-weight: 600 !important;
}
.nav-user {
    color: var(--text-light);
    font-size: 14px;
}
.nav-btn {
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    border: 1px solid var(--border);
}
.nav-btn-primary {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
}
.nav-btn-outline { background: transparent; }
.badge-admin {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}

/* Container */
.container {
    max-width: 700px;
    margin: 24px auto;
    padding: 0 20px;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--error);
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}
.profile-avatar {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
}
.profile-info h1 { font-size: 28px; margin-bottom: 4px; }
.profile-username { opacity: 0.9; margin-bottom: 12px; }
.profile-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Section Title */
.section-title {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

/* Post Card */
.post-card {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-detail { padding: 28px; }

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.post-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}
.post-time {
    color: var(--text-light);
    font-size: 13px;
    margin-left: 8px;
}
.post-content {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.post-image {
    margin-bottom: 14px;
    border-radius: 8px;
    overflow: hidden;
}
.post-image img {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: cover;
}
.post-stats {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.post-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    flex-wrap: wrap;
}
.action-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}
.action-btn:hover { background: var(--bg); border-color: var(--primary); }
.action-btn.active {
    background: #fee2e2;
    color: var(--error);
    border-color: var(--error);
}
.action-btn-link {
    margin-left: auto;
    color: var(--primary);
    border: none;
}

/* Form */
.inline-form { display: inline; margin: 0; }

.form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: 14px; }
.form-group small { color: var(--text-light); font-size: 12px; }
.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-weight: normal !important;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-block { width: 100%; }

/* Auth Card */
.auth-card {
    background: var(--card);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 420px;
    margin: 40px auto;
}
.auth-card h1 {
    font-size: 24px;
    margin-bottom: 4px;
    text-align: center;
}
.auth-subtitle {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}
.auth-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Comments */
.comments-section {
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}
.comments-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
}
.comment-form {
    background: var(--bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comment-form-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}
.comment-form button { align-self: flex-end; }
.comment-login-prompt {
    background: var(--bg);
    padding: 16px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.comment-login-prompt a { color: var(--primary); font-weight: 600; }

.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: 8px;
}
.comment-avatar {
    width: 36px;
    height: 36px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}
.comment-time { color: var(--text-light); }
.comment-body p {
    font-size: 14px;
    word-wrap: break-word;
    margin-top: 4px;
}
.comment-delete {
    color: var(--error);
    font-size: 12px;
    text-decoration: none;
    margin-top: 6px;
    display: inline-block;
}
.comment-delete:hover { text-decoration: underline; }

/* Followers */
.followers-list {
    background: var(--card);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
}
.follower-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}
.follower-item:last-child { border-bottom: none; }
.follower-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.follower-info { flex: 1; display: flex; flex-direction: column; }
.follower-info span { color: var(--text-light); font-size: 13px; }
.follower-since { color: var(--text-light); font-size: 12px; }

/* Admin */
.admin-card {
    background: var(--card);
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.admin-card h1 { margin-bottom: 20px; font-size: 22px; }

.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 26px; margin-bottom: 4px; }
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-header-flex h1 { font-size: 24px; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 14px;
}
.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-light);
}
.table-content {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}
.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-edit {
    background: var(--warning);
    color: white !important;
    border-color: var(--warning);
}
.btn-danger {
    background: var(--error);
    color: white !important;
    border-color: var(--error);
}
.text-muted { color: var(--text-light); font-size: 12px; }
.edit-preview {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 4px;
}

/* Misc */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.back-link:hover { text-decoration: underline; }

.empty-state {
    background: var(--card);
    padding: 40px 20px;
    text-align: center;
    border-radius: 12px;
    color: var(--text-light);
    box-shadow: var(--shadow);
}
.empty-state p { margin-bottom: 12px; }

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 600px) {
    .profile-header { flex-direction: column; text-align: center; padding: 24px; }
    .profile-avatar { margin: 0 auto; }
    .profile-stats { justify-content: center; }
    .nav-container { padding: 10px 14px; }
    .nav-menu { gap: 10px; font-size: 13px; }
    .post-card { padding: 16px; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px; }
    .table-content { max-width: 150px; }
}
