/* css/2-layout.css */

/* --- Header --- */
.header {
    background: linear-gradient(to bottom, #f5f5f5, #eeeeee);
    padding: 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    position: relative;
    z-index: 100;
}

.header .logo-img {
    height: 50px; 
    width: auto;
    max-width: 400px;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ensure both button groups in header are flex */
.header-buttons #auth-buttons,
.header-buttons #app-buttons {
    display: flex;
    gap: 10px; 
    align-items: center; 
}

/* --- Header Auth/Account Buttons --- */
#signin-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#signin-btn-wrapper:hover {
    background-color: rgba(0,0,0,0.05);
}

#signin-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V7H4v3H1v2h3v3h2v-3h3v-2H6zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-size: 80%; 
}

#signin-btn-text {
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

#account-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#account-btn-wrapper:hover {
    background-color: rgba(0,0,0,0.05);
}

#account-btn-text {
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

#friends-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
#friends-btn-wrapper:hover {
    background-color: rgba(0,0,0,0.05);
}

#friends-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V18h14v-1.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V18h6v-1.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
    background-size: 90%;
}

#friends-btn-text {
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

#messages-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    position: relative;
}
#messages-btn-wrapper:hover {
    background-color: rgba(0,0,0,0.05);
}

#groups-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#groups-btn-wrapper:hover {
    background-color: rgba(0,0,0,0.05);
}

#groups-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='3.5' cy='12' r='1.8' fill='%23888'/%3E%3Cpath d='M1.2 14.8c-.35 0-.6.25-.6.6v1.8c0 .35.25.6.6.6h4.6c.35 0 .6-.25.6-.6v-1.8c0-.35-.25-.6-.6-.6h-4.6z' fill='%23888'/%3E%3Ccircle cx='7' cy='7' r='2.2' fill='%23888'/%3E%3Ccircle cx='17' cy='7' r='2.2' fill='%23888'/%3E%3Ccircle cx='12' cy='17' r='2.2' fill='%23888'/%3E%3Cline x1='7' y1='7' x2='12' y2='17' stroke='%23888' stroke-width='1' stroke-linecap='round'/%3E%3Cline x1='17' y1='7' x2='12' y2='17' stroke='%23888' stroke-width='1' stroke-linecap='round'/%3E%3Cline x1='7' y1='7' x2='17' y2='7' stroke='%23888' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='20.5' cy='12' r='1.8' fill='%23888'/%3E%3Cpath d='M18.2 14.8c-.35 0-.6.25-.6.6v1.8c0 .35.25.6.6.6h4.6c.35 0 .6-.25.6-.6v-1.8c0-.35-.25-.6-.6-.6h-4.6z' fill='%23888'/%3E%3C/svg%3E");
    background-size: 75%;
}

#groups-btn-text {
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

#messages-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z'/%3E%3C/svg%3E");
    background-size: 75%;
}

#messages-btn-text {
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

/* --- Main Layout --- */
.main-container {
    display: flex;
    flex-direction: row-reverse;
    height: calc(100vh - 80px); 
    gap: 0;
    position: relative;
}

/* --- Sidebar --- */
.sidebar {
    width: 400px;
    background: white;
    border-left: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    transition: width 0.3s ease;
    position: relative; 
    z-index: 50;        
}

.sidebar-header {
    padding: 10px;
    overflow: hidden; 
    transition: opacity 0.1s linear; 
    white-space: normal;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; 
    padding: 20px;
    scroll-behavior: smooth;
    transition: opacity 0.1s linear; 
}

/* --- Sidebar Controls --- */

.timeline-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.timeline-filter-group #timelineFilter {
    flex-grow: 1;
    margin-bottom: 0;
}

.timeline-filter-group .profile-options-container {
    flex-shrink: 0;
}
.timeline-filter-group .profile-options-btn {
    width: 42px;
    height: 42px;
    border: 2px solid #ddd;
    border-radius: 10px;
    color: #555;
}
.timeline-filter-group .profile-options-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}
.timeline-filter-group .profile-options-btn svg {
    fill: #555;
}

#timelineFilter {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    margin-bottom: 15px;
}

.sidebar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 15px; 
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 0;
    justify-content: flex-start;
}

.sort-controls label {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
}

.sort-controls select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    padding: 4px 25px 4px 0;
    margin: 0;
    cursor: pointer;
    width: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

