/* public/css/panels.css */

/* ========================================
   AI MOCKUP DESIGN SYSTEM - PANELS & WIDGETS
========================================= */

/* Cyan Neon Active State for Navigation */
.sidebar-action-btn.active {
    background: linear-gradient(135deg, #00f2fe, #14b8a6);
    color: #08101e;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
    border: 1px solid transparent;
}

.sidebar-nav-grid .sidebar-action-btn {
    box-sizing: border-box;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-nav-grid .sidebar-action-btn:active {
    transform: none;
}

.nav-unread-badge {
    margin-left: auto;
    background: var(--cyan-gradient);
    color: #08101e;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 242, 254, 0.4);
}

/* Pigułki filtrów czatów (Moje Czaty) */
.chat-filter-pills {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.4rem;
    margin-bottom: 0.25rem;
}

.filter-pill {
    flex: 1;
    background: var(--input-bg);
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.35rem 0.5rem;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.filter-pill:hover {
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill:active {
    transform: none;
}

.filter-pill.active {
    background: var(--cyan-gradient);
    color: #06101e;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.35);
}

.friends-avatar-row {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.friend-avatar-item {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.friend-avatar-item:hover {
    transform: scale(1.1);
}

.friend-avatar-item img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.friend-activity-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1e1b2e;
    border: 2px solid var(--secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--accent-color);
}

/* Primary Action Cyan Button */
.coral-btn {
    background: var(--cyan-gradient);
    color: #08101e;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.35);
}

.coral-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 242, 254, 0.55);
}

/* ========================================
   HERO SEARCH CARD (Środek Sceny)
========================================= */
.hero-search-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.25rem 2rem 1.75rem 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    margin-bottom: 1.5rem;
    background-image: radial-gradient(circle at 50% 0%, rgba(0, 242, 254, 0.12), transparent 70%);
}

.hero-card-badge {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.25rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.hero-action-btn {
    background: linear-gradient(135deg, #00f2fe, #00c6ff);
    color: #06101e;
    border: none;
    border-radius: 18px;
    padding: 1rem 3rem;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 8px 28px rgba(0, 242, 254, 0.45);
    transition: all 0.25s ease;
    margin-bottom: 1.25rem;
}

.hero-action-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 36px rgba(0, 242, 254, 0.6);
}

.hero-card-meta {
    font-size: 0.95rem;
    color: var(--secondary-text);
}

.hero-card-meta p {
    margin: 4px 0 0 0;
    font-size: 0.88rem;
    opacity: 0.85;
}

/* ========================================
   KAFELKI TEMATYCZNE (2x2 GRID)
========================================= */
.topic-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

/* ========================================
   STREFY TEMATYCZNE (Topic Hub Controls & Tiles)
========================================= */
.topic-hub-header {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.topic-hub-title-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.topic-hub-title-row h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.topic-hub-subtitle {
    font-size: 0.88rem;
    color: var(--secondary-text);
}

.topic-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.topic-search-box {
    position: relative;
    width: 100%;
}

.topic-search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
}

.topic-search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.6rem;
    border-radius: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.topic-search-box input:focus {
    border-color: var(--accent-color);
}

.zone-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.zone-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.zone-pill.active, .zone-pill:hover {
    background: linear-gradient(135deg, #00f2fe, #00c6ff);
    color: #06101e;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.25);
}

.zone-pill:active {
    transform: none;
}

/* Kafelki Tematyczne (Cards) */
.topic-tile {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.topic-tile:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.tile-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-online-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--secondary-text, #a0a5b5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.topic-online-badge.has-users {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-color, #00f2fe);
    border-color: rgba(0, 242, 254, 0.35);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* --- BANER KANAŁU KOMUNIKACJI W CZACIE --- */
.chat-channel-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
}

.chat-channel-topic-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-color);
}

/* --- KARTA WYSZUKIWANIA W STREFIE TEMATYCZNEJ (Category Searching Lobby) --- */
.category-waiting-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 25px rgba(0, 242, 254, 0.1);
    position: relative;
    overflow: hidden;
}

.category-radar-wrapper {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-radar-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    animation: radarPulse 1.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes radarPulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.category-radar-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #00f2fe, #00c6ff);
    color: #06101e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
    z-index: 1;
}

.category-waiting-text h3 {
    margin: 0 0 6px 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-color);
}

