/* ConnectMe - Social Media Platform */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Colors */
    --primary: #1877f2;
    --primary-dark: #166fe5;
    --primary-light: #e7f3ff;
    --secondary: #42b72a;
    --secondary-dark: #36a420;
    --dark: #050505;
    --gray-900: #1c1e21;
    --gray-800: #2d3436;
    --gray-700: #4a4a4a;
    --gray-600: #65676b;
    --gray-500: #8a8d91;
    --gray-400: #bec3c9;
    --gray-300: #ced0d4;
    --gray-200: #e4e6eb;
    --gray-100: #f0f2f5;
    --gray-50: #f5f7fa;
    --white: #ffffff;
    --red: #e41e3f;
    --red-light: #ffebe9;
    --green: #42b72a;
    --yellow: #f7b928;
    
    /* Typography */
    --font-sans: 'Open Sans', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 60px;
    --sidebar-width: 300px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-900);
    background-color: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

/* Back to Portfolio Button */
.back-to-portfolio {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
}

.back-to-portfolio:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* App Container */
.app-container {
    max-width: 1920px;
    margin: 0 auto;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.logo i {
    font-size: 1.75rem;
}

.search-bar {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.search-bar input {
    width: 100%;
    height: 2.5rem;
    padding: 0 1rem 0 2.5rem;
    border: none;
    border-radius: var(--radius-full);
    background-color: var(--gray-100);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    background-color: var(--white);
    box-shadow: var(--shadow);
}

.main-nav {
    display: flex;
    justify-content: center;
    flex: 2;
}

.main-nav ul {
    display: flex;
    gap: 0.5rem;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    color: var(--gray-600);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.main-nav a i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.main-nav a:hover {
    background-color: var(--gray-100);
}

.main-nav li.active a {
    color: var(--primary);
}

.main-nav li.active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-end;
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background-color: var(--gray-200);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.btn-icon:hover {
    background-color: var(--gray-300);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background-color: var(--red);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    position: relative;
}

.user-menu img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu img:hover {
    filter: brightness(0.95);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 200;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0.5rem;
}

.user-info img {
    width: 3.5rem;
    height: 3.5rem;
}

.user-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.user-info p {
    font-size: 0.875rem;
    color: var(--primary);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.dropdown-menu li a i {
    width: 1.5rem;
    font-size: 1.125rem;
    color: var(--gray-600);
}

.dropdown-menu li a:hover {
    background-color: var(--gray-100);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--gray-800);
    border-radius: var(--radius-full);
}

/* Main Content */
.main-content {
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
    min-height: calc(100vh - var(--header-height));
}

/* Left Sidebar */
.left-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
}

.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    text-align: center;
}

.user-profile img {
    width: 5rem;
    height: 5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary);
}

.user-profile h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.side-nav {
    margin-bottom: 2rem;
}

.side-nav li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    position: relative;
}

.side-nav li a i {
    font-size: 1.125rem;
    width: 1.5rem;
    color: var(--primary);
}

.side-nav li a .badge {
    position: static;
    margin-left: auto;
}

.side-nav li a:hover {
    background-color: var(--gray-200);
}

.shortcuts h4 {
    padding: 0 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 1rem;
}

.shortcuts li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.shortcuts li a img {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    object-fit: cover;
}

.shortcuts li a:hover {
    background-color: var(--gray-200);
}

/* Feed Content */
.feed-content {
    flex: 1;
    max-width: 680px;
    margin: 0 auto;
}

