:root {
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-bg-hover: rgba(40, 40, 40, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 16px;
    --accent-color: #ff4081;
    --accent-glow: rgba(255, 64, 129, 0.4);
    --text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.explore-container {
    min-height: 100vh;
    background: #0a0a0a;
    padding-bottom: 100px;
}

.explore-container.hidden {
    display: none;
}

.explore-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, #0a0a0a 0%, rgba(10,10,10,0.95) 100%);
    padding: 16px 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.explore-header h1 {
    margin: 0 0 16px;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.explore-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.explore-tabs::-webkit-scrollbar {
    display: none;
}

.explore-tab {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.explore-tab:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.explore-tab.active {
    background: #fff;
    color: #000;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

@media (min-width: 768px) {
    .explore-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        padding: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }
}

@media (min-width: 1200px) {
    .explore-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
}

@media (min-width: 768px) {
    .grid-item {
        border-radius: 8px;
    }
}

.grid-media {
    position: absolute;
    inset: 0;
}

.grid-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.grid-item:hover .grid-thumb {
    transform: scale(1.05);
}

.grid-hover {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-item:hover .grid-hover {
    opacity: 1;
}

.grid-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.grid-stat i {
    font-size: 18px;
}

.grid-video-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.grid-video-icon i {
    font-size: 20px;
}

.grid-character {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.character-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.character-name {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-tagline {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.chat-badge i {
    font-size: 16px;
    color: #fff;
}

.grid-sentinel {
    height: 1px;
    grid-column: 1 / -1;
}

.explore-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.explore-empty i {
    font-size: 64px;
    opacity: 0.5;
    margin-bottom: 16px;
}

.explore-empty p {
    font-size: 16px;
}

.feed-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), #ff80ab, var(--accent-color));
    background-size: 200% 100%;
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 0 0 10px var(--accent-glow);
}

.feed-progress-bar.loading {
    animation: progressPulse 2s ease-in-out infinite, progressShimmer 1.5s linear infinite;
}

.feed-progress-bar.complete {
    width: 100%;
    opacity: 0;
    transition: width 0.2s, opacity 0.4s 0.2s;
}

@keyframes progressPulse {
    0% { width: 5%; }
    50% { width: 75%; }
    100% { width: 95%; }
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.feed-loading-dot {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 8px var(--accent-glow);
}

.feed-loading-dot.active {
    opacity: 1;
    animation: dotPulse 1.2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px var(--accent-glow); }
    50% { transform: scale(1.5); box-shadow: 0 0 16px var(--accent-glow); }
}

.feed-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    overflow: hidden;
    z-index: 100;
    display: none;
}

.feed-container.active {
    display: block;
}

.feed-back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 110;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.feed-back-btn:hover {
    background: var(--glass-bg-hover);
    transform: scale(1.1);
}

.feed-back-btn i {
    font-size: 24px;
}

@media (max-width: 767px) {
    .feed-container {
        display: block;
    }
    .feed-back-btn {
        display: none;
    }
    .explore-container {
        display: none !important;
    }
}

.feed-scroll {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.feed-scroll::-webkit-scrollbar {
    display: none;
}

.feed-item {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.feed-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.feed-video,
.feed-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.feed-item:hover .feed-video,
.feed-item:hover .feed-image {
    transform: scale(1.01);
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 72px;
    height: 72px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.video-play-overlay i {
    font-size: 40px;
    color: #fff;
    margin-left: 4px;
}

.feed-item.paused .video-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.feed-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.feed-overlay > * {
    pointer-events: auto;
}

.feed-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.feed-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feed-action:hover {
    background: var(--glass-bg-hover);
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.feed-action:active {
    transform: scale(0.95);
}

.feed-action i {
    font-size: 22px;
    text-shadow: var(--text-shadow);
}

.feed-action span {
    position: absolute;
    bottom: -20px;
    font-size: 12px;
    font-weight: 700;
    text-shadow: var(--text-shadow);
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.feed-action.liked {
    background: rgba(255, 64, 129, 0.25);
    border-color: var(--accent-color);
}

.feed-action.liked i {
    color: var(--accent-color);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.feed-action.liked {
    animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.feed-info {
    flex: 1;
    max-width: calc(100% - 70px);
    padding-right: 16px;
}

.feed-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    object-fit: cover;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.author-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    text-shadow: var(--text-shadow);
    letter-spacing: -0.01em;
}

.follow-btn {
    background: transparent;
    border: 1.5px solid #fff;
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.follow-btn:hover {
    background: #fff;
    color: #000;
}

.follow-btn.following {
    background: rgba(255,255,255,0.15);
    border-color: transparent;
}

.double-tap-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 120px;
    color: var(--accent-color);
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(0 0 20px var(--accent-glow));
    z-index: 10;
}

.double-tap-heart.animate {
    animation: doubleTapHeart 0.8s ease-out forwards;
}

@keyframes doubleTapHeart {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(0.95); opacity: 1; }
    45% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.feed-caption {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    line-height: 1.5;
    text-shadow: var(--text-shadow);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
}

.feed-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feed-tag {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.feed-tag:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.feed-empty {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555;
    gap: 12px;
}

.feed-empty i {
    font-size: 72px;
    opacity: 0.5;
}

.feed-empty p {
    font-size: 16px;
    font-weight: 500;
}

.fab-create {
    position: fixed;
    bottom: max(90px, calc(env(safe-area-inset-bottom) + 90px));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #f50057 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
    z-index: 101;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-create:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 28px var(--accent-glow), 0 4px 12px rgba(0,0,0,0.4);
}

.fab-create:active {
    transform: scale(0.95);
}

.fab-create i {
    font-size: 28px;
    transition: transform 0.25s;
}

.feed-dialog {
    border: none;
    border-radius: 20px;
    max-width: 420px;
    width: 92%;
    background: linear-gradient(180deg, #1e1e1e 0%, #141414 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.feed-dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.feed-dialog .mdl-dialog__title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 0;
    margin: 0;
}

.dialog-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dialog-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.dialog-close i {
    font-size: 20px;
}

.feed-dialog .mdl-dialog__content {
    padding: 0 24px 16px;
}

.feed-dialog .mdl-dialog__actions {
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.upload-area {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
    background: rgba(255,255,255,0.02);
}

.upload-area:hover {
    border-color: var(--accent-color);
    background: rgba(255, 64, 129, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(255, 64, 129, 0.1);
    transform: scale(1.02);
}

.upload-placeholder i {
    font-size: 48px;
    color: #666;
    margin-bottom: 8px;
}

.upload-placeholder p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.upload-preview {
    display: none;
}

.upload-preview.has-media {
    display: block;
    margin-top: 16px;
}

.upload-preview img,
.upload-preview video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
}

.comments-list {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #fff;
}

.comment-text {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
    word-wrap: break-word;
}

.comment-input-area {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
}

.comment-input-area input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    color: #fff;
    outline: none;
    font-size: 14px;
}

.comment-input-area input::placeholder {
    color: rgba(255,255,255,0.4);
}

.comment-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.comment-input-area button:hover {
    background: #f50057;
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .feed-media {
        max-width: 420px;
        margin: 0 auto;
        position: relative;
        height: 100%;
        border-radius: 16px;
        overflow: hidden;
    }

    .feed-overlay {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 16px 16px;
    }

    .feed-actions {
        position: fixed;
        right: calc(50% - 260px);
        bottom: 120px;
    }
}

@media (max-width: 767px) {
    .feed-action {
        width: 46px;
        height: 46px;
    }

    .feed-action i {
        font-size: 20px;
    }

    .feed-overlay {
        padding: 20px 16px;
    }

    .author-avatar {
        width: 38px;
        height: 38px;
    }

    .feed-caption {
        font-size: 14px;
    }
}

.feed-sentinel {
    height: 1px;
    width: 100%;
}

.repost-btn.reposted {
    color: #4caf50;
}

.repost-btn.reposted i {
    color: #4caf50;
}

.recommendations-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.recommendations-overlay.active {
    opacity: 1;
    visibility: visible;
}

.recommendations-panel {
    background: linear-gradient(180deg, #1e1e1e 0%, #141414 100%);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.recommendations-overlay.active .recommendations-panel {
    transform: translateY(0);
}

.recommendations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.recommendations-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

.close-recommendations {
    background: rgba(255,255,255,0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendations-list {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(70vh - 70px);
}

.recommendation-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.recommendation-item:hover {
    background: rgba(255,255,255,0.1);
}

.rec-media {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.rec-media img,
.rec-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rec-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rec-author {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.rec-text {
    font-size: 14px;
    color: #fff;
    margin: 0;
    line-height: 1.4;
}

.rec-likes {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 4px;
}

.rec-likes i {
    font-size: 14px;
}

.loading-text,
.empty-text {
    text-align: center;
    color: rgba(255,255,255,0.5);
    padding: 40px 20px;
}

.create-dialog {
    max-width: 520px;
    padding: 0;
}

.create-dialog .dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.create-dialog .dialog-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.post-submit-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.post-submit-btn:disabled {
    opacity: 0.5;
}

.create-dialog-content {
    padding: 0 16px 16px;
    min-height: 200px;
}

.create-dialog-content.drag-over {
    background: rgba(255,107,107,0.1);
    border: 2px dashed var(--accent-color);
    border-radius: 12px;
}

.post-composer {
    margin-bottom: 12px;
}

.composer-text {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.5;
    color: #fff;
    outline: none;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.composer-text:empty::before {
    content: attr(data-placeholder);
    color: rgba(255,255,255,0.4);
    pointer-events: none;
}

.composer-text:focus {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
}

.composer-toolbar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.toolbar-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.toolbar-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.upload-preview-area {
    margin-top: 12px;
}

.upload-preview-area:empty {
    display: none;
}

.upload-preview-area.has-media {
    display: block;
    position: relative;
}

.upload-preview-area img,
.upload-preview-area video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    object-fit: contain;
}

.upload-preview-area .remove-media {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-picker {
    display: none;
    margin-top: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    overflow: hidden;
}

.emoji-picker.active {
    display: block;
}

.emoji-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.emoji-search-box i {
    color: rgba(255,255,255,0.5);
    font-size: 20px;
}

.emoji-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
}

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

.emoji-results {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.emoji-item:hover {
    background: rgba(255,255,255,0.1);
}

.share-dialog {
    max-width: 320px;
}

.share-options {
    padding: 8px 16px 16px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.share-option:hover {
    background: rgba(255,255,255,0.1);
}

.share-option i {
    font-size: 22px;
    color: rgba(255,255,255,0.7);
}

.share-option:last-child {
    margin-bottom: 0;
}

.emoji-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border-radius: 8px;
    background: transparent;
    border: none;
    transition: background 0.15s;
}

.emoji-btn:hover {
    background: rgba(255,255,255,0.1);
}

.emoji-results .no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(255,255,255,0.5);
    padding: 20px;
    font-size: 14px;
}

.create-dialog-content.dragover {
    background: rgba(255,107,107,0.1);
}

.create-dialog-content.dragover::after {
    content: 'Drop to upload';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    pointer-events: none;
}

.remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-preview:hover {
    background: rgba(0,0,0,0.9);
}

.remove-preview i {
    font-size: 18px;
}

.upload-preview-area.has-media {
    position: relative;
}

.preview-image,
.preview-video {
    max-width: 100%;
    max-height: 250px;
    border-radius: 12px;
    display: block;
}

.chat-replay {
    background: linear-gradient(135deg, rgba(15,15,25,0.95) 0%, rgba(30,20,40,0.95) 100%);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-replay-header {
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255,107,107,0.3) 0%, rgba(236,72,153,0.3) 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-replay-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

.chat-replay-info {
    flex: 1;
}

.chat-replay-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.chat-replay-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.chat-replay-controls {
    display: flex;
    gap: 8px;
}

.chat-replay-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-replay-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

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

.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
}

.chat-msg.ai {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-msg.ai .chat-msg-bubble {
    background: rgba(255,107,107,0.3);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-msg-bubble {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ec4899 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px !important;
}

.chat-msg-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    animation: typingDot 1.4s infinite;
}

.chat-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-msg-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.game-share {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    text-align: center;
}

.game-share-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #ec4899 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(255,107,107,0.3);
}

.game-share-icon i {
    font-size: 40px;
    color: #fff;
}

.game-share-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.game-share-score {
    color: var(--accent-color);
    font-size: 28px;
    font-weight: 700;
}

.game-play-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ec4899 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(255,107,107,0.3);
}

.game-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

.mention-popup {
    position: fixed;
    z-index: 10000;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    min-width: 260px;
    max-width: 320px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    border: 1px solid rgba(255,255,255,0.1);
}

.mention-popup.active {
    display: block;
}

.mention-results {
    padding: 8px 0;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.mention-item:hover,
.mention-item.active {
    background: rgba(255,255,255,0.08);
}

.mention-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}

.mention-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mention-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-handle {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
}

.mention-type {
    background: linear-gradient(135deg, var(--accent-color, #ff6b6b) 0%, #ec4899 100%);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
    flex-shrink: 0;
}

.mention-empty {
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

.mention-tag {
    background: rgba(var(--accent-color-rgb, 255,107,107), 0.2);
    color: var(--accent-color, #ff6b6b);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

.mention-tag:hover {
    background: rgba(var(--accent-color-rgb, 255,107,107), 0.3);
}

.preview-media-wrapper {
    position: relative;
    display: inline-block;
}

.preview-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.edit-preview-btn,
.upload-preview-area .remove-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.edit-preview-btn:hover,
.upload-preview-area .remove-preview:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.media-editor-dialog {
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
}

.media-editor-dialog .editor-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 56px);
}

.editor-preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 300px;
    position: relative;
}

#editor-canvas {
    max-width: 100%;
    max-height: 100%;
}

#editor-video {
    max-width: 100%;
    max-height: 100%;
}

.editor-tools {
    background: #1e1e1e;
    padding: 16px;
}

.filter-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-btn .filter-preview {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #444 0%, #222 100%);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.filter-btn.active .filter-preview {
    border-color: var(--accent-color, #ff6b6b);
}

.filter-btn span:last-child {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
}

.filter-btn.active span:last-child {
    color: #fff;
}

.tool-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tool-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.tool-tab i {
    font-size: 18px;
}

.tool-tab.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.tool-panel {
    display: none;
}

.tool-panel.active {
    display: block;
}

.crop-ratios {
    display: flex;
    gap: 8px;
}

.crop-ratio {
    flex: 1;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.crop-ratio.active {
    background: var(--accent-color, #ff6b6b);
    color: #fff;
}

.adjust-slider {
    margin-bottom: 16px;
}

.adjust-slider label {
    display: block;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-bottom: 8px;
}

.adjust-slider input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    height: 4px;
}

.adjust-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.trim-controls {
    display: none;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 16px;
}

.trim-controls.active {
    display: block;
}

.trim-controls input[type="range"] {
    width: 100%;
    margin: 8px 0;
}

.trim-labels {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.editor-done-btn {
    background: var(--accent-color, #ff6b6b);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-done-btn:hover {
    opacity: 0.9;
}

@media (max-width: 600px) {
    .media-editor-dialog {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .editor-preview {
        min-height: 50vh;
    }
    
    .filter-btn .filter-preview {
        width: 48px;
        height: 48px;
    }
}

.aiart-dialog {
    max-width: 500px;
    width: 100%;
    padding: 0;
}

.aiart-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
}

.aiart-preview {
    aspect-ratio: 1;
    max-height: 350px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.aiart-placeholder {
    text-align: center;
    color: rgba(255,255,255,0.5);
}

.aiart-placeholder i {
    font-size: 48px;
    margin-bottom: 8px;
}

.aiart-result {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aiart-actions {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.aiart-use-btn {
    background: var(--accent-color, #ff6b6b);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
}

.aiart-retry-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiart-loading {
    text-align: center;
    color: rgba(255,255,255,0.7);
}

.aiart-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent-color, #ff6b6b);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

.aiart-error {
    text-align: center;
    color: #ff6b6b;
}

.aiart-error i {
    font-size: 40px;
    margin-bottom: 8px;
}

.aiart-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aiart-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.aiart-input:focus {
    border-color: var(--accent-color, #ff6b6b);
    background: rgba(255,255,255,0.1);
}

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

.aiart-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aiart-style {
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid transparent;
    border-radius: 20px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.aiart-style:hover {
    background: rgba(255,255,255,0.12);
}

.aiart-style.active {
    background: var(--accent-color, #ff6b6b);
    color: #fff;
}

.aiart-generate-btn {
    background: var(--accent-color, #ff6b6b);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.aiart-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .aiart-dialog {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .aiart-preview {
        max-height: 300px;
    }
}

.quoted-post {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quoted-post:hover {
    background: rgba(255,255,255,0.08);
}

.quoted-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.quoted-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.quoted-author {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}

.quoted-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.quoted-text {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.quote-preview-wrapper {
    position: relative;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    margin-bottom: 12px;
}

.remove-quote-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.remove-quote-preview i {
    font-size: 16px;
}

.quote-btn {
    opacity: 0.8;
}

.quote-btn:hover {
    opacity: 1;
}

.upload-preview-area.has-quote .quoted-post {
    margin-top: 0;
}

.link-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.link-preview:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

.link-preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-color, #ff6b6b) 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-preview-icon i {
    color: #fff;
    font-size: 20px;
}

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

.link-preview-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.link-preview-url {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-preview-arrow {
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    flex-shrink: 0;
}

.link-preview:hover .link-preview-arrow {
    color: var(--accent-color, #ff6b6b);
}