.category-waiting-text p {
    margin: 8px 0 0 0;
    font-size: 0.9rem;
    color: var(--secondary-text);
}

.danger-cancel-btn {
    background: linear-gradient(135deg, #ff4757, #ff6b81) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.3) !important;
    border-radius: 14px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.danger-cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 71, 87, 0.4) !important;
}

.tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
    flex-shrink: 0;
}

.tile-blue .tile-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.tile-pink .tile-icon { background: linear-gradient(135deg, #ec4899, #be185d); }
.tile-purple .tile-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.tile-amber .tile-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tile-emerald .tile-icon { background: linear-gradient(135deg, #10b981, #047857); }
.tile-coral .tile-icon { background: linear-gradient(135deg, #ff4757, #ff6b81); }

.tile-content h3 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.tile-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.tile-subtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tile-subtags span {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
}

/* Icebreaker Banner w czacie */
.chat-icebreaker-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0 1rem 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.12), rgba(167, 139, 250, 0.12));
    border: 1px solid rgba(0, 242, 254, 0.25);
    backdrop-filter: blur(12px);
}

.icebreaker-icon {
    font-size: 1.3rem;
    color: #f59e0b;
    flex-shrink: 0;
}

.icebreaker-body {
    flex-grow: 1;
}

.icebreaker-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-color);
    margin-bottom: 2px;
}

.icebreaker-text {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ========================================
   PRAWA KOLUMNA WIDGETÓW (Right Sidebar)
========================================= */
#right-widgets-sidebar {
    width: 320px;
    flex-shrink: 0;
    background-color: var(--secondary-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem 1.25rem 1.5rem 1.25rem;
    gap: 1.25rem;
    overflow-y: auto;
}

.right-sidebar-footer {
    margin-top: auto;
    padding-top: 0.25rem;
}

.issue-report-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem;
    color: var(--text-color);
    background: rgba(var(--accent-color-rgb), 0.08);
    border: 1px solid rgba(var(--accent-color-rgb), 0.22);
    border-radius: 16px;
    text-align: left;
    white-space: normal;
}

.issue-report-btn:hover {
    color: var(--text-color);
    background: rgba(var(--accent-color-rgb), 0.15);
    border-color: rgba(var(--accent-color-rgb), 0.5);
    transform: translateY(-1px);
}

.issue-report-btn-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    color: #06101e;
    background: var(--cyan-gradient);
    border-radius: 12px;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.issue-report-btn-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    line-height: 1.25;
}

.issue-report-btn-copy strong { font-size: 0.88rem; }
.issue-report-btn-copy small { color: var(--secondary-text); font-size: 0.72rem; }
.issue-report-btn > .fa-chevron-right { color: var(--secondary-text); font-size: 0.75rem; }

.widgets-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.widgets-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.header-bell-btn {
    position: relative;
    background: var(--input-bg);
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.widget-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.widget-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Widget: Teraz Aktywni */
.active-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.active-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.active-user-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

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

.active-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.active-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color);
}

.active-user-status {
    font-size: 0.76rem;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Widget: Dodaj Znajomego Kod */
.friend-code-widget-box {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.code-display-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--input-bg);
    padding: 0.5rem 0.85rem;
    border-radius: 12px;
    font-size: 0.88rem;
}

.add-code-input-row {
    display: flex;
    gap: 0.5rem;
}

.add-code-input-row input {
    flex-grow: 1;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
}

.add-code-input-row button {
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
}

.widget-helper-text {
    font-size: 0.76rem;
    color: var(--secondary-text);
    font-style: italic;
}