#sort-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9em;
    font-weight: 300;
    color: #555;
    padding: 4px 25px 4px 0;
    margin: 0;
    cursor: pointer;
    width: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

#sort-select:focus {
    outline: none;
}

.filter-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    color: #555;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background-color: #f0f0f0;
    color: #333;
}

.btn-filter svg {
    width: 24px;
    height: 24px;
}

.btn-filter.active {
    background-color: #fde8e8;
    border-color: #f44336;
    color: #c9302c;
}

.btn-filter.active:hover {
    background-color: #fbdcdc;
    border-color: #c9302c;
}

#sidebar-event-btn {
    color: #667eea;
}
#sidebar-event-btn:hover {
    background-color: #f0f4ff;
    color: #5567d8;
}

/* --- Sidebar Collapse --- */
.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-content {
    opacity: 0;
    visibility: hidden;
}

.sidebar.collapsed {
    width: 0px;
    min-width: 0px; 
    padding: 0;
    border: none;
    overflow: hidden; 
}

#sidebarToggleBtn {
    position: absolute;
    top: 50%;
    right: 400px; 
    transform: translateY(-50%);
    z-index: 51; 
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-right: none;
    width: 25px;
    height: 70px;
    padding: 0;
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    transition: right 0.3s ease; 
}

#sidebarToggleBtn:hover {
    background: #e9e9e9;
    color: #333;
}

.main-container.sidebar-collapsed #sidebarToggleBtn {
    right: 0px;
}

.sidebar:not(.collapsed) {
    width: 400px !important;
    min-width: 400px !important;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar:not(.collapsed) .sidebar-header,
.sidebar:not(.collapsed) .sidebar-content {
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar.collapsed {
    width: 0px !important;
    min-width: 0px !important;
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    background: white;
}

/* Main canvas card (replaces timeline-area) */
.main-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.timeline-area {
    display: none; /* Hidden - replaced by .main-canvas */
}

.timeline-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 8px;
    margin-bottom: 0px;
    min-height: 10px;
    width: 100%;
    flex-shrink: 0;
}

/* --- Sidebar Event List Items --- */
.event-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px 8px 15px;
    border-radius: 10px;
    margin-bottom: 8px; 
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.event-item.hidden {
    opacity: 0.5;
    background: #bbb;
    color: #fff;
}

.event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.event-item.hidden:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(0); 
}

.event-item.selected {
    box-shadow: 0 0 0 4px #ffd700;
}

.event-item.disabled {
    background: linear-gradient(135deg, #a8b5d1 0%, #9fa8c4 100%);
    opacity: 0.6;
    cursor: not-allowed;
}

.event-item.disabled:hover {
    transform: none;
    box-shadow: none;
}

.event-item h3 {
    font-size: 1.1em;
    margin-bottom: 2px;
}

.event-item p {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 0; 
}

.event-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.event-menu-container {
    position: relative;
}

.event-visibility,
.event-edit-btn {
    background: transparent;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.event-edit-btn {
    font-size: 0.9em;
}

.event-visibility:hover {
    background: rgba(255,255,255,0.2);
}

.event-edit-btn:hover {
    background: rgba(255,255,255,0.2);
}

.event-menu-btn {
    background: transparent;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.event-menu-btn:hover {
    background: rgba(255,255,255,0.2);
}

.event-menu-dropdown {
    position: absolute;
    top: 32px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
}

.event-menu-dropdown button {
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    text-align: left;
    font-size: 0.9em;
    transition: background 0.2s;
}

.event-menu-dropdown button:hover {
    background: #f5f5f5;
}

.event-menu-dropdown button:first-child {
    border-radius: 4px 4px 0 0;
}

.event-menu-dropdown button:last-child {
    border-radius: 0 0 4px 4px;
}

/* --- Fix for expanded sidebar timeline menu --- */
#timeline-options-container #timeline-options-menu {
    right: auto;
    left: 0;
}

/* --- Friend View Back Button --- */
#header-back-btn {
    font-size: 1.05em;
    font-weight: 600;
    padding: 10px 16px;
    color: #555;
    border-radius: 10px;
    border: none; /* Explicitly set border to none */
}

#header-back-btn:hover {
    background-color: #e9e9e9;
    color: #000;
}

#header-back-btn:focus,
#header-back-btn:focus-visible {
    outline: none;
    box-shadow: none;
}