/* Stories */
.stories-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.story {
    flex: 0 0 auto;
    width: 120px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.story:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.story-image {
    height: 200px;
    position: relative;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.create-story-icon {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 4px solid var(--white);
}

.story-user {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 4px solid var(--primary);
}

.story-user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story p {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--white);
}

.create-story .story-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

/* Create Post */
.create-post {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.create-post-input {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.create-post-input img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.create-post-input input {
    flex: 1;
    height: 2.5rem;
    padding: 0 1rem;
    border: none;
    border-radius: var(--radius-full);
    background-color: var(--gray-100);
    font-size: 0.9375rem;
}

.create-post-input input:focus {
    outline: none;
}

.create-post-actions {
    display: flex;
    justify-content: space-around;
}

.post-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.post-action:hover {
    background-color: var(--gray-100);
}

.post-action i {
    font-size: 1.25rem;
}

.post-action i.fa-video {
    color: var(--red);
}

.post-action i.fa-images {
    color: var(--green);
}

.post-action i.fa-smile {
    color: var(--yellow);
}

/* Posts */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.post-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-user img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.post-user-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.post-user-info p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.post-options .btn-icon {
    width: 2rem;
    height: 2rem;
    background-color: transparent;
}

.post-options .btn-icon:hover {
    background-color: var(--gray-200);
}

.post-content {
    padding: 0 1rem;
}

.post-content p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.post-image {
    margin-bottom: 1rem;
}

.post-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
}

.post-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.post-image-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.post-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.reaction-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reaction-icons {
    display: flex;
}

.reaction {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: var(--white);
    margin-right: -5px;
}

.reaction.like {
    background-color: var(--primary);
}

.reaction.love {
    background-color: var(--red);
}

.reaction.wow {
    background-color: var(--yellow);
}

.post-actions {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.post-actions .post-action {
    flex: 1;
}

.post-actions .post-action.active {
    color: var(--primary);
}

.post-comments {
    padding: 1rem;
}

.comment {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment img {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-bubble {
    background-color: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    margin-bottom: 0.25rem;
}

.comment-bubble h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-bubble p {
    font-size: 0.875rem;
    line-height: 1.4;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}

.comment-actions button {
    font-weight: 600;
    color: var(--gray-600);
}

.comment-actions button:hover {
    color: var(--gray-800);
}

.comment-actions span {
    color: var(--gray-500);
}

.add-comment {
    display: flex;
    gap: 0.75rem;
}

.add-comment img {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.comment-input {
    flex: 1;
    position: relative;
}

.comment-input input {
    width: 100%;
    height: 2.5rem;
    padding: 0 1rem;
    border: none;
    border-radius: var(--radius-full);
    background-color: var(--gray-100);
    font-size: 0.875rem;
}

.comment-input input:focus {
    outline: none;
}

.comment-input-actions {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.comment-input-actions button {
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.comment-input-actions button:hover {
    color: var(--primary);
}

.post-comments.collapsed .comment {
    display: none;
}

.view-comments-btn {
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 1rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.view-comments-btn:hover {
    background-color: var(--gray-100);
}

/* Right Sidebar */
.right-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
}

.sidebar-section {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--gray-700);
}

.sponsored-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sponsored-item:last-child {
    margin-bottom: 0;
}

.sponsored-item:hover {
    opacity: 0.9;
}

.sponsored-item img {
    width: 100px;
    height: 70px;
    border-radius: var(--radius);
    object-fit: cover;
}

.sponsored-item h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sponsored-item p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.section-actions .btn-icon {
    width: 2rem;
    height: 2rem;
    background-color: var(--gray-100);
}

.contacts-list,
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contacts-list li a,
.groups-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.contacts-list li a:hover,
.groups-list li a:hover {
    background-color: var(--gray-100);
}

.contact-avatar,
.group-avatar {
    position: relative;
}

.contact-avatar img,
.group-avatar img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background-color: var(--green);
    border: 2px solid var(--white);
}

.create-group {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background-color: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

/* Story Viewer Modal */
.story-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.story-viewer-modal.active {
    opacity: 1;
    visibility: visible;
}

.story-viewer-content {
    position: relative;
    max-width: 500px;
    width: 100%;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
}

.close-modal-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    color: var(--white);
}

.story-header .story-user {
    position: static;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: none;
    width: auto;
    height: auto;
}

.story-header .story-user img {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-full);
    border: 3px solid var(--primary);
}

.story-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.story-header p {
    font-size: 0.75rem;
    opacity: 0.8;
}

.story-header .btn-icon {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.story-image-full {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.story-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-progress {
    padding: 1rem;
}

.progress-bar {
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--white);
    width: 0;
    border-radius: var(--radius-full);
    transition: width 5s linear;
}

/* Responsive Styles */
@media (max-width: 1280px) {
    .main-content {
        padding: 1rem;
    }
    
    .left-sidebar,
    .right-sidebar {
        width: 250px;
    }
}

@media (max-width: 1024px) {
    .main-nav a {
        padding: 0.5rem 1rem;
    }
    
    .main-nav a i {
        margin-bottom: 0;
    }
    
    .main-nav a span {
        display: none;
    }
    
    .main-nav li.active::after {
        bottom: 0;
    }
    
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-left {
        flex: initial;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .left-sidebar {
        display: none;
    }
    
    .feed-content {
        max-width: 100%;
    }
    
    .header-right .btn-icon:not(.notification-btn) {
        display: none;
    }
}

@media (max-width: 576px) {
    .search-bar {
        display: none;
    }
    
    .stories-container {
        margin: 0 -1rem 1.5rem;
        padding: 0.5rem 1rem;
    }
    
    .story {
        width: 90px;
    }
    
    .story-image {
        height: 160px;
    }
    
    .post-image-grid {
        grid-template-columns: 1fr;
    }
    
    .post-action span {
        display: none;
    }
    
    .create-post-actions .post-action span {
        display: inline;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post {
    animation: slideIn 0.5s ease forwards;
}