/**
 * Single Match Page Styles
 *
 * @package AylakSpor
 */

/* ==========================================================================
   Match Page Container
   ========================================================================== */
.as-match-page {
    position: relative;
    background: linear-gradient(180deg, var(--as-bg-darker) 0%, var(--as-bg-dark) 100%);
    min-height: calc(100vh - 80px);
}

/* ==========================================================================
   Side Banners (Left & Right - Fixed Position)
   ========================================================================== */
.as-side-banner {
    position: fixed;
    top: 100px;
    width: 210px;
    z-index: 10;
    /* Lower z-index so it doesn't overlap player/content */
    pointer-events: auto;
}

.as-side-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.as-side-banner-left {
    left: 10px;
}

.as-side-banner-right {
    right: 10px;
}

/* Hide side banners below 1500px */
@media (max-width: 1500px) {
    .as-side-banner {
        display: none;
    }
}

/* ==========================================================================
   Main Content Wrapper
   ========================================================================== */
.as-match-content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Top Banners
   ========================================================================== */
.as-top-banner {
    margin-bottom: 15px;
    text-align: center;
}

.as-top-banner img,
.as-bottom-banner img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: block;
    /* Removes bottom space */
}

.as-top-banner-2 {
    margin-bottom: 20px;
}

/* Text Banner Style */
.as-top-banner-text {
    margin-bottom: 20px;
}

.as-top-banner-text a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
    background: rgba(30, 41, 59, 0.95);
    /* Dark background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    /* Slightly more rounded */
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    padding: 15px 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.as-top-banner-text a:hover {
    background: var(--as-primary);
    /* Use primary color on hover */
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--as-primary);
}

/* ==========================================================================
   Player Container (Full Width - Sidebar Removed)
   ========================================================================== */