/* --- NEW: Main Header Friend View --- */
#friend-view-main-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1; 
    justify-content: center;
}

#header-friend-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

#header-friend-name {
    font-weight: 600;
    font-size: 1.2em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- NEW: Main Header Group View --- */
#group-view-main-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1; 
    justify-content: center;
}

.group-back-btn {
    font-size: 1em;
    font-weight: 600;
    padding: 8px 12px;
    color: #667eea;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.group-back-btn:hover {
    background-color: #f0f4ff;
    color: #764ba2;
}

.group-context-name {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#group-action-buttons {
    display: flex;
    gap: 10px;
}

#group-action-buttons > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#group-action-buttons > div:hover {
    background-color: rgba(0,0,0,0.05);
}

#group-members-btn-text,
#group-messages-btn-text,
#group-documents-btn-text {
    font-size: 0.75em;
    color: #555;
    margin-top: 4px;
    font-weight: 500;
}

#group-members-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V18h14v-1.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V18h6v-1.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E");
    background-size: 90%;
}

#group-messages-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z'/%3E%3C/svg%3E");
    background-size: 75%;
}

#group-documents-icon-circle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    background-size: 75%;
}

/* --- Hide Add Event Button in Friend View --- */
.main-container.friend-view-mode #sidebar-event-btn {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* GROUP CONTEXT HEADER */
/* ═══════════════════════════════════════════════════════════════════════════ */

.group-context-header {
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    min-height: 60px;
    position: relative;
    z-index: 99;
}

.group-context-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.group-logo {
    flex-shrink: 0;
}

.group-back-btn {
    font-size: 1em;
    font-weight: 600;
    padding: 8px 12px;
    color: #667eea;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.group-back-btn:hover {
    background-color: #f0f4ff;
    color: #764ba2;
}

.group-context-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.group-context-name {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

/* --- Group Action Buttons (like app-buttons style) --- */
.group-context-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-shrink: 0;
}

.group-context-actions > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}

.group-context-actions > div:hover {
    transform: translateY(-2px);
}

.group-action-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
}

