:root {
    --primary: #1a73e8;
    --secondary: #5f6368;
    --background: #f0f2f5;
    --card-bg: #ffffff;
    --text: #202124;
    --border: #dadce0;
    --hover: #f1f3f4;
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.logo { font-size: 24px; font-weight: 700; color: var(--primary); }
.login-btn, .logout-btn, .settings-btn, .post-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    margin-left: 10px;
}
.login-btn:hover, .post-btn:hover { background: #1557b0; }
.logout-btn { background: #e74c3c; }
.settings-btn { background: #ff9800; }

.admin-badge, .fan-badge {
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}
.admin-badge { background: #ff9800; }
.fan-badge { background: #9c27b0; }

/* Main Layout */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    padding: 0 20px;
}

/* Biographical Panel */
.bio-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    height: fit-content;
}
.bio-avatar {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: var(--primary);
    margin: 0 auto 15px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 40px; font-weight: bold;
    overflow: hidden; cursor: pointer; position: relative;
}
.bio-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bio-avatar:hover::after {
    content: "Change";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6);
    color: white; font-size: 12px; text-align: center; padding: 4px;
}
.bio-name { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 5px; }
.bio-title { color: var(--secondary); text-align: center; font-size: 14px; margin-bottom: 15px; }
.bio-details { border-top: 1px solid var(--border); padding-top: 15px; }
.bio-item {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; font-size: 14px;
}
.bio-label { font-weight: 600; color: var(--secondary); font-size: 12px; text-transform: uppercase; }
.bio-value { color: var(--text); flex: 1; margin-left: 10px; }
.edit-pencil {
    background: none; border: none; color: var(--secondary); cursor: pointer; font-size: 14px;
    transition: color 0.2s;
}
.edit-pencil:hover { color: var(--primary); }

.social-links { display: flex; gap: 10px; margin-top: 15px; justify-content: center; }
.social-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: white; text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}
.social-link:hover { transform: scale(1.1); }
.social-link.twitter { background: #1DA1F2; }
.social-link.facebook { background: #1877F2; }
.social-link.telegram { background: #0088cc; }
.social-link.messenger { background: #00B2FF; }

.view-posts-btn {
    width: 100%; margin-top: 15px; padding: 12px;
    background: var(--primary); color: white; border: none;
    border-radius: 8px; font-weight: 600; cursor: pointer;
    transition: background 0.3s;
}
.view-posts-btn:hover { background: #1557b0; }

/* Posts Feed */
.posts-feed { display: none; flex-direction: column; gap: 20px; }
.posts-feed.visible { display: flex; }

.post-card {
    background: var(--card-bg);
    border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.post-header {
    padding: 15px; display: flex; align-items: center; gap: 10px;
}
.post-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-info { flex: 1; }
.post-author { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; }
.verified-badge { color: #1DA1F2; font-size: 16px; }
.post-date { font-size: 12px; color: var(--secondary); }
.post-image { width: 100%; max-height: 500px; object-fit: cover; cursor: pointer; }
.post-content { padding: 15px; }
.post-caption { margin-bottom: 10px; font-size: 14px; white-space: pre-wrap; }
.post-actions {
    padding: 10px 15px; display: flex; gap: 20px;
    border-top: 1px solid var(--border); align-items: center; flex-wrap: wrap;
}
.action-btn {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 5px;
    font-size: 14px; color: var(--secondary); transition: color 0.3s;
}
.action-btn:hover:not(:disabled) { color: var(--primary); }
.action-btn:disabled { opacity: 0.5; cursor: default; }
.action-btn.liked { color: #e91e63; }

.comments-section { padding: 15px; background: #f8f9fa; border-top: 1px solid var(--border); }
.comment { margin-bottom: 10px; padding: 10px; background: white; border-radius: 8px; }
.comment-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.comment-text { font-size: 13px; color: var(--secondary); }

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white; border-radius: 12px; padding: 30px;
    width: 90%; max-width: 500px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin-bottom: 20px; color: var(--primary); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 10px; border: 2px solid var(--border);
    border-radius: 6px; font-size: 14px; transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.submit-btn {
    background: var(--primary); color: white; border: none;
    padding: 12px 24px; border-radius: 6px; cursor: pointer;
    font-weight: 600; width: 100%; transition: background 0.3s;
}
.submit-btn:hover { background: #1557b0; }
.close-btn {
    background: var(--secondary); color: white; border: none;
    padding: 8px 16px; border-radius: 6px; cursor: pointer; margin-top: 10px;
}
.edit-btn, .delete-btn {
    color: white; border: none; padding: 5px 12px; border-radius: 4px;
    cursor: pointer; font-size: 12px; margin-left: 5px;
}
.edit-btn { background: #4caf50; }
.delete-btn { background: #f44336; }
.upload-area {
    border: 2px dashed var(--border); border-radius: 8px;
    padding: 20px; text-align: center; cursor: pointer; margin-bottom: 15px;
}
.upload-area:hover { border-color: var(--primary); }
.upload-preview { max-width: 100%; max-height: 200px; margin-top: 10px; border-radius: 8px; }
.loading { text-align: center; padding: 50px; color: var(--secondary); background: white; border-radius: 12px; }

@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; }
    .bio-panel { position: static; }
    .modal-content { width: 95%; padding: 20px; }
}