/* TeamSync/css/style.css (CORRECTED) */

/* --- Mobile-First Layered Navigation --- */
@media (max-width: 1023px) {
    .app-column {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .app-column.is-active { 
        transform: translateX(0%); 
        z-index: 30; 
    }
    .app-column.is-peek { 
        transform: translateX(-85%); 
        z-index: 20; 
    }
    .app-column.is-peek-deeper { 
        transform: translateX(-95%); 
        z-index: 10; 
    }
    .app-column.is-hidden { 
        transform: translateX(100%); 
        z-index: 5; 
    }
}

/* --- Component Styles --- */
.group-summary::-webkit-details-marker { display: none; }
details[open] .group-summary .chevron { transform: rotate(90deg); }
.nav-item:not(.active):hover {
    background-color: #f3f4f6; /* zinc-100 */
}
.nav-item.active { 
    background-color: #eef2ff; /* indigo-100 */
    color: #312e81; /* indigo-900 */
    font-weight: 600;
}

.dark .nav-item:not(.active):hover {
    background-color: #3f3f46; /* zinc-700 */
}
.dark .nav-item.active { 
    background-color: #3730a3; /* indigo-800 */
    color: #e0e7ff; /* indigo-200 */
    font-weight: 600;
}


/* --- Emoji Picker Styles --- */
#emoji-picker {
    position: fixed; 
    z-index: 50;
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    padding: 0.5rem;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    width: 280px;
}
#emoji-picker button { display: flex; align-items: center; justify-content: center; padding: 0.25rem; border-radius: 0.25rem; transition: background-color 0.15s; }
#emoji-picker button:hover { background-color: var(--color-bg-secondary); }
#emoji-picker img { width: 32px; height: 32px; pointer-events: none; }

/* --- Inline Emoji & Reactions Styles --- */
.inline-emoji { display: inline-block; width: 1.75rem; height: 1.75rem; vertical-align: bottom; margin: 0 0.1rem; }
.chat-reaction img { width: 24px; height: 24px; }

/* --- Chat Input UI Styles --- */
#chat-reply-context, #chat-file-preview-container {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    background-color: var(--color-bg-secondary, #f4f4f5);
}
.dark #chat-reply-context, .dark #chat-file-preview-container {
     border-bottom-color: var(--color-border, #3f3f46);
     background-color: var(--color-bg-secondary, #27272a);
}

/* --- File Preview Styles --- */
.file-preview-item { 
    max-width: 250px; 
    max-height: 200px;
    border-radius: 0.5rem; 
    cursor: pointer; 
    object-fit: cover;
}

.file-preview-item img { 
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.org-item {
    cursor: pointer;
}

/* --- Share Modal Destination List Styles --- */
#share-destination-list label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 1px solid transparent;
}
#share-destination-list label:hover {
    background-color: var(--color-bg-secondary);
}
#share-destination-list input:checked + label {
    background-color: #eef2ff;
    border-color: #6366f1;
    font-weight: 600;
}
.dark #share-destination-list input:checked + label {
    background-color: #312e81;
    border-color: #818cf8;
}

/* --- Quill, SortableJS, etc. Styles --- */
.ql-toolbar { background-color: var(--color-bg-secondary); border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; border-color: var(--color-border) !important; }
.ql-container { border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; border-color: var(--color-border) !important; background-color: var(--color-bg-primary); color: var(--color-text-primary); height: 100%; }
.ql-editor { height: 100%; }
.dark .ql-snow .ql-stroke { color: var(--color-text-secondary); }
.dark .ql-snow .ql-picker-label { color: var(--color-text-secondary); }
.dark .ql-snow .ql-active .ql-stroke { color: var(--color-text-primary); }
.task-card { cursor: grab; }
.task-card:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.4; background-color: rgba(79, 70, 229, 0.1); }
.sortable-drag { opacity: 1 !important; }

/* --- UTILITY OVERRIDE --- */
[hidden],
.hidden {
  display: none !important;
}

/* --- Theme Variable Styles (simplified for clarity) --- */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-secondary); }
.text-on-accent { color: var(--color-text-inverted); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.bg-tertiary { background-color: var(--color-bg-tertiary); }
.bg-accent { background-color: var(--color-bg-accent); }
.bg-accent:hover { background-color: var(--color-bg-accent-hover); }
.border-heavy { border-color: var(--color-border); }


/* --- START: Pop-up Menu Z-Index Fix --- */
.group-container {
  position: relative;
}

/*
  Rule 2: This ensures the pop-up menu itself has a high z-index,
  so it appears on top of the text and icons within its own parent.
*/
.action-popover {
  z-index: 20;
}

.new-messages-divider {
    position: relative;
    border-top: 1px solid #ef4444; /* red-500 */
}
/* This prevents the line from going through the text */
.new-messages-divider span {
    position: relative;
    top: -0.6em;
}

/* Remove default list styling from the organization switcher */
#org-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

/* --- END: Pop-up Menu Z-Index Fix --- */