/* Hax LiveStream Kit Styles */

:root {
    --hax-primary: #ba938d;
    /* User requested color */
    --hax-primary-hover: #a67c76;
    /* Darker shade */
    --hax-bg-dark: #f9fafb;
    /* Light Gray (Page BG) */
    --hax-bg-panel: #ffffff;
    /* White (Panel/Card BG) */
    --hax-text-white: #1f2937;
    /* Dark Text (formerly white) */
    --hax-text-gray: #6b7280;
    /* Gray-500 */
    --hax-border: #e5e7eb;
}

/* Reset & Base */
.hax-app * {
    box-sizing: border-box;
}

.hax-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    width: 100%;
    height: 100vh;
    /* Fullscreen by default for the immersive experience */
    background-color: var(--hax-bg-dark);
    color: var(--hax-text-white);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .hax-app {
        flex-direction: row;
    }
}

/* Video Area */
.hax-video-area {
    flex: 1;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hax-video-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hax-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Placeholder / Loading */
.hax-video-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, #4c1d95, #1e3a8a, #831843);
    /* purple-900, blue-900, pink-900 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hax-placeholder-content {
    text-align: center;
}

.hax-placeholder-icon {
    width: 8rem;
    height: 8rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    backdrop-filter: blur(4px);
}

/* Overlays */
.hax-overlay {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    /* Allow clicks to pass through to video/likes */
}

.hax-overlay * {
    pointer-events: auto;
}

/* Pre-Stream Overlay (Ready to go live?) */
#hax-pre-stream-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 50;
    inset: 0;
}

/* Top Bar (Desktop) */
.hax-top-bar-desktop {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
    z-index: 20;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 1024px) {
    .hax-top-bar-desktop {
        display: flex;
    }
}

