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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: #007bff;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #f0f0f0;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
}

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Main Content */
.main-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.main-content h1 {
    margin-bottom: 30px;
    color: #333;
}

/* Posts */
.create-post {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.create-post textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    min-height: 100px;
    margin-bottom: 10px;
    resize: vertical;
}

.posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.btn-delete {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #fee;
    transform: scale(1.1);
}

.btn-delete {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.btn-delete:hover {
    transform: scale(1.2);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.post-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.username:hover {
    color: #667eea;
}

.post-time {
    font-size: 14px;
    color: #999;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

.post-actions {
    display: flex;
    gap: 15px;
}

.btn-like {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

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

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

.likes-count {
    color: #999;
    font-size: 16px;
}

.no-content {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Chats */
.start-chat {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.start-chat form {
    display: flex;
    gap: 10px;
}

.start-chat input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.start-chat .btn {
    width: auto;
}

.chats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    position: relative;
}

.chat-item:hover {
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.chat-info {
    flex: 1;
    margin-left: 12px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.chat-preview {
    font-size: 14px;
    color: #999;
}

.time {
    font-size: 12px;
    color: #999;
}

.unread-badge {
    position: absolute;
    right: 15px;
    background: #e74c3c;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Container */
.chat-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
}

.chat-header-box {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.message {
    display: flex;
    gap: 10px;
    max-width: 70%;
}

.message-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    background: #f0f0f0;
    padding: 12px 16px;
    border-radius: 18px;
}

.message-own .message-content {
    background: #667eea;
    color: #fff;
}

.message-text {
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.message-own .message-time {
    color: rgba(255,255,255,0.7);
}

.message-input {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.message-input form {
    display: flex;
    gap: 10px;
}

.message-input textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    resize: none;
    height: 50px;
}

.message-input .btn {
    width: auto;
    height: 50px;
}

/* Profile */
.profile-container {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info h1 {
    margin-bottom: 15px;
}

.profile-bio {
    color: #666;
    margin-bottom: 10px;
}

.profile-joined {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.profile-posts h2 {
    margin-bottom: 20px;
}

/* Settings */
.settings-container {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-container h1 {
    margin-bottom: 30px;
}

.settings-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    margin-bottom: 20px;
    color: #555;
}

.settings-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-container {
        height: calc(100vh - 180px);
    }
}
