/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 18px;
}

.card-content {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24,119,242,0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #1877f2;
    color: white;
}

.btn-primary:hover {
    background: #166fe5;
}

.btn-secondary {
    background: #e4e6eb;
    color: #050505;
}

.btn-secondary:hover {
    background: #d8dadf;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-block {
    width: 100%;
}

/* Messages */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #059669;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.hidden {
    display: none;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.navbar-logo {
    font-size: 24px;
    font-weight: bold;
    color: #1877f2;
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.navbar-links a {
    color: #65676b;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.navbar-links a:hover {
    background: #f0f2f5;
    color: #1877f2;
}

.navbar-links a.active {
    color: #1877f2;
    font-weight: 600;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Feed */
.feed-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
}

.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #050505;
}

.create-post {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.create-post textarea {
    width: 100%;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
}

.post {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.post-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author {
    font-weight: 600;
    color: #050505;
}

.post-time {
    font-size: 12px;
    color: #65676b;
}

.post-content {
    padding: 0 16px 12px;
    font-size: 14px;
    line-height: 1.5;
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.post-actions {
    padding: 8px 16px;
    border-top: 1px solid #e4e6eb;
    display: flex;
    gap: 16px;
}

.post-action-btn {
    flex: 1;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #65676b;
    font-weight: 600;
}

.post-action-btn:hover {
    background: #f0f2f5;
}

/* Profile */
.profile-cover {
    background: linear-gradient(135deg, #1877f2 0%, #8b9dc3 100%);
    height: 200px;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.profile-avatar {
    position: absolute;
    bottom: -60px;
    left: 32px;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    background: white;
    object-fit: cover;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #1877f2;
    color: white;
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    border: 2px solid white;
}

.profile-info {
    padding: 80px 24px 24px;
}

.profile-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.profile-username {
    color: #65676b;
    margin-bottom: 12px;
}

.profile-bio {
    margin-bottom: 16px;
    color: #050505;
}

/* Chat */
.chat-container {
    display: flex;
    height: calc(100vh - 80px);
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid #e4e6eb;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6eb;
    font-weight: 600;
    background: white;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f0f2f5;
}

.chat-item.active {
    background: #e7f3ff;
}

.chat-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-last-message {
    font-size: 12px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f0f2f5;
}

.message {
    display: flex;
    margin-bottom: 12px;
}

.message-own {
    justify-content: flex-end;
}

.message-other {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 60%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message-own .message-bubble {
    background: #1877f2;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-other .message-bubble {
    background: white;
    color: #050505;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #e4e6eb;
    display: flex;
    gap: 12px;
    background: white;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    outline: none;
}

.chat-input:focus {
    border-color: #1877f2;
}

/* Gift Cards */
.gift-card {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.gift-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gift-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.gift-name {
    font-weight: 600;
    margin-bottom: 4px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e4e6eb;
}

/* Community/Group Card */
.community-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.community-card:hover {
    background: #f0f2f5;
}

.community-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.community-info {
    flex: 1;
}

.community-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.community-members {
    font-size: 12px;
    color: #65676b;
}

/* Responsive */
@media (max-width: 1024px) {
    .feed-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar-left, .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar-links span {
        display: none;
    }
    
    .profile-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .profile-info {
        padding-top: 60px;
    }
}
.reaction-picker {
    position: absolute;
    background: white;
    border-radius: 40px;
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.reaction-option {
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s;
}

.reaction-option:hover {
    transform: scale(1.2);
}