/* ========================================
   POVO CUSTOM CSS - COMIC STYLE
   ======================================== */

/* Color Variables */
:root {
    --white: #000000;
    --black: #FFFFFF;
    --red: #FF5A3C;
    --blue: #16B6FF;
    --green: #6CBF43;
    --sky: #7EC8FF;
}

/* Font Families */
@font-face {
    font-family: 'Comic Book Bold';
    src: url('../assets/font/Comic Book Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

.font-luckiest {
    font-family: 'Comic Book Bold', cursive;
}

.font-comic {
    font-family: 'Comic Neue', cursive;
}

/* Comic Style Helpers */
.comic-border {
    border: 2px solid var(--black);
    /* border-radius akan diatur oleh global styling */
}

.comic-border-b {
    border-bottom: 2px solid var(--black);
}

.comic-border-t {
    border-top: 2px solid var(--black);
}

.sticker-shadow {
    box-shadow: 4px 4px 0px var(--black);
}

.btn-comic {
    text-transform: uppercase;
    font-weight: bold;
    border-radius: 15px !important;
    transition: all 0.2s ease;
    font-family: 'Comic Book Bold', cursive !important;
}

.btn-comic:hover {
    transform: scale(1.03);
    animation: wiggle 0.3s ease-in-out;
}

.btn-comic:active {
    transform: translateY(2px) scale(1.03);
    box-shadow: 2px 2px 0px var(--black);
}

/* Meme Image Styles */
.meme-image {
    border: 2px solid var(--black);
    box-shadow: 4px 4px 0px var(--black);
    width: 200px;
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
    margin: 0 10px;
    flex-shrink: 0;
}

.meme-image:hover {
    transform: scale(1.05) rotate(2deg);
    animation: wiggle 0.5s ease-in-out;
}

/* Marquee Styles for Seamless Animation */
.marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    height: 220px;
}

.marquee-track {
    display: flex;
    height: 100%;
    width: max-content;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-play-state: running;
}

/* Right direction animations */
.marquee-wrapper[data-direction="right"] .marquee-track {
    animation-name: marquee-right;
    animation-duration: 20s;
}

/* Left direction animations */
.marquee-wrapper[data-direction="left"] .marquee-track {
    animation-name: marquee-left;
    animation-duration: 20s;
}

.marquee-content {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

/* Remove hover pause effect */

/* Keyframe Animations */
@keyframes marquee-right {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes marquee-left {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-2deg);
    }

    75% {
        transform: rotate(2deg);
    }
}

@keyframes noise {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-1px, -1px);
    }

    20% {
        transform: translate(1px, 1px);
    }

    30% {
        transform: translate(-1px, 1px);
    }

    40% {
        transform: translate(1px, -1px);
    }

    50% {
        transform: translate(-1px, -1px);
    }

    60% {
        transform: translate(1px, 1px);
    }

    70% {
        transform: translate(-1px, 1px);
    }

    80% {
        transform: translate(1px, -1px);
    }

    90% {
        transform: translate(-1px, -1px);
    }
}

/* Chat Bubble Styles */
.chat-bubble {
    border: 2px solid var(--black);
    padding: 12px;
    max-width: 18rem;
    word-wrap: break-word;
    position: relative;
}

.chat-bubble.user {
    background-color: #fed7aa;
    margin-left: auto;
}

.chat-bubble.other {
    background-color: var(--white);
    margin-right: auto;
}

.chat-bubble:hover {
    animation: wiggle 0.3s ease-in-out;
}

/* User Chat Message Text Color - Override semua warna text */
.user-chat-text-black {
    color: black !important;
}

.user-chat-text-black * {
    color: black !important;
}

.user-chat-text-black div {
    color: black !important;
}

.user-chat-text-black span {
    color: black !important;
}

/* Override khusus untuk chat bubble user */
.bg-yellow-400.user-chat-text-black {
    color: black !important;
}

.bg-yellow-400.user-chat-text-black * {
    color: black !important;
}

.bg-yellow-400.user-chat-text-black div {
    color: black !important;
}


/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .marquee-content {
        animation: none;
    }

    .btn-comic:hover {
        animation: none;
    }

    .meme-image:hover {
        animation: none;
    }

    .chat-bubble:hover {
        animation: none;
    }

    .animate-wiggle {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .meme-image {
        width: 150px;
        height: 150px;
        margin: 0 5px;
    }

    .marquee-right .marquee-content {
        animation-duration: 15s;
    }

    .marquee-left .marquee-content {
        animation-duration: 15s;
    }

    /* Reduce parallax effect on mobile for better performance */
    .parallax-hero::before {
        top: -5%;
        left: -5%;
        width: 110%;
        height: 110%;
    }
}

