/**
 * Info Sidebar Styles
 * Telegram-style right sidebar for conversation/group info
 */

/* ===== Info Sidebar Container ===== */
.info-sidebar {
    width: 0;
    min-width: 0;
    height: 100vh;
    background: var(--color-surface, #fff);
    border-left: 0 solid var(--color-border, #e0e0e0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-left-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-sidebar.active {
    width: 400px;
    border-left-width: 1px;
}

/* ===== Header ===== */
.info-sidebar-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    background: var(--color-surface, #fff);
    position: relative;
    min-width: 400px;
    flex-shrink: 0;
}

.info-sidebar-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--color-text-secondary, #666);
}

.info-sidebar-close:hover {
    background: var(--color-hover, rgba(0, 0, 0, 0.05));
}

.info-sidebar-title {
    margin: 0;
    margin-left: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary, #212121);
}

/* ===== Content Container ===== */
.info-sidebar-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-width: 400px;
}

.info-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.info-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.info-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar, #ccc);
    border-radius: 3px;
}

/* ===== Header Section (Avatar + Name) ===== */
.info-header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.info-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.info-name {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary, #212121);
    text-align: center;
}

.info-members-count {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: var(--color-text-secondary, #666);
}

/* ===== Tabs ===== */
.info-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    background: var(--color-surface, #fff);
    position: sticky;
    top: 0;
    z-index: 10;
}

.info-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary, #666);
    transition: all 0.2s;
    position: relative;
}

.info-tab span.material-symbols-outlined {
    font-size: 24px;
}

.info-tab:hover {
    background: var(--color-hover, rgba(0, 0, 0, 0.05));
}

.info-tab.active {
    color: var(--color-primary, #2196F3);
}

.info-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary, #2196F3);
}

/* ===== Tab Content ===== */
.info-tab-content {
    flex: 1;
    position: relative;
}

.info-tab-pane {
    display: none;
    padding: 16px;
    animation: fadeIn 0.2s ease-in;
}

.info-tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Loading State ===== */
.info-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--color-text-secondary, #666);
    gap: 12px;
}

.info-loading .material-symbols-outlined {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Members List ===== */
.info-members-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-member-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
}

.info-member-item:hover {
    background: var(--color-hover, rgba(0, 0, 0, 0.05));
}

.info-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-right: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
    overflow: hidden;
}

.info-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-member-info {
    flex: 1;
    min-width: 0;
}

.info-member-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary, #212121);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-member-role {
    font-size: 13px;
    color: var(--color-text-secondary, #666);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Media Grid ===== */
.info-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0;
}

.info-media-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--color-border, #e0e0e0);
    cursor: pointer;
    overflow: hidden;
}

.info-media-item img,
.info-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.info-media-item:hover img,
.info-media-item:hover video {
    transform: scale(1.05);
}

.info-media-item-type {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.info-media-item-type .material-symbols-outlined {
    font-size: 14px;
}

/* ===== Files List ===== */
.info-files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
}

.info-file-item:hover {
    background: var(--color-hover, rgba(0, 0, 0, 0.05));
}

.info-file-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--color-primary-light, #E3F2FD);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.info-file-icon .material-symbols-outlined {
    font-size: 28px;
    color: var(--color-primary, #2196F3);
}

.info-file-info {
    flex: 1;
    min-width: 0;
}

.info-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary, #212121);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-file-meta {
    font-size: 12px;
    color: var(--color-text-secondary, #666);
    display: flex;
    gap: 8px;
}

/* ===== Empty States ===== */
.info-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: var(--color-text-secondary, #666);
    gap: 12px;
}

.info-empty-state .material-symbols-outlined {
    font-size: 64px;
    opacity: 0.5;
}

.info-empty-state-text {
    font-size: 14px;
}

/* ===== Mobile Responsiveness ===== */
@media (max-width: 768px) {
    .info-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 0;
        height: 100vh;
        z-index: var(--z-modal, 1050);
        border-left: none;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .info-sidebar.active {
        width: 100%;
        max-width: 100vw;
    }

    .info-sidebar-header,
    .info-sidebar-content {
        min-width: 100%;
    }
}

/* ===== Dark Mode Support ===== */
body.dark-mode .info-sidebar {
    background: var(--dm-surface, #1e1e1e);
}

body.dark-mode .info-sidebar-header {
    border-bottom-color: var(--dm-border, #333);
    background: var(--dm-surface, #1e1e1e);
}

body.dark-mode .info-sidebar-close {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .info-sidebar-close:hover {
    background: var(--dm-hover, rgba(255, 255, 255, 0.1));
}

body.dark-mode .info-sidebar-title {
    color: var(--dm-text-primary, #e0e0e0);
}

body.dark-mode .info-header-section {
    border-bottom-color: var(--dm-border, #333);
}

body.dark-mode .info-name {
    color: var(--dm-text-primary, #e0e0e0);
}

body.dark-mode .info-members-count {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .info-tabs {
    border-bottom-color: var(--dm-border, #333);
    background: var(--dm-surface, #1e1e1e);
}

body.dark-mode .info-tab {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .info-tab:hover {
    background: var(--dm-hover, rgba(255, 255, 255, 0.1));
}

body.dark-mode .info-tab.active {
    color: var(--dm-primary, #64B5F6);
}

body.dark-mode .info-tab.active::after {
    background: var(--dm-primary, #64B5F6);
}

body.dark-mode .info-member-item:hover,
body.dark-mode .info-file-item:hover {
    background: var(--dm-hover, rgba(255, 255, 255, 0.1));
}

body.dark-mode .info-member-name,
body.dark-mode .info-file-name {
    color: var(--dm-text-primary, #e0e0e0);
}

body.dark-mode .info-member-role,
body.dark-mode .info-file-meta {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .info-loading,
body.dark-mode .info-empty-state {
    color: var(--dm-text-secondary, #aaa);
}

body.dark-mode .info-media-item {
    background: var(--dm-border, #333);
}

body.dark-mode .info-file-icon {
    background: var(--dm-primary-light, rgba(100, 181, 246, 0.1));
}

body.dark-mode .info-file-icon .material-symbols-outlined {
    color: var(--dm-primary, #64B5F6);
}
