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

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 16px 24px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.logo p {
    font-size: 0.7rem;
    color: #6b7280;
}

.nav {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 5px;
    border-radius: 40px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f3f4f6;
    padding: 6px 16px;
    border-radius: 50px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-info {
    text-align: right;
}

.user-info span {
    font-weight: 600;
    display: block;
    font-size: 0.9rem;
}

.user-info small {
    font-size: 0.7rem;
    color: #6b7280;
}

.logout-btn {
    background: #ef4444;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Auth Card */
.auth-card {
    max-width: 450px;
    margin: 60px auto;
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 60px;
}

.tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    border-radius: 40px;
    cursor: pointer;
    color: #6b7280;
    font-weight: 500;
}

.tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.form {
    display: none;
}

.form.active {
    display: block;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

textarea {
    resize: vertical;
}

.btn {
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    background: #f3f4f6;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 12px;
    margin-right: 8px;
}

/* Create Post */
.create-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.create-card h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.create-card input, .create-card textarea {
    margin-bottom: 12px;
}

/* Feed */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.feed-header h2 {
    font-size: 1.3rem;
    color: white;
}

.filters {
    display: flex;
    gap: 10px;
}

.filters select {
    width: auto;
    margin: 0;
    background: white;
}

.post-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 0.75rem;
    color: #9ca3af;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
    align-items: center;
}

.post-author {
    color: #667eea;
    font-weight: 500;
    cursor: pointer;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    margin-left: auto;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 20px;
}

.like-btn:hover {
    background: #f3f4f6;
}

.like-btn.liked {
    color: #ec489a;
}

.post-content {
    color: #4b5563;
    line-height: 1.5;
    white-space: pre-wrap;
}

.post-actions {
    margin-top: 12px;
    text-align: right;
}

.delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.delete-btn:hover {
    background: #fee2e2;
}

/* Chat */
.chat-container {
    display: flex;
    gap: 20px;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    height: 70vh;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.chat-sidebar {
    width: 300px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.chat-sidebar h3 {
    padding: 20px;
    font-size: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.chat-search {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.chat-search input {
    margin: 0;
    padding: 10px;
    font-size: 0.85rem;
}

.dialogs-list {
    flex: 1;
    overflow-y: auto;
}

.dialog-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.dialog-item:hover {
    background: #f3f4f6;
}

.dialog-item.active {
    background: #eef2ff;
    border-left: 3px solid #667eea;
}

.dialog-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.dialog-info {
    flex: 1;
}

.dialog-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.dialog-preview {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dialog-unread {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    padding: 0 5px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    background: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-chat {
    text-align: center;
    color: #9ca3af;
    padding: 40px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.message.outgoing {
    align-self: flex-end;
}

.message.incoming {
    align-self: flex-start;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    word-break: break-word;
    font-size: 0.9rem;
}

.message.outgoing .message-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.incoming .message-bubble {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.6rem;
    color: #9ca3af;
    margin-top: 4px;
    margin-left: 8px;
    margin-right: 8px;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.chat-input-area textarea {
    flex: 1;
    margin: 0;
    resize: none;
}

.chat-input-area button {
    width: auto;
    padding: 0 24px;
}

/* Users Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.user-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.user-card .avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 12px;
}

.user-card h4 {
    margin-bottom: 5px;
    color: #1f2937;
}

.user-role {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    margin: 8px 0;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.7rem;
    color: #6b7280;
}

.message-btn {
    background: #f3f4f6;
    border: none;
    padding: 6px 12px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 12px;
    font-size: 0.7rem;
    color: #667eea;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.message-btn:hover {
    background: #667eea;
    color: white;
}

.edit-role-btn {
    background: none;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 12px;
    font-size: 0.7rem;
    color: #667eea;
    margin-left: 8px;
}

.edit-role-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Profile */
.profile-card {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    background: white;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.profile-info {
    flex: 1;
}

.profile-info h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.profile-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 10px 0;
}

.stats {
    display: flex;
    gap: 25px;
    margin: 15px 0;
}

.stats div {
    text-align: center;
}

.stats span {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.bio {
    background: #f9fafb;
    padding: 15px;
    border-radius: 16px;
    margin-top: 15px;
}

.bio p {
    color: #4b5563;
    line-height: 1.5;
}

/* Dev Panel */
.dev-card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.dev-card h2 {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: #f9fafb;
    padding: 15px;
    border-radius: 16px;
    text-align: center;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.dev-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.dev-section h3 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.dev-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.dev-user-item button {
    background: none;
    border: 1px solid #e5e7eb;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.7rem;
}

.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    margin: 0;
}

.search-bar select {
    width: auto;
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 20px;
    color: #9ca3af;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 28px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 12px;
}

.modal-content p {
    color: #6b7280;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

@media (max-width: 800px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }
    .chat-sidebar {
        width: 100%;
        max-height: 300px;
    }
    .message {
        max-width: 85%;
    }
}

@media (max-width: 700px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .stats {
        justify-content: center;
    }
}