/* Custom Tailwind Utilities - Override dengan !important */
.bg-white {
    background-color: var(--white) !important;
}

.bg-red {
    background-color: #FF9800 !important;
}

.bg-blue {
    background-color: var(--blue) !important;
}

.bg-green {
    background-color: var(--green) !important;
}

.bg-sky {
    background-color: var(--sky) !important;
}

.text-black {
    color: #FFC107 !important;
}

/* Footer text white */
.footer-text-white {
    color: white !important;
}

.text-red {
    color: var(--red) !important;
}

.text-blue {
    color: var(--blue) !important;
}

.text-green {
    color: var(--green) !important;
}

/* Body Background Override */
body {
    background-color: var(--white) !important;
    position: relative;
    z-index: 1;
}

/* Section Background Override - Exclude Hero Section */
section:not(#home) {
    background-color: var(--white) !important;
    position: relative;
    z-index: 1;
}

/* Container Background Override */
.comic-border.bg-white {
    background-color: var(--white) !important;
}

/* Navbar Container Styling */
nav .comic-border.bg-white {
    border-radius: 20px !important;
    width: fit-content !important;
    /* Mengikuti konten di dalam */
    margin: 0 auto !important;
    padding: 12px 24px !important;
    /* Padding konsisten */
}

/* Global Container Styling - Konsisten dengan Navbar */
.comic-border {
    border-radius: 20px !important;
}

/* Marquee Text Container - Full Width tanpa rounded */
.marquee-text-container .comic-border {
    border-radius: 0 !important;
}

/* Marquee Text Section - Full Width tanpa rounded */
.bg-white.py-4.comic-border-t.comic-border-b {
    border-radius: 0 !important;
}

.comic-border-t.comic-border-b {
    border-radius: 0 !important;
}


/* Container dengan sticker-shadow */
.comic-border.sticker-shadow {
    border-radius: 20px !important;
}

/* Chat container khusus */
.comic-border.sticker-shadow.bg-white.h-full {
    border-radius: 20px !important;
}

/* Chat header dan footer - dengan border-radius */
.comic-border-b {
    border-radius: 20px 20px 0 0 !important;
}

.comic-border-t {
    border-radius: 0 0 20px 20px !important;
}

/* Chat input dan warning dengan border-radius */
#chat-input.comic-border {
    border-radius: 15px !important;
}

#username-warning.comic-border {
    border-radius: 15px !important;
}

/* Pastikan chat container utama memiliki border-radius penuh */
.comic-border.sticker-shadow.bg-white.h-full {
    border-radius: 20px !important;
    overflow: hidden !important;
    /* Mencegah konten keluar dari border-radius */
}

/* Input fields */
input.comic-border {
    border-radius: 15px !important;
}

/* Chat input focus styling */
#chat-input:focus,
#username-input:focus {
    border-color: #facc15 !important;
    /* yellow-400 */
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.5) !important;
}

/* Buttons */
button.comic-border {
    border-radius: 15px !important;
}

/* Chat Buttons - Ensure black text and proper styling */
#send-btn,
#join-chat-btn,
#refresh-chat-btn {
    color: black !important;
    border-radius: 15px !important;
    font-family: 'Comic Book Bold', cursive !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
}

#send-btn:hover,
#join-chat-btn:hover,
#refresh-chat-btn:hover {
    color: black !important;
}

/* Ensure font consistency even when JavaScript modifies classes */
#refresh-chat-btn i {
    font-family: 'Font Awesome 6 Free' !important;
}

/* Refresh Chat Button - Remove white border */
#refresh-chat-btn {
    border: none !important;
}

/* Social icons */
a.comic-border {
    border-radius: 15px !important;
}

/* Dropdown Styling */
#cima-dropdown {
    border-radius: 15px !important;
}

#cima-dropdown a {
    border-radius: 0 !important;
}

#cima-dropdown a:first-child {
    border-radius: 15px 15px 0 0 !important;
}

#cima-dropdown a:last-child {
    border-radius: 0 0 15px 15px !important;
}

/* Marquee Text Styling */
.marquee-text-container {
    white-space: nowrap;
    overflow: hidden;
}

.marquee-text-track {
    display: inline-block;
    animation: marquee-text 15s linear infinite;
}

.marquee-text-content {
    display: inline-block;
    white-space: nowrap;
}

