* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #e0e6ff;
    overflow: hidden;
}

/* Main Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Left Sidebar - Groups */
.sidebar {
    width: 280px;
    background: rgba(10, 14, 39, 0.8);
    border-right: 2px solid #4a5fff;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.sidebar h2 {
    color: #6b7fff;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(107, 127, 255, 0.5);
}

.group-list {
    list-style: none;
}

.group-item {
    background: linear-gradient(135deg, rgba(74, 95, 255, 0.2), rgba(107, 127, 255, 0.1));
    margin-bottom: 12px;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(107, 127, 255, 0.3);
}

.group-item:hover {
    background: linear-gradient(135deg, rgba(74, 95, 255, 0.4), rgba(107, 127, 255, 0.2));
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(74, 95, 255, 0.4);
}

.group-item h3 {
    color: #8b9fff;
    margin-bottom: 5px;
}

.group-item p {
    color: #b0b8ff;
    font-size: 12px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Profile/Timeline View */
.timeline-view {
    padding: 40px;
    overflow-y: auto;
    height: 100%;
    display: none;
    position: relative;
}

.timeline-view.active {
    display: block;
}

.profile-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 0 30px rgba(74, 95, 255, 0.6);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    box-shadow: 0 0 40px rgba(74, 95, 255, 0.9);
    transform: scale(1.05);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-upload {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #0a0e27;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-avatar:hover .profile-avatar-upload {
    opacity: 1;
}

.profile-name {
    font-size: 32px;
    color: #8b9fff;
    text-shadow: 0 0 10px rgba(107, 127, 255, 0.5);
}

.profile-edit-btn {
    background: rgba(74, 95, 255, 0.2);
    border: 1px solid rgba(107, 127, 255, 0.4);
    color: #8b9fff;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.profile-edit-btn:hover {
    background: rgba(74, 95, 255, 0.4);
    box-shadow: 0 5px 15px rgba(74, 95, 255, 0.4);
}

/* Friends List */
.friends-sidebar {
    position: fixed;
    right: 20px;
    top: 120px;
    width: 250px;
    background: rgba(10, 14, 39, 0.9);
    border: 2px solid rgba(107, 127, 255, 0.4);
    border-radius: 16px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.friends-sidebar h3 {
    color: #8b9fff;
    margin-bottom: 15px;
    font-size: 18px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(74, 95, 255, 0.1);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.friend-item:hover {
    background: rgba(74, 95, 255, 0.2);
    border-color: rgba(107, 127, 255, 0.6);
    transform: translateX(-5px);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-name {
    color: #c0c8ff;
    font-size: 14px;
}

.post-composer {
    background: rgba(74, 95, 255, 0.1);
    border: 2px solid rgba(107, 127, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

.post-composer textarea {
    width: 100%;
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    color: #e0e6ff;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
}

.post-composer button {
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.post-composer button:hover {
    box-shadow: 0 5px 20px rgba(74, 95, 255, 0.6);
    transform: translateY(-2px);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.post {
    background: rgba(74, 95, 255, 0.1);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.post:hover {
    border-color: rgba(107, 127, 255, 0.6);
    box-shadow: 0 5px 20px rgba(74, 95, 255, 0.3);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-content {
    color: #c0c8ff;
    line-height: 1.6;
}

.post-time {
    color: #7080ff;
    font-size: 12px;
    margin-top: 10px;
}

/* 3D Group Space */
.group-space {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.group-space.active {
    display: block;
}

#group-canvas {
    width: 100%;
    height: 100%;
}

/* Group Controls */
.group-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.control-panel {
    background: rgba(10, 14, 39, 0.9);
    border: 2px solid rgba(107, 127, 255, 0.5);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.control-panel h3 {
    color: #8b9fff;
    margin-bottom: 15px;
    font-size: 18px;
}

.control-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, rgba(74, 95, 255, 0.3), rgba(107, 127, 255, 0.2));
    border: 1px solid rgba(107, 127, 255, 0.5);
    color: #c0c8ff;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(74, 95, 255, 0.5), rgba(107, 127, 255, 0.3));
    box-shadow: 0 5px 15px rgba(74, 95, 255, 0.4);
}

.control-btn.active {
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    color: white;
}

/* Center Timeline in 3D Space */
.center-timeline-ui {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.timeline-post-form {
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid rgba(107, 127, 255, 0.6);
    border-radius: 16px;
    padding: 20px;
    width: 500px;
    pointer-events: all;
    box-shadow: 0 10px 40px rgba(74, 95, 255, 0.5);
}

.timeline-post-form textarea {
    width: 100%;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(107, 127, 255, 0.4);
    border-radius: 8px;
    padding: 12px;
    color: #e0e6ff;
    resize: vertical;
    min-height: 80px;
}

.timeline-post-form button {
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.timeline-post-form button:hover {
    box-shadow: 0 5px 15px rgba(74, 95, 255, 0.6);
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(10, 14, 39, 0.9);
    border: 2px solid rgba(107, 127, 255, 0.5);
    color: #8b9fff;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(74, 95, 255, 0.3);
    box-shadow: 0 5px 15px rgba(74, 95, 255, 0.4);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid rgba(107, 127, 255, 0.6);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(74, 95, 255, 0.5);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.chat-window.active {
    display: flex;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid rgba(107, 127, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    color: #8b9fff;
}

.chat-close {
    background: none;
    border: none;
    color: #8b9fff;
    cursor: pointer;
    font-size: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-message {
    background: rgba(74, 95, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.chat-message.own {
    background: rgba(107, 127, 255, 0.3);
    text-align: right;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(107, 127, 255, 0.3);
    display: flex;
}

.chat-input-area input {
    flex: 1;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #e0e6ff;
    margin-right: 10px;
}

.chat-input-area button {
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* Edit Profile Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid rgba(107, 127, 255, 0.6);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    color: #8b9fff;
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    color: #b0b8ff;
    margin-bottom: 5px;
    margin-top: 15px;
}

.modal-content input {
    width: 100%;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #e0e6ff;
}

.modal-content textarea {
    width: 100%;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    color: #e0e6ff;
    resize: vertical;
    min-height: 60px;
}

.modal-content input[type="file"] {
    padding: 5px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3 ease;
}

.btn-save {
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    color: white;
}

.btn-cancel {
    background: rgba(74, 95, 255, 0.2);
    color: #8b9fff;
    border: 1px solid rgba(107, 127, 255, 0.3);
}

.profile-bio {
    max-width: 600px;
    margin: 0 auto 30px;
    color: #b0b8ff;
    text-align: center;
    font-style: italic;
    font-size: 14px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(107, 127, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 127, 255, 0.7);
}

/* Tooltip for hovering over posts */
.post-tooltip {
    position: fixed;
    background: rgba(10, 14, 39, 0.98);
    border: 2px solid rgba(107, 127, 255, 0.8);
    border-radius: 12px;
    padding: 15px;
    max-width: 350px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(74, 95, 255, 0.6);
    display: none;
}

.post-tooltip.active {
    display: block;
}

.post-tooltip .tooltip-date {
    color: #6b7fff;
    font-size: 11px;
    margin-bottom: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-tooltip h4 {
    color: #8b9fff;
    margin-bottom: 8px;
    font-size: 14px;
}

.post-tooltip p {
    color: #c0c8ff;
    font-size: 13px;
    line-height: 1.5;
}

.post-tooltip .tooltip-time {
    color: #7080ff;
    font-size: 11px;
    margin-top: 8px;
    font-style: italic;
}

/* Member name labels in 3D */
.comment-bubble {
    position: absolute;
    background: rgba(20, 25, 60, 0.9);
    color: #e0e6ff;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #4a5fff;
    max-width: 250px;
    font-size: 14px;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.comment-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}

.member-label {
    position: absolute;
    color: #8b9fff;
    font-size: 12px;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(74, 95, 255, 0.8);
    background: rgba(10, 14, 39, 0.85);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(107, 127, 255, 0.4);
    white-space: nowrap;
    font-weight: 600;
    transform: translateX(-50%);
    z-index: 10;
}

/* Timeline post date labels in 3D */
.post-date-label {
    position: absolute;
    color: #6b7fff;
    font-size: 9px;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(74, 95, 255, 0.8);
    background: rgba(10, 14, 39, 0.75);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(107, 127, 255, 0.3);
    white-space: nowrap;
    font-weight: normal;
    transition: opacity 0.3s ease;
}

/* Post content labels for close-up view */
.post-content-label {
    position: absolute;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.3s ease;
}

.post-author-name {
    color: #8b9fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(74, 95, 255, 1);
    background: rgba(10, 14, 39, 0.9);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(107, 127, 255, 0.5);
    margin-bottom: 4px;
    display: inline-block;
}

.post-text-preview {
    color: #c0c8ff;
    font-size: 10px;
    text-shadow: 0 0 8px rgba(74, 95, 255, 0.6);
    background: rgba(10, 14, 39, 0.85);
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid rgba(107, 127, 255, 0.3);
    max-width: 150px;
    line-height: 1.3;
    margin-bottom: 3px;
}

.post-timestamp {
    color: #6b7fff;
    font-size: 8px;
    text-shadow: 0 0 6px rgba(74, 95, 255, 0.5);
    background: rgba(10, 14, 39, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    font-style: italic;
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.view-toggle button {
    background: rgba(74, 95, 255, 0.2);
    border: 1px solid rgba(107, 127, 255, 0.3);
    color: #8b9fff;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle button.active {
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    color: white;
}

.view-toggle button:hover {
    box-shadow: 0 5px 15px rgba(74, 95, 255, 0.4);
}

/* Calendar View */
.calendar-view {
    display: none;
    max-width: 900px;
    margin: 0 auto;
}

.calendar-view.active {
    display: block;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.calendar-day {
    background: rgba(74, 95, 255, 0.1);
    border: 1px solid rgba(107, 127, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: rgba(74, 95, 255, 0.2);
    border-color: rgba(107, 127, 255, 0.6);
}

.calendar-day-header {
    color: #7080ff;
    font-size: 12px;
    margin-bottom: 5px;
}

.calendar-post-dot {
    width: 8px;
    height: 8px;
    background: #6b7fff;
    border-radius: 50%;
    margin: 2px;
    display: inline-block;
}

/* Individual Timeline View */
.individual-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-horizontal {
    position: relative;
    padding: 40px 60px;
    margin: 40px 0;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 60px;
    right: 60px;
    height: 3px;
    background: linear-gradient(90deg, rgba(74, 95, 255, 0.3), rgba(107, 127, 255, 0.6), rgba(107, 127, 255, 0.6));
}

.timeline-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7fff;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(107, 127, 255, 0.6);
}

/* INVERTED: Past is now on the right */
.timeline-label.past {
    right: 0;
}

/* INVERTED: Now is on the left */
.timeline-label.now {
    left: 0;
}

.timeline-posts {
    display: flex;
    justify-content: space-around;
    position: relative;
    padding: 0 60px;
}

.timeline-post-item {
    position: relative;
    cursor: pointer;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #4a5fff, #6b7fff);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(74, 95, 255, 0.6);
    transition: all 0.3s ease;
}

.timeline-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 0 30px rgba(74, 95, 255, 0.9);
}

.timeline-post-preview {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid rgba(107, 127, 255, 0.6);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    width: 200px;
    display: none;
    box-shadow: 0 10px 30px rgba(74, 95, 255, 0.5);
}

.timeline-post-item:hover .timeline-post-preview {
    display: block;
}

.timeline-post-preview p {
    color: #c0c8ff;
    font-size: 12px;
    margin-bottom: 5px;
}

.timeline-post-preview .time {
    color: #7080ff;
    font-size: 10px;
}

/* Center Message Display */
.center-message-display {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.center-message-content {
    background: rgba(10, 14, 39, 0.95);
    border: 2px solid rgba(107, 127, 255, 0.8);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(74, 95, 255, 0.6);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.center-message-content.active {
    opacity: 1;
}

.center-message-author {
    color: #8b9fff;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(74, 95, 255, 0.8);
}

.center-message-text {
    color: #e0e6ff;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.center-message-time {
    color: #6b7fff;
    font-size: 11px;
    font-style: italic;
}