.pending-requests-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.requests-badge-count {
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.35);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}
#add-friend-code-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
}
#add-friend-by-code-btn {
    padding: 0.6rem 1.25rem;
    font-weight: 700;
    font-size: 0.88rem;
}


#friends-list-container, #groups-list-container {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
#friend-requests-container {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

#friend-requests-list, #friends-list, #groups-list {
    list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem;
}
.no-requests, .no-friends {
    color: var(--secondary-text);
    font-style: italic; font-size: 0.9rem; padding: 0.5rem; text-align: center;
}
/* Styl dla itemów na liście znajomych i grup */
.chat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    min-height: 58px;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}
.chat-item:hover {
    background-color: rgba(var(--accent-color-rgb), 0.1);
}
.chat-item.active {
    background-color: rgba(var(--accent-color-rgb), 0.2);
}
.avatar-container { position: relative; flex-shrink: 0; }
.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.friend-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--grey-offline);
    border: 2px solid var(--secondary-bg); /* Tło panelu */
}
.friend-status.online { background-color: var(--green-online); }
.chat-item-details {
    flex-grow: 1;
    overflow: hidden;
}
.friend-name {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}
.friend-last-message {
    display: block;
    font-size: 0.85rem;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.friend-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
body.light-mode .friend-request-item:hover { background-color: rgba(0,0,0,0.03); }
body.dark-mode .friend-request-item:hover { background-color: rgba(255,255,255,0.06); }

.friend-request-item .chat-avatar { width: 32px; height: 32px; flex-shrink: 0; }
.friend-request-section-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.2rem 0.15rem;
    color: var(--secondary-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.friend-request-section-label i { color: var(--accent-color); }
.request-name { 
    flex: 1 1 auto; 
    font-size: 0.85rem; 
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Nowe style dla przycisków zaproszeń */
.request-buttons { display: flex; gap: 0.25rem; flex-shrink: 0; }
.request-buttons .icon-btn {
    width: 28px; height: 28px; font-size: 0.8rem; padding: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.request-buttons .accept-btn {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.4);
}
.request-buttons .accept-btn:hover {
    background: #2ed573;
    color: #000;
}
.request-buttons .decline-btn {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.4);
}
.request-buttons .decline-btn:hover {
    background: #ff4757;
    color: #fff;
}
.sent-request-status {
    color: var(--warning-color);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.request-buttons .cancel-sent-request-btn {
    background: rgba(255, 71, 87, 0.14);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.35);
}
.request-buttons .cancel-sent-request-btn:hover {
    background: #ff4757;
    color: #fff;
}

/* --- ZAWARTOŚĆ Panelu 3 (Main Chat) --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 60px;
    gap: 0.5rem;
    overflow: hidden;
}
#menu-toggle-btn { display: none; }

#chat-partner-info {
    display: flex; 
    align-items: center; 
    gap: 0.6rem; 
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.chat-partner-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-partner-details { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-partner-name { 
    font-weight: 600; 
    font-size: 1.05rem; 
    color: var(--text-color); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.chat-header-topic-badge {
    background: rgba(0, 242, 254, 0.12);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.35);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}
.chat-partner-status { 
    font-size: 0.75rem; 
    color: var(--secondary-text); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.chat-partner-status.online { color: var(--green-online); }
.navbar-icons { 
    display: flex; 
    align-items: center; 
    gap: 0.4rem; 
    margin-left: auto; 
    flex-shrink: 0; 
    white-space: nowrap;
}

#voice-chat-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

#voice-status {
    font-size: 0.8rem;
    color: var(--secondary-text);
    font-style: italic;
    white-space: nowrap;
    text-align: left;
}
.online-counter {
    display: flex; align-items: center; font-size: 0.9rem;
    color: var(--secondary-text); margin-right: 1rem;
}
.online-dot { color: var(--green-online); font-size: 1.2rem; margin-right: 0.3rem; line-height: 1; }
#stranger-user-count { font-weight: 600; margin-left: 0.2rem; } /* Zaktualizowany ID */
#mobile-notification-btn { display: none; }

/* Główne Widoki (Welcome, Search, Chat) */
#main-content-wrapper { flex-grow: 1; position: relative; overflow-y: hidden; display: flex; }
.main-content-view { width: 100%; height: 100%; padding: 2rem; overflow-y: auto; }
.main-content-view.hidden { display: none; }

#welcome-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    color: var(--secondary-text);
    padding: 2.5rem 2rem 3rem 2rem;
    width: 100%;
}

#welcome-view > * {
    max-width: 860px;
    width: 100%;
}

