/**
 * Sakura Engine v5 - Floating Windows Styles
 */

/* Base Window */
.floating-window {
    position: fixed;
    background: var(--surface, #1e1e1e);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.floating-window:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.floating-window.dragging,
.floating-window.resizing {
    transition: none;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--primary, #BB86FC);
}

.floating-window.minimized {
    height: auto !important;
}

.floating-window.minimized .fw-content,
.floating-window.minimized .fw-resize {
    display: none;
}

/* Header */
.fw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.fw-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fw-title svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.fw-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.fw-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.fw-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.fw-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Content */
.fw-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    container-type: inline-size;
    container-name: fw;
}

/* Resize Handle */
.fw-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: se-resize;
}

.fw-resize::before {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.15);
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.floating-window:hover .fw-resize::before {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Loading Spinner */
.fp-loading,
.chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary, #BB86FC);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================== */
/* Friends Panel Styles  */
/* ===================== */

.friends-panel .fw-content {
    padding: 0;
}

.fp-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.fp-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #aaa);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fp-tab:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.03);
}

.fp-tab.active {
    color: var(--primary, #BB86FC);
    background: rgba(var(--primary-rgb, 187, 134, 252), 0.1);
}

.fp-tab .badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.fp-search {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.fp-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary, #fff);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.fp-search-input:focus {
    border-color: var(--primary, #BB86FC);
}

.fp-search-input::placeholder {
    color: var(--text-secondary, #666);
}

.fp-content {
    flex: 1;
    overflow-y: auto;
}

.fp-tab-content {
    display: none;
}

.fp-tab-content.active {
    display: block;
}

.fp-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, #666);
    font-size: 13px;
}

/* User Item */
.fp-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.fp-user:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

.fp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fp-avatar.online::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid var(--surface, #1e1e1e);
    border-radius: 50%;
}

.fp-user-info {
    flex: 1;
    min-width: 0;
}

.fp-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-user-status {
    font-size: 11px;
    color: var(--text-secondary, #666);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-user-status .status-watching {
    color: var(--primary, #BB86FC);
}

.fp-chat-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(var(--primary-rgb, 187, 134, 252), 0.1);
    border-radius: 8px;
    color: var(--primary, #BB86FC);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.fp-chat-btn:hover {
    background: var(--primary, #BB86FC);
    color: white;
}

.fp-call-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 8px;
    color: #4CAF50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.fp-call-btn:hover {
    background: #4CAF50;
    color: white;
}

.fp-add-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    color: #22c55e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.fp-add-btn:hover {
    background: #22c55e;
    color: white;
}

/* Request Actions */
.fp-request-actions {
    display: flex;
    gap: 4px;
}

.fp-accept-btn,
.fp-decline-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.fp-accept-btn {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.fp-accept-btn:hover {
    background: #22c55e;
    color: white;
}

.fp-decline-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.fp-decline-btn:hover {
    background: #ef4444;
    color: white;
}

/* ===================== */
/* Chat Window Styles    */
/* ===================== */

.chat-window .fw-content {
    display: flex;
    flex-direction: column;
}

.chat-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.chat-status.online {
    background: #22c55e;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #666);
    font-size: 13px;
}

.chat-message {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
    animation: messageSlide 0.2s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    align-self: flex-end;
    background: var(--primary, #BB86FC);
    color: white;
}

.chat-message-content {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

/* Chat Input */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 100px;
    transition: border-color 0.15s ease;
}

.chat-input:focus {
    border-color: var(--primary, #BB86FC);
}

.chat-input::placeholder {
    color: var(--text-secondary, #666);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary, #BB86FC);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--primary-hover, #a855f7);
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* File Input */
.chat-file-input {
    display: none;
}

.chat-attach-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--text-secondary, #888);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.chat-attach-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

/* File Preview */
.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(var(--primary-rgb, 187, 134, 252), 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: var(--primary, #BB86FC);
}

.chat-file-preview .preview-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-file-preview .preview-remove {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #888);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
}

.chat-file-preview .preview-remove:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ef4444;
}

/* Message Content */
.chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message-image {
    margin-bottom: 4px;
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.chat-message-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.chat-message-image img:hover {
    opacity: 0.9;
}

.chat-message-video {
    margin-bottom: 4px;
    max-width: 240px;
    border-radius: 8px;
    overflow: hidden;
}

.chat-message-video video {
    width: 100%;
    height: auto;
    display: block;
}

.chat-message-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 4px;
    transition: background 0.15s ease;
}

.chat-message-file:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-message-file svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.chat-message-file .file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-message-file .file-name {
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-file .file-size {
    font-size: 10px;
    opacity: 0.6;
}

/* Custom Audio Player */
.chat-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 4px;
    min-width: 200px;
}

.chat-audio-player audio {
    display: none;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary, #BB86FC);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.audio-play-btn:hover {
    transform: scale(1.05);
    background: var(--primary-hover, #a855f7);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.audio-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.audio-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary, #BB86FC);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.audio-time {
    font-size: 11px;
    color: var(--text-secondary, #888);
    min-width: 32px;
    text-align: right;
}

.audio-download {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #888);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.audio-download:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

/* Audio player in own message */
.chat-message.own .chat-audio-player {
    background: rgba(0, 0, 0, 0.15);
}

.chat-message.own .audio-progress {
    background: rgba(255, 255, 255, 0.2);
}

.chat-message.own .audio-progress-bar {
    background: white;
}

.chat-message.own .audio-play-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary, #BB86FC);
}

.chat-message.own .audio-play-btn:hover {
    background: white;
}

.chat-message.own .audio-download {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.chat-message.own .audio-download:hover {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}

/* Scrollbar */
.fp-content::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.fp-content::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.fp-content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.fp-content::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat header with subtitle */
.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.chat-header-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-subtitle {
    font-size: 11px;
    color: var(--primary, #BB86FC);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
}

/* Info button */
.fp-info-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(76, 175, 80, 0.15);
    border-radius: 8px;
    color: #4CAF50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.fp-info-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

/* Remove friend button */
.fp-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-hint, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fp-remove-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* User Card Window */
.user-card-window .fw-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uc-title-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.uc-loading,
.uc-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary, #888);
}

.uc-header {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.uc-avatar {
    position: relative;
    flex-shrink: 0;
}

.uc-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.uc-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #4ade80;
    border: 3px solid var(--surface, #1a1a1a);
    border-radius: 50%;
}

.uc-info {
    flex: 1;
    min-width: 0;
}

.uc-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.uc-status {
    font-size: 13px;
    color: var(--text-secondary, #888);
    margin-bottom: 8px;
}

.uc-watching {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--primary, #BB86FC);
    padding: 6px 10px;
    background: rgba(187, 134, 252, 0.1);
    border-radius: 8px;
}

.uc-watching svg {
    flex-shrink: 0;
}

.uc-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.uc-tab {
    flex: 1;
    padding: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #888);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.uc-tab:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.03);
}

.uc-tab.active {
    color: var(--primary, #BB86FC);
    border-bottom-color: var(--primary, #BB86FC);
}

.uc-content {
    flex: 1;
    overflow: hidden;
}

.uc-tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.uc-tab-content.active {
    display: block;
}

.uc-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary, #888);
    font-size: 13px;
}

.uc-anime-list {
    padding: 8px;
}

.uc-anime-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.uc-anime-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.uc-anime-item img {
    width: 40px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.uc-anime-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.uc-anime-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uc-anime-ep {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-top: 4px;
}

.uc-actions {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.uc-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.uc-btn__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Компактный режим карточки друга: при узком окне скрываем подписи кнопок */
@container fw (max-width: 280px) {
    .uc-actions .uc-btn__label {
        display: none;
    }
    .uc-actions .uc-btn {
        flex: 1 1 auto;
        min-width: 36px;
        padding: 10px;
    }
}

.uc-btn-chat {
    background: var(--primary, #BB86FC);
    color: #000;
}

.uc-btn-chat:hover {
    background: var(--primary-light, #d4b3ff);
}

.uc-btn-stats {
    background: rgba(3, 218, 198, 0.1);
    color: var(--secondary, #03DAC6);
}

.uc-btn-stats:hover {
    background: rgba(3, 218, 198, 0.2);
}

/* Watch Party Invite Card */
.wp-invite-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.15), rgba(3, 218, 198, 0.1));
    border: 1px solid rgba(187, 134, 252, 0.3);
    border-radius: 12px;
    max-width: 280px;
}

.wp-invite-poster {
    width: 60px;
    height: 85px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.wp-invite-info {
    flex: 1;
    min-width: 0;
}

.wp-invite-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--primary, #BB86FC);
    font-weight: 500;
    margin-bottom: 6px;
}

.wp-invite-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wp-invite-episode {
    font-size: 12px;
    color: var(--text-secondary, #888);
    margin-bottom: 10px;
}

.wp-invite-join {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.chat-message.own .wp-invite-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-message.own .wp-invite-label {
    color: rgba(0, 0, 0, 0.7);
}

.chat-message.own .wp-invite-join {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

/* Watch Party Invite Notification */
.wp-invite-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    background: var(--surface, #1e1e1e);
    border: 1px solid rgba(187, 134, 252, 0.3);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    transform: translateY(120%) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wp-invite-notification.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.wp-invite-notification__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.wp-invite-notification__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.wp-invite-notification__poster {
    width: 70px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.wp-invite-notification__content {
    flex: 1;
    min-width: 0;
}

.wp-invite-notification__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--primary, #BB86FC);
    font-weight: 500;
    margin-bottom: 6px;
}

.wp-invite-notification__title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wp-invite-notification__meta {
    font-size: 12px;
    color: var(--text-secondary, #888);
    margin-bottom: 12px;
}

.wp-invite-notification__actions {
    display: flex;
    gap: 8px;
}

.wp-invite-notification__actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .floating-window {
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        left: 10px !important;
        right: 10px !important;
    }
    
    .wp-invite-notification {
        width: calc(100vw - 40px);
        left: 20px;
        right: 20px;
    }
}

/* Voice call modal (incoming / calling / active) */
.voice-call-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.voice-call-modal.visible {
    opacity: 1;
    visibility: visible;
}
.voice-call-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}
.voice-call-modal__box {
    position: relative;
    background: var(--surface, #1e1e1e);
    border-radius: 16px;
    padding: 28px;
    min-width: 280px;
    max-width: 340px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.voice-call-minimize {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #999);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.voice-call-minimize:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary, #fff);
}
.voice-call-modal__box:has(#voice-call-calling.active) .voice-call-minimize,
.voice-call-modal__box:has(#voice-call-active.active) .voice-call-minimize {
    display: flex;
}
.voice-call-modal__state {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    width: 100%;
}
.voice-call-modal__state.active {
    display: flex;
}
.voice-call-modal__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--surface-variant, #2a2a2a);
    background-size: cover;
    background-position: center;
    margin-bottom: 12px;
    position: relative;
}
.voice-call-modal__avatar-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-secondary, #999);
    background: var(--surface-variant, #2a2a2a);
    border-radius: 50%;
}
.voice-call-modal__avatar--placeholder .voice-call-modal__avatar-placeholder {
    display: flex;
}
.voice-call-modal__avatar:not(.voice-call-modal__avatar--placeholder) .voice-call-modal__avatar-placeholder {
    display: none;
}
.voice-call-modal__avatar--pulse {
    animation: voice-call-pulse 1.5s ease-in-out infinite;
}
@keyframes voice-call-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 187, 134, 252), 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(var(--primary-rgb, 187, 134, 252), 0); }
}
.voice-call-modal__title {
    font-size: 14px;
    color: var(--text-secondary, #999);
    margin-bottom: 4px;
}
.voice-call-modal__name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 20px;
}
.voice-call-modal__duration {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #fff);
    margin-bottom: 16px;
}
.voice-call-modal__active-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.voice-call-modal .voice-call-mute {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.voice-call-modal .voice-call-mute--active {
    background: var(--error, #cf6679);
    color: white;
    border-color: var(--error, #cf6679);
}
.voice-call-modal .voice-call-mute .voice-call-mute-label {
    font-size: 12px;
}
.voice-call-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    min-width: 0;
}
.voice-call-modal__actions .btn {
    flex: 0 0 auto;
}
.voice-call-modal .voice-call-reject,
.voice-call-modal .voice-call-cancel {
    color: var(--text-secondary, #999);
}
.voice-call-modal .voice-call-accept {
    background: #4CAF50;
    color: white;
}
.voice-call-modal .voice-call-accept:hover {
    background: #43A047;
}
.voice-call-modal .voice-call-end {
    background: var(--error, #cf6679);
    color: white;
}

/* Свёрнутое окно вызова */
.voice-call-modal.minimized {
    pointer-events: none;
}
.voice-call-modal.minimized .voice-call-modal__backdrop {
    display: none;
}
.voice-call-modal.minimized .voice-call-modal__box {
    display: none;
}
.voice-call-minimized-bar {
    display: none;
    pointer-events: auto;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--surface, #1e1e1e);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.voice-call-modal.minimized .voice-call-minimized-bar {
    display: flex;
}
.voice-call-minimized-bar__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.voice-call-minimized-bar__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.voice-call-minimized-bar__duration {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary, #999);
}
.voice-call-minimized-bar__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.voice-call-minimized-bar .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}