.hax-streamer-info-lg {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hax-avatar-lg-gradient {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(to right, #ec4899, #a855f7);
    /* pink-500 to purple-500 */
}

.hax-live-badge {
    padding: 0.125rem 0.5rem;
    background-color: #dc2626;
    /* red-600 */
    color: white;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Top Bar (Mobile) */
.hax-top-bar-mobile {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
    z-index: 20;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 1024px) {
    .hax-top-bar-mobile {
        display: none;
    }
}

.hax-avatar-sm-gradient {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(to right, #ec4899, #a855f7);
}

/* Mobile Bottom Actions */
.hax-mobile-actions {
    position: absolute;
    bottom: 4rem;
    /* Above input area */
    right: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 20;
}

@media (min-width: 1024px) {
    .hax-mobile-actions {
        display: none;
    }
}

.hax-action-btn {
    width: 3rem;
    height: 3rem;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.hax-action-btn:active {
    transform: scale(0.95);
}

.hax-like-btn-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hax-like-btn-mobile.animate {
    transform: scale(1.25);
}

.hax-shop-btn {
    background: linear-gradient(to right, #f97316, #ec4899);
    padding: 0.375rem 0.75rem;
    display: inline-block;
    align-self: flex-start;
    font-size: 0.875rem;
    color: white;
}

/* Mobile Chat Overlay */
.hax-mobile-chat-overlay {
    position: absolute;
    bottom: 4rem;
    /* Above input area */
    left: 0;
    width: 75%;
    /* Don't cover actions on right */
    max-height: 40%;
    padding: 1rem;
    z-index: 15;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    mask-image: linear-gradient(to top, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 80%, transparent 100%);
}

@media (min-width: 1024px) {
    .hax-mobile-chat-overlay {
        display: none;
    }
}

.hax-mobile-chat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.hax-mobile-msg {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: white;
    width: fit-content;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Mobile Input */
.hax-mobile-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.8);
    /* Darker background for contrast */
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 30;
    display: flex;
    gap: 0.5rem;
}

@media (min-width: 1024px) {
    .hax-mobile-input-area {
        display: none;
    }
}

/* Sidebar (Desktop) */
.hax-sidebar {
    display: none;
    width: 24rem;
    background-color: var(--hax-bg-panel);
    flex-direction: column;
    border-left: 1px solid #374151;
}

@media (min-width: 1024px) {
    .hax-sidebar {
        display: flex;
    }
}

.hax-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #374151;
}

.hax-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hax-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #374151;
}

/* Chat Messages (Desktop) */
.hax-chat-msg {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.hax-chat-user {
    font-weight: bold;
    margin-right: 0.5rem;
}

.hax-chat-text {
    color: #d1d5db;
    /* gray-300 */
}

/* Inputs */
.hax-input {
    width: 100%;
    background-color: #374151;
    /* gray-700 */
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    outline: none;
}

.hax-input:focus {
    box-shadow: 0 0 0 2px var(--hax-primary);
}

.hax-btn-primary {
    background-color: var(--hax-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.hax-btn-primary:hover {
    background-color: var(--hax-primary-hover);
}

/* Floating Hearts Animation */
.hax-floating-heart {
    position: absolute;
    pointer-events: none;
    animation: hax-float 2s ease-out forwards;
    z-index: 10;
}

@keyframes hax-float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-200px) scale(1.5);
        opacity: 0;
    }
}

/* Utilities */
.hax-hidden {
    display: none !important;
}

.hax-flex {
    display: flex;
}

.hax-items-center {
    align-items: center;
}

.hax-justify-center {
    justify-content: center;
}

.hax-justify-between {
    justify-content: space-between;
}

.hax-gap-2 {
    gap: 0.5rem;
}

.hax-text-sm {
    font-size: 0.875rem;
}

.hax-font-bold {
    font-weight: 700;
}

.hax-text-white-70 {
    color: rgba(255, 255, 255, 0.7);
}

/* -------------------------------------------------------------------------- */
/* NEW LIVE STREAM DISPLAY STYLES (Shopee-like Vertical / Portrait) */
/* -------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------- */
/* NEW LIVE STREAM DISPLAY STYLES (Premium / Modern) */
/* -------------------------------------------------------------------------- */

.hax-live-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile First: 2 cols */
    gap: 16px;
    width: 100%;
}

@media (min-width: 640px) {
    .hax-live-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .hax-live-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

/* Card Container */
.live-card {
    position: relative;
    background: #1f2937;
    /* Gray-800 */
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.live-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(147, 51, 234, 0.5);
    /* Purple glow on hover */
}

/* Thumbnail Area */
.thumbnail {
    position: relative;
    width: 100%;
    padding-top: 125%;
    /* Portrait Aspect Ratio 4:5 */
    background: #f3f4f6;
    overflow: hidden;
}

.thumbnail-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
    /* Above image content */
}

/* Use this simple SVG placeholder if no image */
.thumbnail-content svg.placeholder-icon {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    z-index: 0;
}

/* LIVE Badge */
.live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(220, 38, 38, 0.9);
    /* Red-600 with opacity */
    backdrop-filter: blur(4px);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: hax-pulse 2s infinite;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* Viewer Count Badge */
.viewer-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.viewer-count svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    opacity: 0.9;
}

/* Info Section (Overlaid at bottom of thumbnail for immersive feel) - Optional variant, 
   but for standard directory, let's keep it below thumbnail but very integrated. */
.info {
    padding: 16px;
    background: var(--hax-bg-panel);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

/* Stream Title */
.streamer-info .stream-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--hax-text-white);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Streamer Row */
.streamer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid #1f2937;
    /* Matches card bg */
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.5);
    /* Ring effect */
}

.streamer-name {
    font-size: 13px;
    color: #9ca3af;
    /* Gray-400 */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

.live-card:hover .streamer-name {
    color: var(--hax-primary);
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    /* Gray-300 */
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* Pulse Animation */
@keyframes hax-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Directory Page Specifics */
.hax-directory-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hax-live-grid-directory {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Search Bar Modernization */
.hax-directory-search {
    margin-bottom: 32px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hax-search-form {
    position: relative;
    width: 100%;
}

.hax-search-input {
    width: 100%;
    background: #ffffff;
    border: 2px solid var(--hax-border);
    border-radius: 12px;
    padding: 14px 50px 14px 20px;
    font-size: 1rem;
    color: var(--hax-text-white);
    transition: all 0.2s;
}

.hax-search-input:focus {
    border-color: var(--hax-primary);
    box-shadow: 0 0 0 4px rgba(186, 147, 141, 0.2);
    /* #ba938d with opacity */
    outline: none;
}

.hax-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.hax-search-btn:hover {
    color: var(--hax-primary);
    background: rgba(186, 147, 141, 0.1);
}

/* Simple Pagination Styling override */
.hax-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.hax-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #ffffff;
    color: var(--hax-text-white);
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--hax-border);
}

.hax-pagination .page-numbers.current,
.hax-pagination .page-numbers:hover {
    background: var(--hax-primary);
    color: white;
}