#stranger-search-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--secondary-text);
}

#welcome-view h1 {
    color: var(--text-color);
    font-size: 2rem;
    background: linear-gradient(135deg, var(--text-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

#stranger-search-view h2 {
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--text-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#search-controls {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: center;
    width: 100%;
    max-width: 720px;
}

.preferences {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.preference-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 160px;
}

.preference-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preference-group select {
    background-color: var(--input-bg);
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
}

.unregistered-match-option {
    flex: 1 1 100%;
    min-width: 100%;
    align-items: center;
}

.preference-checkbox {
    width: min(100%, 620px);
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.preference-checkbox:hover {
    border-color: var(--accent-color);
    background: var(--accent-glow);
}

.preference-checkbox input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    accent-color: var(--accent-color);
}

.preference-checkbox span {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    width: max-content;
    max-width: calc(100% - 2.05rem);
}

.preference-checkbox strong {
    color: var(--text-color);
    font-size: 0.9rem;
    text-align: left;
}

.preference-checkbox small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: left;
}

.chat-controls {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

#findBtn {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    color: white;
    padding: 0.85rem 2.5rem;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: all 0.25s ease;
}

#findBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(167, 139, 250, 0.4);
}

#stopBtn {
    border-radius: 14px;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
}

#status-bar {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: var(--secondary-text);
    font-style: normal;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Widok Czatu */
#chat-view { display: flex; flex-direction: column; height: 100%; padding: 0; }
.partner-interests {
    padding: 0.5rem 1.5rem; flex-shrink: 0; font-size: 0.85rem;
    color: var(--secondary-text); border-bottom: 1px dashed var(--border-color); text-align: center;
}
.partner-interests strong { margin-right: 0.5em; }
.interest-tag {
    display: inline-block; background-color: var(--input-bg); padding: 0.1rem 0.5rem;
    border-radius: 10px; margin: 0 0.2rem 0.2rem 0; font-size: 0.8rem;
}

/* Stopka Czatu */
#message-input-area {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background: transparent;
    position: relative;
    z-index: var(--z-sticky);
}

/* ZAKTUALIZOWANE Style podglądu mediów i przycisku X */
.media-preview {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}

.staged-media-wrapper {
    position: relative;
    flex-shrink: 0;
}

.staged-media-image {
    height: 70px;
    width: 70px;
    object-fit: cover;
    border-radius: 8px;
}

/* NOWE Style dla przycisku usunięcia podglądu */
.media-preview-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

/* Dostosowanie dla trybu ciemnego */
body.dark-mode .media-preview {
    background-color: var(--input-bg-dark);
    border-color: var(--border-color-dark);
}
body.dark-mode .media-preview-remove {
     background-color: rgba(var(--accent-color-rgb), 0.7);
}
body.dark-mode .media-preview-remove:hover {
     background-color: rgba(var(--accent-color-rgb), 0.9);
}
/* KONIEC ZAKTUALIZOWANYCH STYLÓW */


.input-controls-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.65rem;
    background-color: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 0.6rem 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-controls-wrapper:focus-within {
    border-color: rgba(0, 242, 254, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 14px var(--accent-glow);
}
#msgInput {
    flex-grow: 1; border: none; background: transparent; outline: none;
    color: var(--text-color); font-size: 0.95rem; padding: 0.5rem;
}
#msgInput:disabled { opacity: 0.5; }
#sendBtn {
    background: var(--cyan-gradient);
    color: #08101e;
    font-weight: 800;
    font-size: 0.92rem;
    padding: 0.55rem 1.35rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.35);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
#sendBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 242, 254, 0.55);
}
#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* --- ZAWARTOŚĆ Panelu 4 (Chat Details) --- */
.chat-details-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; min-height: 69px;
}
.chat-details-header h3 { margin-bottom: 0; }
.chat-details-content { padding: 1.5rem; overflow-y: auto; flex-grow: 1; }
.details-section { margin-bottom: 1.5rem; }
.details-section h5 { margin-bottom: 0.75rem; }
#details-avatar {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    display: block; margin: 0 auto 1rem auto;
}
#details-username { text-align: center; color: var(--text-color); margin-bottom: 0.25rem; font-size: 1.1rem; }
#details-status { text-align: center; font-size: 0.9rem; margin-bottom: 1.5rem; }
#details-status.online { color: var(--green-online); }
#details-status.offline { color: var(--secondary-text); }
#details-info-list { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
#details-info-list li {
    display: flex; justify-content: space-between; padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color); color: var(--secondary-text);
}
#details-info-list li:last-child { border-bottom: none; }
#details-info-list li span { font-weight: 500; color: var(--text-color); text-transform: capitalize; }
#details-interests-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
#details-interests-list .interest-tag {
    background-color: var(--input-bg); border: 1px solid var(--border-color); padding: 0.2rem 0.6rem;
}
#details-remove-friend-btn { width: 100%; margin-top: 1rem; }
#details-background-options {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 0.75rem;
}
.details-bg-option {
    height: 50px; border-width: 2px; font-size: 0; align-items: flex-end; justify-content: flex-end;
}
.details-bg-option.selected::after {
    content: '✓'; font-size: 1rem; color: var(--accent-color); padding: 0.2rem; line-height: 1;
}

/* NOWE Style dla sekcji mediów */
#details-media-section h5 {
    margin-bottom: 0.75rem;
}

#details-media-grid {
    display: grid;
    /* Utwórz siatkę z 3 kolumnami o równej szerokości */
    grid-template-columns: repeat(3, 1fr);
    gap: 5px; /* Mały odstęp między miniaturkami */
    max-height: 300px; /* Ogranicz wysokość, dodaj scroll */
    overflow-y: auto;
    padding-bottom: 5px; /* Odstęp na dole dla scrollbara */
}

.media-thumbnail {
    width: 100%;
    /* Utrzymaj kwadratowy kształt */
    aspect-ratio: 1 / 1;
    background-color: var(--input-bg); /* Tło na czas ładowania */
    border-radius: 6px;
    overflow: hidden; /* Ukryj wystające części obrazka */
    cursor: pointer;
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

.media-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.media-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Wypełnij miniaturkę, przycinając */
}

/* Komunikat, gdy brak mediów */
#details-media-grid:empty::after {
    content: "Brak udostępnionych mediów.";
    grid-column: 1 / -1; /* Rozciągnij na wszystkie kolumny */
    text-align: center;
    font-size: 0.85rem;
    color: var(--secondary-text);
    font-style: italic;
    padding: 1rem 0;
}

/* --- Style dla zwijanych sekcji w panelu szczegółów --- */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.75rem;
}

.collapsible-header:hover {
    color: var(--text-color);
}

.collapsible-chevron {
    font-size: 0.8rem;
    transition: transform 0.2s ease-in-out;
}

/* TA REGUŁA OBRACA STRZAŁKĘ (TĘ MASZ, BO WIDAĆ ►) */
.collapsible-header.collapsed .collapsible-chevron {
    transform: rotate(-90deg);
}

/* TA REGUŁA UKRYWA TREŚĆ (UŻYWAJĄC ID DLA WYGRANIA WALKI O SPECYFICZNOŚĆ) */
#details-media-grid.collapsed {
    display: none;
}

#details-background-options.collapsed {
    display: none;
}
