/* public/css/layout.css */

/* ========================================
   ATMOSFERYCZNY UKŁAD 3-STREFOWY (Atmospheric 3-Zone Architecture)
========================================= */
#app-container {
    display: flex;
    height: 100%;
    background: radial-gradient(circle at 15% 15%, rgba(167, 139, 250, 0.07), transparent 45%),
                radial-gradient(circle at 85% 85%, rgba(244, 114, 182, 0.05), transparent 45%),
                var(--app-bg);
}

#mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(16, 14, 25, 0.65); backdrop-filter: blur(8px); z-index: var(--z-overlay);
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
#mobile-menu-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

/* Dolna nawigacja jest dostępna wyłącznie w układzie mobilnym. */
#nav-rail {
    display: none;
}


/* --- STREFA 1: JEDNOLITY PANEL LEWY (Left Unified Sidebar) --- */
/* --- STREFA 1: JEDNOLITY PANEL LEWY (Left Unified Sidebar) --- */
#chat-list-panel {
    width: 300px;
    flex-shrink: 0;
    background-color: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.75rem 0 0.5rem 0;
    overflow: hidden;
}

/* Mini-Karta Mojego Profilu */
.my-profile-mini-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.85rem;
}

.user-profile-avatar-btn {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

#my-profile-avatar-nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: transform 0.2s ease;
}

.user-profile-avatar-btn:hover #my-profile-avatar-nav {
    transform: scale(1.06);
}

.online-indicator-dot {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background-color: var(--green-online);
    border: 2px solid var(--secondary-bg);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--green-online);
}

.my-profile-mini-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.my-profile-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-profile-status-badge {
    font-size: 0.74rem;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.sidebar-section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0.85rem;
}

/* Kategoria & Akcje w Panelu */
.sidebar-category {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0 0.85rem;
}

.sidebar-nav-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.85rem;
}

.sidebar-nav-grid .sidebar-action-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    justify-content: flex-start;
    border-radius: 12px;
}

.flex-grow-category {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    margin-top: 0.2rem;
}

.chats-scroll-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding-right: 2px;
}

.category-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-color);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-action-btn:hover {
    background-color: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.3);
    color: var(--accent-color);
    transform: translateX(3px);
}

.sidebar-action-btn.active {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    color: #ffffff;
    box-shadow: 0 6px 18px var(--accent-glow);
}

.stranger-status-btn {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.18), rgba(20, 184, 166, 0.18));
    border-color: rgba(0, 242, 254, 0.42);
    color: var(--accent-color);
}

.stranger-status-btn.connected {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(20, 184, 166, 0.2));
    border-color: rgba(46, 213, 115, 0.48);
    color: var(--green-online);
}

.stranger-status-btn .fa-circle {
    font-size: 0.68rem;
}

.chat-search-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.chat-search-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
    font-size: 0.85rem;
}

#chat-list-search {
    padding-left: 2.5rem;
    border-radius: 12px;
}

/* Stopka Panelu */
.sidebar-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 0 1.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-footer-btn {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--secondary-text);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-footer-btn:hover {
    background-color: rgba(167, 139, 250, 0.15);
    color: var(--accent-color);
}

.sidebar-footer-btn.danger:hover {
    background-color: rgba(248, 113, 113, 0.15);
    color: var(--danger-color);
}


/* --- STREFA 2: GŁÓWNA SCENA ROZMOWY (#main-chat-area) --- */
#main-chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--primary-bg);
    position: relative;
}

/* Karta Powitalna Glass */
.welcome-card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    max-width: 520px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.welcome-icon-glow {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from { transform: scale(1); filter: drop-shadow(0 0 10px var(--accent-glow)); }
    to { transform: scale(1.1); filter: drop-shadow(0 0 24px var(--accent-color)); }
}


/* --- STREFA 3: PRAWY KONTENER SZCZEGÓŁÓW (#chat-details-panel) --- */
#chat-details-panel {
    width: 320px;
    flex-shrink: 0;
    background-color: var(--secondary-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: width 0.3s ease, transform 0.3s ease;
}
#chat-details-panel.hidden,
#right-widgets-sidebar.hidden {
    display: none !important;
}

/* --- Global Online Count --- */
.global-online-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 0.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

/* --- SEKCJA OSTATNICH ROZMÓWCÓW (OSTATNI OBCY) --- */
.recent-strangers-section {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    margin-top: 0.5rem;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.recent-strangers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.recent-strangers-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-strangers-header h3 i {
    color: var(--accent-color);
}

.recent-strangers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 6px;
    scroll-behavior: smooth;
}

.empty-recent-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 16px 0;
}

.recent-stranger-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.recent-stranger-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-color);
}

.recent-stranger-card.is-friend {
    cursor: pointer;
}

.recent-stranger-card.is-friend:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-color: var(--accent-color);
}

.recent-stranger-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.recent-stranger-avatar, .minifeed-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.recent-stranger-avatar img, .minifeed-avatar img {
    width: 100%;
    height: 100%;
    max-width: 40px;
    max-height: 40px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.recent-stranger-details, .minifeed-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    overflow: hidden;
}

.recent-stranger-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-stranger-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recent-stranger-actions {
    flex-shrink: 0;
    margin-left: 8px;
}

.add-recent-friend-btn {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.add-recent-friend-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}

.recent-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.recent-badge.pending {
    background-color: rgba(255, 193, 7, 0.15);
    color: #e6a100;
}

.recent-badge.friend {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}