@keyframes marquee-text {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Meme Gallery Layout - Fixed sizing sesuai control panel */
.marquee-wrapper {
    height: auto;
    /* Auto height untuk menyesuaikan dengan gambar */
    min-height: 420px;
    /* 400px gambar + 20px padding */
    margin-bottom: 10px;
    /* Row spacing sesuai control panel */
    overflow: visible;
    /* Pastikan gambar tidak terpotong */
    width: 100%;
    /* Full width */
}

/* Prevent horizontal scrollbar */
body {
    overflow-x: hidden;
}

#meme {
    overflow-x: hidden;
    width: 100%;
}

/* Navbar Text White */
.navbar-text-white {
    color: white !important;
}

.navbar-text-white:hover {
    color: #d1d5db !important;
    /* gray-300 */
}

.marquee-content {
    display: flex;
    align-items: center;
    height: auto;
    /* Auto height untuk menyesuaikan dengan gambar */
    min-height: 400px;
    /* Minimum height sesuai dengan gambar 400px */
    flex-shrink: 0;
}

.meme-image {
    width: 400px !important;
    /* Fixed width sesuai control panel */
    height: 400px !important;
    /* Fixed height sesuai control panel */
    object-fit: cover !important;
    margin: 0 15px !important;
    /* Spacing sesuai control panel */
    flex-shrink: 0 !important;
    border: 2px solid var(--black);
    box-shadow: 4px 4px 0px var(--black);
    transition: all 0.3s ease;
}

.meme-image:hover {
    transform: scale(1.05) rotate(2deg);
    animation: wiggle 0.5s ease-in-out;
}



/* Hero Section Background */
#home {
    background-image: url('./assets/bg1.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    min-height: 100vh !important;
    position: relative;
    z-index: 1;
}

/* Parallax Effect */
.parallax-hero {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.parallax-hero::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
    transform: translate(var(--parallax-x, 0px), var(--parallax-y, 0px));
    z-index: -1;
}

/* Optimize floating hero images for parallax */
.floating-hero-image,
.floating-hero-image-duplicate {
    will-change: transform;
}

/* Simple parallax container */
.parallax-container {
    position: relative;
    width: 100%;
    height: 100%;
    will-change: transform;
}

/* Chat Container Width */
.chat-container-1000px {
    width: 1000px !important;
}

/* Force override dengan selector yang lebih spesifik */
section#home.relative.min-h-screen.flex.items-center.justify-center {
    background-image: url('./assets/bg1.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}


/* Focus States for Accessibility */
.btn-comic:focus,
.comic-border:focus {
    outline: 3px solid #facc15;
    /* yellow-400 */
    outline-offset: 2px;
}

/* Floating Hero Image Animation */
.floating-hero-image {
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

/* Character hover area - hanya di bagian tengah karakter */
.hero-character-hover-area {
    display: inline-block;
    position: relative;
}

.hero-character-hover-area:hover .floating-hero-image {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 60px rgba(255, 255, 255, 0.6));
}

/* Duplicate images styling */
.floating-hero-image-duplicate {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    transition: all 0.5s ease;
    z-index: 1;
}

.floating-hero-image-left {
    left: -200px;
}

.floating-hero-image-right {
    right: -200px;
}

/* Hover effects for character area only */
.hero-character-hover-area:hover~.floating-hero-image-duplicate {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.05);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Custom Scrollbar for Chat */
#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border: 1px solid var(--black);
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--black);
    border-radius: 0;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--red);
}

/* Floating Stars Background Effect */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: #FFC107;
    border-radius: 50%;
    animation: twinkle 2s infinite ease-in-out;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.8);
}

.star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #FFC107;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 193, 7, 1);
}

.star-small {
    width: 2px;
    height: 2px;
    animation-duration: 3s;
}

.star-medium {
    width: 3px;
    height: 3px;
    animation-duration: 2.5s;
}

.star-large {
    width: 4px;
    height: 4px;
    animation-duration: 2s;
}

.star-fast {
    animation-duration: 1.5s;
}

.star-slow {
    animation-duration: 4s;
}

@keyframes twinkle {

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

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes float-stars {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.floating-star {
    animation: float-stars 8s linear infinite;
}

.floating-star:nth-child(odd) {
    animation-duration: 12s;
}

.floating-star:nth-child(even) {
    animation-duration: 10s;
}

.floating-star:nth-child(3n) {
    animation-duration: 15s;
}

/* Shooting stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg, transparent, #FFC107, transparent);
    border-radius: 50%;
    animation: shoot 3s linear infinite;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FFC107, transparent);
    transform: translateX(-100px);
}

@keyframes shoot {
    0% {
        transform: translate(100vw, 100vh) rotate(45deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translate(-100px, -100px) rotate(45deg);
        opacity: 0;
    }
}