.as-player-sidebar-container {
    display: block;
    /* No grid needed, single column */
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .as-player-sidebar-container {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Player Section
   ========================================================================== */
.as-player-section {
    width: 100%;
}

.as-player-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.as-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.as-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
}

/* Force iframe to fill container */
.as-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Player Placeholder */
.as-player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.as-placeholder-content {
    text-align: center;
    color: #fff;
}

.as-placeholder-content svg {
    color: var(--as-primary, #3b82f6);
    margin-bottom: 20px;
    opacity: 0.8;
}

.as-placeholder-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.as-placeholder-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Player Controls Bar */
.as-player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.as-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.as-live-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.as-match-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.as-player-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.as-player-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.as-player-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--as-primary, #3b82f6);
}

.as-player-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Match Sidebar (Right Panel)
   ========================================================================== */
.as-match-sidebar {
    background: var(--as-card-bg, #1e1e2e);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: fit-content;
}

.as-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.as-sidebar-tab {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.as-sidebar-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.as-sidebar-tab.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid var(--as-primary, #3b82f6);
}

.as-sidebar-search {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.as-sidebar-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
}

.as-sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.as-sidebar-search input:focus {
    outline: none;
    border-color: var(--as-primary, #3b82f6);
}

.as-sidebar-content {
    max-height: 400px;
    overflow-y: auto;
}

.as-sidebar-tab-content {
    display: none;
    padding: 10px;
}

.as-sidebar-tab-content.active {
    display: block;
}

.as-sidebar-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.as-sidebar-match:hover {
    background: rgba(255, 255, 255, 0.08);
}

.as-match-teams {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.as-match-live-dot {
    color: #ef4444;
    font-size: 10px;
    animation: pulse-live 2s infinite;
}

.as-no-matches {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

/* ==========================================================================
   Bottom Banner
   ========================================================================== */
.as-bottom-banner {
    margin: 20px 0;
    text-align: center;
}

.as-bottom-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Match Details Section
   ========================================================================== */
.as-match-details-section {
    margin-top: 20px;
}

.as-match-tabs-section {
    background: var(--as-card-bg, #1e1e2e);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.as-match-tabs-nav {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.as-match-tab {
    flex: 1;
    padding: 18px 25px;
    background: transparent;
    border: none;
    color: var(--as-text-muted, rgba(255, 255, 255, 0.5));
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 3px solid transparent;
}

.as-match-tab:hover {
    color: var(--as-text, #fff);
    background: rgba(255, 255, 255, 0.02);
}

.as-match-tab.active {
    color: var(--as-primary, #3b82f6);
    border-bottom-color: var(--as-primary, #3b82f6);
    background: rgba(59, 130, 246, 0.05);
}

.as-match-tab-content {
    display: none;
    padding: 30px;
}

.as-match-tab-content.active {
    display: block;
}

/* Match Details */
.as-match-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--as-text-muted, rgba(255, 255, 255, 0.6));
}

.as-match-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.as-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.as-info-label {
    font-weight: 600;
    color: var(--as-text-muted, rgba(255, 255, 255, 0.5));
    font-size: 14px;
}

.as-info-value {
    font-weight: 600;
    color: var(--as-text, #fff);
    font-size: 15px;
}

/* Related Matches */
.as-related-matches {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.as-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--as-text-muted, rgba(255, 255, 255, 0.5));
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .as-match-content-wrapper {
        padding: 15px;
    }

    .as-player-controls {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .as-player-info {
        width: 100%;
        justify-content: center;
    }

    .as-player-actions {
        width: 100%;
        justify-content: center;
    }

    .as-match-tabs-nav {
        flex-direction: column;
    }

    .as-match-tab {
        justify-content: flex-start;
        padding: 15px 20px;
    }

    .as-match-tab-content {
        padding: 20px;
    }

    .as-match-info-grid {
        grid-template-columns: 1fr;
    }

    .as-related-matches {
        grid-template-columns: 1fr;
    }

    .as-sidebar-tabs {
        flex-wrap: wrap;
    }

    .as-sidebar-tab {
        font-size: 10px;
        padding: 10px 6px;
    }
}

/* ==========================================================================
   Cinema Mode
   ========================================================================== */
body.cinema-mode .as-side-banner,
body.cinema-mode .as-top-banner,
body.cinema-mode .as-bottom-banner,
body.cinema-mode .as-match-sidebar,
body.cinema-mode .as-match-details-section,
body.cinema-mode header,
body.cinema-mode footer {
    display: none !important;
}

body.cinema-mode .as-match-page {
    background: #000;
}

body.cinema-mode .as-match-content-wrapper {
    max-width: 100%;
    padding: 0;
}

body.cinema-mode .as-player-sidebar-container {
    grid-template-columns: 1fr;
}

body.cinema-mode .as-player-container {
    border-radius: 0;
    height: 100vh;
}

body.cinema-mode .as-player-wrapper {
    padding-bottom: 0;
    height: calc(100vh - 50px);
}

body.cinema-mode .as-video-player {
    position: relative;
    height: 100%;
}

/* ==========================================================================
   Chat UI - Floating Facebook Style
   ========================================================================== */

/* Wrapper has no dimensions - floating fixed chat escapes it */
.as-chat-wrapper {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    overflow: visible;
    z-index: 9999;
}

/* Floating Container - Fixed to bottom-right */
.kf-chat-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Toggle Button - Visible when chat is closed */
.kf-chat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--as-primary, #3b82f6) 0%, #2563eb 100%);
    border: none;
    border-radius: 30px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

.kf-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
}

.kf-chat-toggle-icon {
    width: 22px;
    height: 22px;
}

.kf-chat-toggle-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    min-width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #1e1e2e;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Chat Box - Hidden by default, shown when is-open */
.kf-chat-floating .kf-chat {
    display: none;
    width: 380px;
    height: 500px;
    margin-bottom: 10px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: chatSlideUp 0.3s ease;
}

.kf-chat-floating.is-open .kf-chat {
    display: flex;
}

.kf-chat-floating.is-open .kf-chat-toggle {
    display: none;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Minimize Button in Header */
.kf-chat-minimize {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s;
}

.kf-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .kf-chat-floating {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .kf-chat-floating .kf-chat {
        width: 100%;
        height: calc(100vh - 120px);
        max-height: 500px;
    }

    .kf-chat-toggle {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* Original Chat Styles (inside floating) */
.kf-chat {
    background: var(--as-card-bg, #1e1e2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kf-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kf-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.kf-chat-title svg {
    color: var(--as-primary, #3b82f6);
}

.kf-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kf-chat-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.kf-online-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: kf-pulse 2s infinite;
}

@keyframes kf-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.kf-online-count {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

/* Chat Messages */
.kf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kf-chat-system {
    text-align: center;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--as-primary, #3b82f6);
}

.kf-chat-system p {
    margin: 0;
}

.kf-chat-error {
    text-align: center;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #ef4444;
}

.kf-chat-error p {
    margin: 0;
}

/* Connection status indicator */
.kf-chat-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 8px;
}

.kf-chat-status.connected {
    color: #22c55e;
}

.kf-chat-status.disconnected {
    color: #ef4444;
}

.kf-chat-status.connecting {
    color: #f59e0b;
}

.kf-chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 85%;
    animation: kf-msg-in 0.2s ease-out;
}

@keyframes kf-msg-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Own messages - align right */
.kf-chat-message.is-own {
    margin-left: auto;
    flex-direction: row-reverse;
}

.kf-chat-message.is-own .kf-chat-bubble {
    background: linear-gradient(135deg, var(--as-primary, #3b82f6) 0%, #2563eb 100%);
    border-radius: 16px 16px 4px 16px;
}

.kf-chat-message.is-own .kf-chat-text {
    color: #fff;
}

.kf-chat-message.is-own .kf-chat-username {
    color: rgba(255, 255, 255, 0.9);
}

.kf-chat-message.is-own .kf-chat-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Mention highlight */
.kf-chat-message.has-mention {
    animation: kf-mention-pulse 0.5s ease-out;
}

@keyframes kf-mention-pulse {

    0%,
    100% {
        background: transparent;
    }

    50% {
        background: rgba(59, 130, 246, 0.15);
    }
}

.kf-chat-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.kf-chat-bubble {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
    border-radius: 16px 16px 16px 4px;
    position: relative;
}

/* Reply indicator */
.kf-chat-reply {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 2px solid var(--as-primary, #3b82f6);
    font-size: 0.75rem;
}

.kf-chat-reply-icon {
    color: var(--as-primary, #3b82f6);
    flex-shrink: 0;
}

.kf-chat-reply-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.kf-chat-reply-user {
    color: var(--as-primary, #3b82f6);
    font-weight: 600;
}

.kf-chat-reply-text {
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kf-chat-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.kf-chat-username {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--as-primary, #3b82f6);
    cursor: pointer;
}

.kf-chat-username:hover {
    text-decoration: underline;
}

.kf-chat-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

.kf-chat-text {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Mention styling in text */
.kf-mention {
    color: var(--as-primary, #3b82f6);
    font-weight: 600;
    cursor: pointer;
}

.kf-mention:hover {
    text-decoration: underline;
}

/* Reply preview bar */
.kf-chat-reply-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--as-primary, #3b82f6);
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.kf-chat-reply-bar.active {
    display: flex;
}

.kf-chat-reply-bar-content {
    flex: 1;
    min-width: 0;
}

.kf-chat-reply-bar-user {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--as-primary, #3b82f6);
}

.kf-chat-reply-bar-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kf-chat-reply-bar-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kf-chat-reply-bar-close:hover {
    color: #fff;
}

/* Message actions (reply button) */
.kf-chat-actions {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    gap: 2px;
}

.kf-chat-bubble:hover .kf-chat-actions {
    display: flex;
}

.kf-chat-action-btn {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    padding: 4px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kf-chat-action-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

/* Chat Input */
.kf-chat-input-wrap {
    padding: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.kf-chat-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kf-chat-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
}

.kf-chat-user-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #ffffff;
}

.kf-chat-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kf-chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kf-chat-emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.kf-chat-emoji-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.kf-chat-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.kf-chat-input:focus {
    border-color: var(--as-primary, #3b82f6);
    background: rgba(255, 255, 255, 0.1);
}

.kf-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.kf-chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--as-primary, #3b82f6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.kf-chat-send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.kf-chat-char-count {
    text-align: right;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    padding-right: 4px;
}

/* Emoji Picker */
.kf-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 12px;
    background: rgba(15, 25, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.kf-emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.kf-emoji {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.kf-emoji:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* ==========================================================================
   Nick Edit Button & Modal
   ========================================================================== */
.kf-chat-edit-nick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.2s;
}

.kf-chat-edit-nick-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--as-primary, #3b82f6);
}

/* Nick Edit Modal */
.kf-nick-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.kf-nick-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.kf-nick-modal-content {
    position: relative;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-width: 380px;
    width: 100%;
    animation: nickModalSlideIn 0.3s ease;
}

@keyframes nickModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kf-nick-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.kf-nick-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.kf-nick-modal-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.kf-nick-modal-desc {
    margin: 0 0 20px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.kf-nick-input-wrap {
    position: relative;
    margin-bottom: 8px;
}

.kf-nick-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.kf-nick-input:focus {
    border-color: var(--as-primary, #3b82f6);
    background: rgba(255, 255, 255, 0.1);
}

.kf-nick-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.kf-nick-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}

.kf-nick-error {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #ef4444;
}

.kf-nick-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.kf-nick-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.kf-nick-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.kf-nick-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.kf-nick-btn-save {
    background: var(--as-primary, #3b82f6);
    color: #fff;
}

.kf-nick-btn-save:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.kf-nick-btn-save:disabled {
    background: rgba(59, 130, 246, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}