.group-context-actions > div:hover .group-action-icon-circle {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.group-action-text {
    font-size: 0.75em;
    font-weight: 600;
    color: #555;
    text-align: center;
}

/* --- Group Tabs --- */
.group-context-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.group-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.group-tab:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.group-tab.active {
    background-color: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.group-tab svg {
    flex-shrink: 0;
}

/* --- Group Context Actions --- */
.group-context-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-group-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-group-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-group-action svg {
    flex-shrink: 0;
}

/* --- Hide Sidebar/Canvas elements in group view --- */
.main-container.group-view-mode #sidebar-event-btn {
    display: none;
}

/* --- Responsive adjustments --- */
@media (max-width: 1024px) {
    .group-context-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 20px;
    }

    .group-context-tabs {
        width: 100%;
    }

    .group-context-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* --- Group Content Container --- */
.group-content-container {
    width: 100%;
    height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f9f9;
}

.group-tab-content {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-in;
}

.group-tab-content[style*="display: flex"] {
    display: flex !important;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Members Tab --- */
.members-container {
    max-width: 1000px;
    margin: 0 auto;
}

.members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.members-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.members-count {
    font-size: 14px;
    color: #666;
    background-color: #e8e8e8;
    padding: 4px 12px;
    border-radius: 20px;
}

.members-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.members-empty-state svg {
    color: #ddd;
    margin-bottom: 20px;
}

.members-empty-state p {
    margin: 0;
    font-size: 16px;
    color: #999;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.member-item:hover {
    border-color: #bbb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.member-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.member-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.member-name {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.member-email {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-current,
.badge-owner {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-owner {
    background-color: #ffe0e0;
    color: #c41e3a;
}

.badge-current {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.member-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.member-role-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.member-role-select:hover {
    border-color: #999;
    background-color: #f9f9f9;
}

.member-role-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.member-role-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.member-remove-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #d32f2f;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 32px;
}

.member-remove-btn:hover {
    background-color: #ffebee;
    border-color: #d32f2f;
}

.member-remove-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.member-role-badge {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #666;
    font-weight: 500;
}

.tab-placeholder {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

@media (max-width: 768px) {
    .group-content-container {
        padding: 10px;
        height: calc(100vh - 150px);
    }

    .member-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .member-actions {
        width: 100%;
        margin-top: 10px;
        gap: 10px;
    }

    .member-role-select,
    .member-remove-btn {
        flex: 1;
    }

    .members-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .members-count {
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .group-context-header-left {
        width: 100%;
    }

    .group-context-name {
        font-size: 1em;
    }

    .group-tab span {
        display: none;
    }

    .group-tab {
        padding: 8px 12px;
    }

    .btn-group-action span {
        display: none;
    }

    .btn-group-action {
        padding: 8px;
    }
}

/* --- Invite Modal Styling --- */
.btn-small-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-small-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-small-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.invite-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.invite-tab-btn {
    padding: 10px 0;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #999;
    font-size: 1em;
    transition: all 0.2s;
    padding-bottom: 10px;
}

.invite-tab-btn.active {
    color: #667eea;
    border-bottom: 3px solid #667eea;
    margin-bottom: -2px;
}

.invite-tab-btn:hover {
    color: #667eea;
}

.invite-tab-content {
    display: none;
}

.invite-tab-content.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* GROUP TIMELINES STYLING */
/* ═══════════════════════════════════════════════════════════════════════════ */

.timelines-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0;
}

.timeline-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.timeline-card:hover {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.timeline-card-title {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.timeline-name {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.timeline-creator {
    font-size: 0.85em;
    color: #999;
    font-weight: 400;
}

.timeline-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-icon-small {
    padding: 6px 10px;
    border: none;
    background: #e0e0e0;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    min-width: 32px;
    text-align: center;
}

.btn-icon-small:hover {
    background: #667eea;
    color: #ffffff;
}

.btn-icon-small.btn-danger:hover {
    background: #e74c3c;
}

.timeline-description {
    margin: 8px 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
}

.timeline-metadata {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    font-size: 0.85em;
    color: #999;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
}

.timeline-notes {
    margin: 8px 0;
    padding: 8px;
    background: #f0f0f0;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
}

.timeline-notes strong {
    color: #333;
}

.timeline-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.timeline-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.timelines-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.timelines-empty-state svg {
    color: #ddd;
    margin-bottom: 16px;
    opacity: 0.6;
}

.timelines-empty-state p {
    margin: 8px 0;
    font-size: 1em;
}

.timelines-empty-state .hint-text {
    font-size: 0.9em;
    color: #bbb;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* GROUP PHOTOS STYLING */
/* ═══════════════════════════════════════════════════════════════════════════ */

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 0;
}

.photo-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.photo-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.photo-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 100%;  /* 1:1 aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.photo-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.photo-card:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background: rgba(231, 76, 60, 1);
}

.photo-info {
    padding: 10px;
}

.photo-name {
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-meta {
    margin: 4px 0 0 0;
    font-size: 0.75em;
    color: #999;
}

.photo-description {
    margin: 4px 0 0 0;
    font-size: 0.8em;
    color: #666;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photos-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.photos-empty-state svg {
    color: #ddd;
    margin-bottom: 16px;
    opacity: 0.6;
}

.photos-empty-state p {
    margin: 8px 0;
    font-size: 1em;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* GROUP FILES STYLING */
/* ═══════════════════════════════════════════════════════════════════════════ */

.files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.file-row:hover {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 6px;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    margin: 4px 0 0 0;
    font-size: 0.8em;
    color: #999;
}

.file-description {
    margin: 4px 0 0 0;
    font-size: 0.85em;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.file-download-btn,
.file-delete-btn {
    padding: 6px 10px;
    border: none;
    background: #e0e0e0;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.file-download-btn:hover {
    background: #667eea;
    color: #ffffff;
}

.file-delete-btn:hover {
    background: #e74c3c;
    color: #ffffff;
}

.files-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.files-empty-state svg {
    color: #ddd;
    margin-bottom: 16px;
    opacity: 0.6;
}

.files-empty-state p {
    margin: 8px 0;
    font-size: 1em;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* FILE UPLOAD STYLING */
/* ═══════════════════════════════════════════════════════════════════════════ */

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.btn-file-select {
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.btn-file-select:hover {
    background: #5568d3;
}

.btn-file-select:active {
    background: #4657b8;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #667eea, #5568d3);
    width: 0%;
    transition: width 0.3s ease;
}

.plan-warning {
    background: #fff3cd;
    color: #856404;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
}



