        * {

            margin: 0;

            padding: 0;

            box-sizing: border-box;

            user-select: none;

            -webkit-user-select: none;

        }



        body {

            font-family: 'Roboto', 'Arial', sans-serif;

            overflow: hidden;

            background: #87CEEB;

            position: relative;

            height: 100vh;

        }



        /* Mobile Frame */

        .mobile-frame {

            width: 100%;

            max-width: 100%;

            height: 100vh;

            margin: 0 auto;

            position: relative;

            background: linear-gradient(to bottom, #87CEEB 0%, #4682B4 50%, rgba(30,144,255,0.6) 100%);

            overflow: hidden;

            min-height: 100vh;

        }



        /* Top Bar */

        .top-bar {

            position: absolute;

            top: 0;

            left: 0;

            right: 0;

            height: 60px;

            display: flex;

            align-items: center;

            justify-content: space-between;

            padding: 0 20px;

            z-index: 2100;

            background: rgba(255, 255, 255, 0.2);

            backdrop-filter: blur(10px);

        }



        .avatar {

            width: 40px;

            height: 40px;

            border-radius: 50%;

            background: linear-gradient(135deg, #FFB74D, #FF9800);

            display: flex;

            align-items: center;

            justify-content: center;

            font-size: 20px;

            color: white;

            font-weight: bold;

            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

        }



        .top-icons {

            display: flex;

            gap: 15px;

            align-items: center;

            padding: 0 5px;

        }



        .top-icon {

            position: relative;

            width: 30px;

            height: 30px;

            display: flex;

            align-items: center;

            justify-content: center;

            color: white;

            font-size: 18px;

            cursor: pointer;

            transition: all 0.3s ease;

        }



        .top-icon:hover {

            transform: scale(1.1);

            color: #FFB74D;

        }



        .home-icon {

            color: #FFB74D;

        }



        .home-icon:hover {

            color: #FF9800;

        }



        .icon-badge {

            position: absolute;

            top: -8px;

            right: -8px;

            background: #FF5722;

            color: white;

            font-size: 10px;

            font-weight: bold;

            min-width: 16px;

            height: 16px;

            border-radius: 8px;

            display: flex;

            align-items: center;

            justify-content: center;

            padding: 0 4px;

            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

            z-index: 10;

        }



        /* Ocean Scene - Vietnamese Style */

        .ocean-scene {

            position: absolute;

            top: 60px;

            left: 0;

            right: 0;

            bottom: 0;

            width: 100%;

            background-image: url('../img/background.jpg');

            background-size: cover;

            background-position: center;

            overflow: visible; /* Cho phép fish hiển thị ngoài container */

            /* Multiple fallbacks for mobile viewport */
            height: calc(100vh - 60px); /* Standard fallback */
            height: calc(100dvh - 60px); /* Dynamic viewport height for mobile */
            height: calc(var(--vh, 1vh) * 100 - 60px); /* Custom property fallback */

            min-height: calc(100vh - 60px); /* Standard fallback */
            min-height: calc(100dvh - 60px); /* Dynamic viewport height for mobile */
            min-height: calc(var(--vh, 1vh) * 100 - 60px); /* Custom property fallback */

        }



        /* Overlay gradient cho mặt biển đẹp hơn */

        .ocean-scene::before {

            content: '';

            position: absolute;

            left: 0;

            right: 0;

            bottom: 0;

            height: 30%; /* Điều chỉnh độ cao gradient */

            background: linear-gradient(to top, rgba(30, 144, 255, 0.6), rgba(30, 144, 255, 0));

            pointer-events: none;

            z-index: 3;

        }



        /* Đảm bảo sóng hiển thị trên nền */

        .ocean-scene .ocean-waves {

            position: absolute;

            bottom: 0;

            left: 0;

            right: 0;

            width: 100%;

            height: 40%; /* Tăng chiều cao vùng sóng */

            z-index: 4;

            overflow: hidden;

        }



        /* Sun */

        .sun {

            position: absolute;

            width: 80px;

            height: 80px;

            background: radial-gradient(circle, #FFD700, #FFA500);

            border-radius: 50%;

            top: 30px;

            right: 40px;

            box-shadow: 0 0 40px #FFD700;

            /* Disable sun glow animation to reduce repaints */
            animation: none !important;

        }



        @keyframes sunGlow {

            0%, 100% { box-shadow: 0 0 40px #FFD700; }

            50% { box-shadow: 0 0 60px #FFD700, 0 0 80px #FFA500; }

        }



        /* Ocean Waves - More Dynamic - Di chuyển lên cao hơn */

        .ocean-waves {

            position: absolute;

            bottom: 80px;  /* Di chuyển sóng lên cao hơn để tạo hiệu ứng trên mặt nước */

            left: 0;

            right: 0;

            width: 100%;

            height: 180px; /* Giảm height để cân đối */

            overflow: hidden;

        }



        .wave {

            position: absolute;

            width: 200%;

            height: 100%;

            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%231E90FF" fill-opacity="0.7" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,133.3C960,128,1056,96,1152,90.7C1248,85,1344,107,1392,117.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');

            background-size: 50% 100%;

            animation: wave 8s linear infinite;

        }



        .wave:nth-child(2) {

            bottom: 10px;

            opacity: 0.6;

            animation: wave 12s linear reverse infinite;

        }



        .wave:nth-child(3) {

            bottom: 20px;

            opacity: 0.4;

            animation: wave 15s linear infinite;

        }


        .wave:nth-child(4) {

            bottom: 30px;

            opacity: 0.3;

            animation: wave 10s linear reverse infinite;

        }


        .wave:nth-child(5) {

            bottom: 40px;

            opacity: 0.2;

            animation: wave 18s linear infinite;

        }



        @keyframes wave {

            0% { transform: translateX(0); }

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

        }



        /* Dynamic Clouds */

        .cloud {

            position: absolute;

            background: rgba(255, 255, 255, 0.7);

            border-radius: 100px;

            filter: blur(2px);

        }



        .cloud::before,

        .cloud::after {

            content: '';

            position: absolute;

            background: rgba(255, 255, 255, 0.7);

            border-radius: 100px;

        }



        .cloud1 {

            width: 80px;

            height: 35px;

            top: 60px;

            left: 60px;

            animation: floatCloud 40s linear infinite;

        }



        .cloud1::before {

            width: 40px;

            height: 40px;

            top: -15px;

            left: 15px;

        }



        .cloud1::after {

            width: 50px;

            height: 35px;

            top: -8px;

            right: 15px;

        }


        .cloud2 {

            width: 100px;

            height: 40px;

            top: 120px;

            left: -100px;

            animation: floatCloud 50s linear infinite;

        }



        .cloud2::before {

            width: 45px;

            height: 45px;

            top: -20px;

            left: 20px;

        }



        .cloud2::after {

            width: 60px;

            height: 40px;

            top: -10px;

            right: 15px;

        }


        .cloud3 {

            width: 70px;

            height: 30px;

            top: 40px;

            left: -70px;

            animation: floatCloud 35s linear infinite 15s;

        }



        .cloud3::before {

            width: 35px;

            height: 35px;

            top: -15px;

            left: 12px;

        }



        .cloud3::after {

            width: 45px;

            height: 30px;

            top: -8px;

            right: 12px;

        }


        @keyframes floatCloud {

            0% { transform: translateX(0); }

            100% { transform: translateX(450px); }

        }



        /* Seagulls - More Dynamic */

        .seagull {

            position: absolute;

            font-size: 18px;

            color: white;

            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);

            animation: flySeagull 20s linear infinite;

            z-index: 10;

        }



        .seagull1 {

            top: 80px;

            left: -20px;

            animation-delay: 0s;

        }



        .seagull2 {

            top: 120px;

            left: -20px;

            animation-delay: 5s;

        }


        .seagull3 {

            top: 100px;

            left: -20px;

            animation-delay: 12s;

        }


        .seagull4 {

            top: 60px;

            left: -20px;

            animation-delay: 17s;

        }



        @keyframes flySeagull {

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

            25% { transform: translateX(100px) translateY(-15px); }

            50% { transform: translateX(200px) translateY(10px); }

            75% { transform: translateX(300px) translateY(-10px); }

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

        }



        /* Vietnamese-style Bottles */

        .bottle {

            position: absolute;

            cursor: pointer;

            transition: transform 0.3s ease;

            animation: none !important;

            z-index: 5;

            width: 40px;  /* Tăng kích thước chai lên để phù hợp với hình mới */

            height: 70px;

            bottom: 100px;

        }



        .bottle:hover {

            transform: scale(1.1);

        }


        .bottle img {

            width: 100%;

            height: 100%;

            object-fit: contain;

            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));  /* Thêm đổ bóng nhẹ để chai nổi bật hơn */

        }



        .bottle-label {

            position: absolute;

            bottom: -20px;

            left: 50%;

            transform: translateX(-50%);

            background: rgba(255, 255, 255, 0.8);

            color: #455A64;

            padding: 2px 6px;

            border-radius: 10px;

            font-size: 10px;

            white-space: nowrap;

            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

        }



        .flag {

            position: absolute;

            top: -15px;

            left: 50%;

            transform: translateX(-50%);

            width: 15px;

            height: 10px;

            border-radius: 2px;

        }



        @keyframes floatBottle {
            0%, 100% { transform: translateY(0) rotate(-2deg); }
            25% { transform: translateY(-3px) rotate(0deg); }
            50% { transform: translateY(-5px) rotate(2deg); }
            75% { transform: translateY(-2px) rotate(0deg); }
        }
        .bottle:focus {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        /* Enhanced Splash Effect */
        .splash {
            position: absolute;
            width: 40px;
            height: 40px;
            pointer-events: none;
            z-index: 6;
            transform: translate(-50%, -50%);
        }

        .splash::before,
        .splash::after {
            content: '';
            position: absolute;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 50%;
            animation: splash 1s forwards;
            opacity: 0.8;
        }

        .splash::before {
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
        }

        .splash::after {
            width: 60%;
            height: 60%;
            left: 20%;
            top: 20%;
            animation-delay: 0.2s;
        }

        /* Enhanced Ripple Effect */
        .ripple {
            position: absolute;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.8);
            pointer-events: none;
            z-index: 6;
            animation: ripple 2s ease-out forwards;
            background: rgba(255, 255, 255, 0.1);
            transform: translate(-50%, -50%);
        }

        @keyframes ripple {
            0% {
                width: 0px;
                height: 0px;
                opacity: 0.8;
            }
            100% {
                width: 120px;
                height: 120px;
                opacity: 0;
            }
        }

        /* Send Button */

        .send-button {

            position: absolute;
            bottom: 120px;                /* Giảm khoảng cách với day/night toggle */
            right: 20px;
            width: 50px;                  /* Tăng kích thước để đồng nhất */
            height: 50px;
            padding: 0;
            border-radius: 50%;
            background: linear-gradient(135deg, #FF9800, #F57C00);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            border: none;
            font-size: 20px;              /* Tăng icon size */
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            z-index: 300;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }



        .send-button:hover {

            transform: scale(1.1);

            box-shadow: 0 7px 20px rgba(0, 0, 0, 0.4);

        }

        /* Day/Night Toggle Button */
        .day-night-toggle {
            position: absolute;
            bottom: 60px;                 /* Giảm khoảng cách với send button */
            right: 20px;
            width: 50px;                  /* Đồng nhất kích thước với send button */
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, #FFB74D, #FF9800);
            border: none;
            color: white;
            font-size: 20px;              /* Đồng nhất icon size */
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            z-index: 100;
            transition: all 0.3s ease;
        }

        .day-night-toggle:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }

        .day-night-toggle .fa-sun {
            color: #fff5e0;
        }

        /* Bottom Navigation */

        .bottom-nav {

            position: absolute;

            bottom: 0;

            left: 0;

            right: 0;

            height: 80px;

            background: rgba(255, 255, 255, 0.9);

            backdrop-filter: blur(10px);

            display: flex;

            justify-content: space-around;

            align-items: center;

            padding-bottom: 10px;

            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);

            z-index: 100;

        }



        .nav-item {

            display: flex;

            flex-direction: column;

            align-items: center;

            gap: 5px;

            color: #78909C;

            font-size: 10px;

            cursor: pointer;

            transition: color 0.3s ease;

        }



        .nav-item.active {

            color: #FF5722;

        }



        .nav-icon {

            font-size: 24px;

            position: relative;

        }



        .nav-badge {

            position: absolute;

            top: -5px;

            right: -5px;

            background: #FF5722;

            color: white;

            font-size: 8px;

            font-weight: bold;

            width: 14px;

            height: 14px;

            border-radius: 50%;

            display: flex;

            align-items: center;

            justify-content: center;

        }



        /* Send Bottle Modal */

        .modal {

            display: none;

            position: fixed;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            background: rgba(0, 0, 0, 0.6);

            z-index: 2200;

            justify-content: center;

            align-items: center;

        }

        /* Inbox modal specific styling để không che khuất header */
        #inboxModal {
            z-index: 2200 !important;
        }

        #inboxModal .modal-content {
            margin-top: 60px !important; /* Để lại space cho header */
            max-height: calc(100vh - 60px) !important;
        }



        .modal-content {

            background: white;

            width: 90%;

            max-width: 350px;

            border-radius: 20px;

            padding: 20px;

            position: relative;

            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            max-height: 80vh;
            overflow-y: auto;
        }



        .modal-header {

            display: flex;

            align-items: center;

            margin-bottom: 20px;

        }



        .back-button {

            width: 30px;

            height: 30px;

            border-radius: 50%;

            background: #E0F7FA;

            display: flex;

            align-items: center;

            justify-content: center;

            cursor: pointer;

            margin-right: 15px;

            color: #455A64;

        }



        .modal-title {

            font-size: 18px;

            font-weight: 600;

            color: #455A64;

        }



        .bottle-preview {

            width: 80px;

            height: 120px;

            margin: 0 auto 20px;

            position: relative;

        }


        .bottle-preview img {

            width: 100%;

            height: 100%;

            object-fit: contain;

        }



        .message-input {

            width: 100%;

            min-height: 250px;

            /* Expandable area for long messages */
            resize: none;
            overflow-y: hidden;
            padding: 12px;
            font-size: 14px;
            margin-bottom: 20px;
        }



        .message-input:focus {

            outline: none;

            border-color: #80DEEA;

        }



        .swipe-hint {

            background: #80DEEA;

            color: white;

            padding: 8px 16px;

            border-radius: 20px;

            text-align: center;

            font-size: 12px;

            margin-bottom: 20px;

        }



        .action-buttons {

            display: flex;

            gap: 10px;

            justify-content: center;

        }



        .action-btn {

            width: 40px;

            height: 40px;

            border-radius: 50%;

            border: 2px solid #E0F7FA;

            background: white;

            display: flex;

            align-items: center;

            justify-content: center;

            cursor: pointer;

            transition: all 0.3s ease;

        }



        .action-btn:hover {

            border-color: #80DEEA;

            background: #E0F7FA;

        }



        /* Notification */

        .notification {

            position: fixed;

            top: 70px;

            left: 50%;

            transform: translateX(-50%) translateY(-100px);

            background: rgba(255, 255, 255, 0.9);

            color: #455A64;

            padding: 10px 20px;

            border-radius: 20px;

            font-size: 14px;

            z-index: 3000;

            transition: transform 0.3s ease;

            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);

        }



        .notification.show {

            transform: translateX(-50%) translateY(0);

        }



        /* Read Message Modal */

        .read-modal .modal-content {

            text-align: center;

        }



        .message-display {

            background: #E0F7FA;

            padding: 15px;

            border-radius: 10px;

            margin-bottom: 15px;

            text-align: left;

        }



        .message-text {

            font-size: 14px;

            line-height: 1.5;

            color: #455A64;

            margin-bottom: 10px;

        }



        .message-author {

            font-size: 12px;

            color: #78909C;

            text-align: right;

        }



        .reply-button {

            background: linear-gradient(135deg, #FF9800, #F57C00);

            color: white;

            border: none;

            padding: 10px 20px;

            border-radius: 20px;

            font-weight: 600;

            cursor: pointer;

            width: 100%;

            font-family: inherit;

        }



        /* Thêm style cho nút Báo cáo */
        .report-button {
            background: linear-gradient(135deg, #E53935, #D32F2F);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 20px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            font-family: inherit;
            margin-top: 10px;
        }



        /* Responsive */

        @media (max-width: 414px) {

            .mobile-frame {

                max-width: 100%;

            }

        }

        /* Fishing boat animation */
        .fishing-boat {
            position: absolute;
            bottom: 50px;
            left: -120px;
            width: 100px;
            height: 60px;
            animation: moveFishingBoat 60s linear infinite;
            z-index: 4;
        }

        .boat-body {
            position: absolute;
            bottom: 0;
            width: 100px;
            height: 25px;
            background: #8B4513;
            border-radius: 10px 10px 0 0;
        }

        .boat-sail {
            position: absolute;
            bottom: 25px;
            left: 30px;
            width: 5px;
            height: 35px;
            background: #A0522D;
        }

        .boat-flag {
            position: absolute;
            top: 5px;
            right: -20px;
            width: 20px;
            height: 12px;
            background: linear-gradient(to bottom, #FF0000 50%, #FFFF00 50%);
        }

        @keyframes moveFishingBoat {
            0% {
                left: -120px;
                transform: translateY(0);
            }
            45% {
                transform: translateY(-5px);
            }
            50% {
                transform: translateY(5px);
            }
            95% {
                transform: translateY(-3px);
            }
            100% {
                left: 100%;
                transform: translateY(0);
            }
        }

        /* Day/Night mode */
        .night-mode {
            transition: all 3s ease;
        }

        .night-mode.ocean-scene {
            background-blend-mode: multiply;
            filter: brightness(0.7) saturate(0.8);
        }

        .night-mode .sun {
            background: radial-gradient(circle, #FEFCD7, #F4F1C9);
            box-shadow: 0 0 30px #FEFCD7;
            filter: brightness(0.9);
        }

        .night-mode .wave {
            opacity: 0.8;
        }

        .night-mode::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(to bottom, rgba(20, 30, 60, 0.2), rgba(10, 20, 40, 0.5));
            pointer-events: none;
            z-index: 1;
        }

        /* Stars */
        .star {
            position: absolute;
            background: white;
            border-radius: 50%;
            opacity: 0;
            transition: opacity 3s ease;
        }

        .night-mode .star {
            opacity: 1;
            /* Disable twinkle to reduce GPU load on mobile */
            animation: none !important;
        }

        @keyframes twinkle {
            0%, 100% { opacity: 0.2; }
            50% { opacity: 0.8; }
        }

        /* Fish animation - Tối ưu cho mobile - Di chuyển xuống vùng nước xanh */
        .fish {
            position: absolute;
            width: 35px;  /* Tăng kích thước để dễ thấy trên mobile */
            height: 22px;
            pointer-events: none;
            z-index: 25;   /* Tăng z-index cao nhất để đảm bảo hiển thị trên tất cả elements */
            animation: swimFish linear infinite;
            transform-origin: center;
            /* Loại bỏ left: 0 và right: 0 để animation có thể hoạt động */
            bottom: 60px;  /* Tăng bottom để cá hiển thị rõ hơn */
            will-change: transform, left; /* Tối ưu performance animation */
            backface-visibility: hidden;  /* Tránh flicker trên mobile */
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        .fish img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            filter: drop-shadow(0 0 1px rgba(0,0,0,0.3));
        }

        .fish-1 {
            bottom: 70px !important;
            left: 15% !important;
            animation: none !important;
        }

        .fish-2 {
            bottom: 85px !important;
            left: 50% !important;
            animation: none !important;
        }

        .fish-3 {
            bottom: 60px !important;
            left: 85% !important;
            animation: none !important;
        }

        @keyframes swimFish {
            0% {
                left: -50px;
                transform: scaleX(1) translateY(0) translateZ(0);
                opacity: 1;
            }
            25% {
                left: 25vw;
                transform: scaleX(1) translateY(-8px) translateZ(0);
                opacity: 1;
            }
            50% {
                left: calc(100vw + 20px);
                transform: scaleX(1) translateY(0) translateZ(0);
                opacity: 1;
            }
            50.1% {
                left: calc(100vw + 20px);
                transform: scaleX(-1) translateY(0) translateZ(0);
                opacity: 1;
            }
            75% {
                left: 75vw;
                transform: scaleX(-1) translateY(-8px) translateZ(0);
                opacity: 1;
            }
            100% {
                left: -50px;
                transform: scaleX(-1) translateY(0) translateZ(0);
                opacity: 1;
            }
        }

        /* Mobile-specific animation với position fixed */
        @media (max-width: 768px) {
            @keyframes swimFish {
                0% {
                    left: -60px;
                    transform: scaleX(1) translateY(0) translateZ(0);
                    opacity: 1;
                }
                25% {
                    left: 25vw;
                    transform: scaleX(1) translateY(-5px) translateZ(0);
                    opacity: 1;
                }
                50% {
                    left: calc(100vw + 30px);
                    transform: scaleX(1) translateY(0) translateZ(0);
                    opacity: 1;
                }
                50.1% {
                    left: calc(100vw + 30px);
                    transform: scaleX(-1) translateY(0) translateZ(0);
                    opacity: 1;
                }
                75% {
                    left: 75vw;
                    transform: scaleX(-1) translateY(-5px) translateZ(0);
                    opacity: 1;
                }
                100% {
                    left: -60px;
                    transform: scaleX(-1) translateY(0) translateZ(0);
                    opacity: 1;
                }
            }
        }

        .night-mode .fish img {
            filter: brightness(0.7) drop-shadow(0 0 1px rgba(150,150,255,0.5));
        }

        /* Simplified mobile fish approach - Force visibility */
        @media (max-width: 768px) {
            /* Reset fish to simple approach */
            .fish {
                display: block !important;
                visibility: visible !important;
                opacity: 1 !important;
                position: absolute !important;
                z-index: 9999 !important;
                width: 45px !important;
                height: 28px !important;
                /* Simple animation */
                animation: simpleFishSwim 12s linear infinite !important;
                /* Force no clipping */
                clip: auto !important;
                clip-path: none !important;
                overflow: visible !important;
            }

            .fish-1 {
                bottom: 80px !important;
                left: 0px !important;
                animation-delay: 0s !important;
            }

            .fish-2 {
                bottom: 100px !important;
                left: 0px !important;
                animation-delay: 4s !important;
            }

            .fish-3 {
                bottom: 60px !important;
                left: 0px !important;
                animation-delay: 8s !important;
            }

            .fish img {
                display: block !important;
                visibility: visible !important;
                opacity: 1 !important;
                width: 100% !important;
                height: 100% !important;
                object-fit: contain !important;
            }

            /* Ensure containers don't clip */
            .ocean-scene, .mobile-frame {
                overflow: visible !important;
            }

            /* Simple animation for mobile */
            @keyframes simpleFishSwim {
                0% {
                    transform: translateX(-60px) scaleX(1);
                    opacity: 1;
                }
                25% {
                    transform: translateX(calc(50vw - 22px)) scaleX(1);
                    opacity: 1;
                }
                50% {
                    transform: translateX(calc(100vw + 60px)) scaleX(1);
                    opacity: 1;
                }
                51% {
                    transform: translateX(calc(100vw + 60px)) scaleX(-1);
                    opacity: 1;
                }
                75% {
                    transform: translateX(calc(50vw - 22px)) scaleX(-1);
                    opacity: 1;
                }
                100% {
                    transform: translateX(-60px) scaleX(-1);
                    opacity: 1;
                }
            }
        }

        /* Floating flowers */
        .flower-petal {
            position: absolute;
            width: 10px;
            height: 10px;
            background: rgba(255, 182, 193, 0.8);
            border-radius: 50% 0 50% 50%;
            transform: rotate(45deg);
            z-index: 3;
            pointer-events: none;
            animation: floatingPetal linear infinite;
        }

        @keyframes floatingPetal {
            0% {
                transform: rotate(45deg) translate(0, 0);
                opacity: 0;
            }
            10% {
                opacity: 1;
            }
            90% {
                opacity: 1;
            }
            100% {
                transform: rotate(200deg) translate(300px, 100px);
                opacity: 0;
            }
        }

        .night-mode .flower-petal {
            background: rgba(200, 160, 200, 0.6);
        }

        /* Heart beat animation */
        .heart-beat {
            position: absolute;
            font-size: 24px;
            z-index: 10;
            pointer-events: none;
            animation: heartBeat 2s forwards;
            transform: translate(-50%, -50%);
        }

        @keyframes heartBeat {
            0% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.5);
            }
            15% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1.2);
            }
            30% {
                transform: translate(-50%, -50%) scale(1);
            }
            45% {
                transform: translate(-50%, -50%) scale(1.2);
            }
            60%, 80% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1) translateY(0);
            }
            100% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(1) translateY(-50px);
            }
        }

        /* Responsive for tablet */
        @media (min-width: 415px) and (max-width: 768px) {
            .mobile-frame {
                max-width: 600px;
                width: 90%;
                height: auto;
                margin: 20px auto;
            }
        }

        /* Desktop: cố định khung mobile và căn giữa */
        @media (min-width: 769px) {
            .mobile-frame {
                max-width: 414px;
                width: 100%;
                height: auto;
                margin: 50px auto;
            }
        }

/* Desktop layout: full-width for ocean scene */
@media (min-width: 768px) {
    .mobile-frame {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        margin: 0 auto !important;
    }

    .ocean-scene {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
}

/* Enhanced Transparent Background Handling */
.transparent-bg {
    /* Special handling for images with checkered backgrounds */
    background-color: transparent !important;
    mix-blend-mode: multiply;
}

/* Xử lý đặc biệt cho bottle2.png */
.bottle2-bg {
    background-color: transparent !important;
    mix-blend-mode: multiply;
}

/* Enhanced Random Bottles Styling */
.random-bottle {
    position: absolute;
    width: 40px;
    height: 70px;
    cursor: pointer;
    z-index: 5;
    animation: none !important;
    transition: all 0.3s ease;
    /* Make container transparent */
    background-color: transparent;
    /* Add floating shadow to indicate water reflection */
    filter: drop-shadow(0 5px 8px rgba(0, 119, 190, 0.3));
}

.random-bottle:hover {
    transform: scale(1.1) !important;
    filter: drop-shadow(0 8px 15px rgba(0, 119, 190, 0.4));
}

.random-bottle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Remove background */
    background-color: transparent;
}

/* Different Bottle Types Styling */
.standard-bottle {
    /* Default styles already defined in .random-bottle */
}

.large-bottle {
    width: 50px;
    height: 90px;
    filter: drop-shadow(0 8px 12px rgba(0, 119, 190, 0.35));
}

.small-bottle {
    width: 25px;
    height: 45px;
}

.vintage-bottle {
    filter: sepia(0.3) drop-shadow(0 5px 8px rgba(100, 70, 30, 0.4));
}

/* Special bottle styling */
.special-bottle {
    width: 45px;
    height: 75px;
    filter: drop-shadow(0 5px 10px rgba(50, 120, 200, 0.45));
    animation-duration: calc(5s / var(--speed-multiplier, 1));
}

.special-bottle img {
    filter: brightness(1.05) contrast(1.1);
}

.special-bottle:hover {
    transform: scale(1.15) !important;
    filter: drop-shadow(0 10px 20px rgba(50, 120, 200, 0.6));
}

/* Enhanced floating animation with bottle type customization */
@keyframes floatRandomBottle {
    0%, 100% {
        transform: translate(0, 0) rotate(var(--rotation, 0deg));
    }
    25% {
        transform: translate(calc(4px * var(--bob-intensity, 1)),
                     calc(-6px * var(--bob-intensity, 1)))
                     rotate(calc(var(--rotation, 0deg) + (3deg * var(--bob-intensity, 1))));
    }
    50% {
        transform: translate(0, calc(-10px * var(--bob-intensity, 1)))
                     rotate(var(--rotation, 0deg));
    }
    75% {
        transform: translate(calc(-4px * var(--bob-intensity, 1)),
                     calc(-4px * var(--bob-intensity, 1)))
                     rotate(calc(var(--rotation, 0deg) - (3deg * var(--bob-intensity, 1))));
    }
}

/* Bottle animation duration adjustment based on speed multiplier */
.random-bottle {
    animation-duration: calc(6s / var(--speed-multiplier, 1));
}

/* Special visual effects for vintage bottles */
.vintage-bottle img {
    opacity: 0.9;
}

/* Enhanced Catch animation elements */
.catch-hand {
    position: absolute;
    font-size: 30px;
    z-index: 20;
    transform: translateY(0) rotate(0deg);
    transition: transform 0.3s ease-out;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
    transform-origin: center;
    pointer-events: none;
    will-change: transform;
}

/* Styles for bottles being caught */
.bottle.catching {
    z-index: 15 !important;
}

/* Animation for bottles when they're caught */
@keyframes catchBottle {
    0% { transform: translateY(0) rotate(0); }
    30% { transform: translateY(-20px) rotate(-10deg); }
    60% { transform: translateY(-15px) rotate(10deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* Special effect for splash when bottle is caught */
.splash.catch-splash::before,
.splash.catch-splash::after {
    background: rgba(255, 255, 255, 0.9);
    animation-duration: 0.8s;
}

/* Enhanced ripple when bottle is caught */
.ripple.catch-ripple {
    border-width: 3px;
    background: rgba(255, 255, 255, 0.15);
}

/* Style for the add bottles button */
.add-bottles-button {
    transition: all 0.3s ease;
}

.add-bottles-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@keyframes splash {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Hiệu ứng sáng lung linh cho chai đặc biệt */
@keyframes shimmer {
    0% {
        filter: brightness(1.0) drop-shadow(0 5px 10px rgba(50, 120, 200, 0.45));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 5px 15px rgba(70, 140, 220, 0.55));
    }
    100% {
        filter: brightness(1.0) drop-shadow(0 5px 10px rgba(50, 120, 200, 0.45));
    }
}

.special-bottle {
    animation: none !important;
}

/* Dark mode chỉ thay background biển */
.mobile-frame.night-mode .ocean-scene {
    background-image: url('../img/nightbackground.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    /* Bỏ filter nếu có */
    filter: none !important;
    background-blend-mode: normal !important;
}

/* Ẩn icon mặt trời khi ở dark mode */
.mobile-frame.night-mode .sun {
    display: none !important;
}

/* Cập nhật kích thước fish và bottle lớn hơn nữa */
.bottle-floating {
    width: 80px !important;
    height: 120px !important;
}

.fish {
    width: 50px !important;
    height: 30px !important;
}


/* Responsive tweaks cho mobile - Vertical layout */
@media (max-width: 768px) {
    /* Sắp xếp 2 nút theo chiều dọc trên mobile với safe area */
    .send-button {
        bottom: max(120px, env(safe-area-inset-bottom, 0px) + 100px);
        right: max(20px, env(safe-area-inset-right, 0px) + 15px);
        width: 45px;
        height: 45px;
        font-size: 18px;
        /* Đảm bảo nút luôn visible */
        z-index: 1000;
        position: fixed !important;
    }
    .day-night-toggle {
        bottom: max(60px, env(safe-area-inset-bottom, 0px) + 40px);
        right: max(20px, env(safe-area-inset-right, 0px) + 15px);
        width: 45px;
        height: 45px;
        font-size: 18px;
        /* Đảm bảo nút luôn visible */
        z-index: 1000;
        position: fixed !important;
    }

    /* Đảm bảo html và body có đúng height cho mobile với safe area support */
    html, body {
        height: 100% !important;
        height: calc(var(--vh, 1vh) * 100) !important; /* Custom property */
        margin: 0 !important;
        padding: 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        overflow-x: hidden !important;
    }

    /* Đảm bảo floating buttons không bị che bởi virtual keyboard */
    @supports (height: 100dvh) {
        .send-button, .day-night-toggle {
            bottom: max(120px, 20px + env(safe-area-inset-bottom, 0px));
        }
        .day-night-toggle {
            bottom: max(60px, 20px + env(safe-area-inset-bottom, 0px));
        }
    }

    /* Khắc phục ocean scene bị cắt trên mobile */
    .mobile-frame {
        width: 100% !important;
        max-width: 100% !important;
        height: calc(var(--vh, 1vh) * 100) !important; /* Sử dụng custom property */
        min-height: calc(var(--vh, 1vh) * 100) !important; /* Sử dụng custom property */
        overflow: visible !important; /* Cho phép fish hiển thị */
        margin: 0 !important;
        position: relative !important;
    }

    /* Đảm bảo top-bar luôn hiển thị trên mobile */
    .top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        z-index: 2100 !important;
        background: rgba(255, 255, 255, 0.25) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 20px !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }

    /* Inbox modal responsive cho mobile */
    #inboxModal .modal-content {
        margin-top: 60px !important;
        max-height: calc(100vh - 60px) !important;
        height: calc(100vh - 60px) !important;
        border-radius: 20px 20px 0 0 !important;
    }

    .ocean-scene {
        position: absolute !important;
        top: 60px !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        /* Force exact height calculation */
        height: calc(var(--vh, 1vh) * 100 - 60px) !important;
        min-height: calc(var(--vh, 1vh) * 100 - 60px) !important;
        max-height: calc(var(--vh, 1vh) * 100 - 60px) !important; /* Prevent overflow */
        overflow: hidden !important;
        /* Ensure it fills the space */
        display: block !important;
    }

    /* Đảm bảo fish animation visible và hoạt động mượt - Di chuyển xuống vùng nước */
    .fish {
        bottom: 80px !important;      /* Tăng bottom để cá hiển thị rõ trên mobile */
        /* Loại bỏ left và right để animation swimFish hoạt động */
        width: 50px !important;       /* Tăng size cho mobile để dễ thấy */
        height: 32px !important;
        animation: swimFish linear infinite !important; /* Đảm bảo animation hoạt động */
        z-index: 25 !important;        /* Tăng z-index cao nhất để hiển thị trên tất cả elements */
        will-change: transform, left !important; /* Tối ưu performance */
        backface-visibility: hidden !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ocean waves positioning - Điều chỉnh tỷ lệ hợp lý - Di chuyển lên cao hơn */
    .ocean-waves {
        position: absolute !important;
        bottom: 60px !important;      /* Di chuyển waves lên cao hơn cho mobile */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 120px !important;     /* Giảm height để cân đối với ocean scene */
        max-height: 25% !important;   /* Không vượt quá 25% ocean scene */
        overflow: hidden !important;
        z-index: 4 !important;
    }
}

@media (max-width: 414px) {
    /* Mobile nhỏ - giữ layout dọc nhưng compact hơn với safe area */
    .send-button {
        bottom: max(110px, env(safe-area-inset-bottom, 0px) + 90px);
        right: max(15px, env(safe-area-inset-right, 0px) + 10px);
        width: 40px;
        height: 40px;
        font-size: 16px;
        /* Tăng touch target cho mobile nhỏ */
        min-width: 44px;
        min-height: 44px;
        position: fixed !important;
        z-index: 1001;
    }
    .day-night-toggle {
        bottom: max(55px, env(safe-area-inset-bottom, 0px) + 35px);
        right: max(15px, env(safe-area-inset-right, 0px) + 10px);
        width: 40px;
        height: 40px;
        font-size: 16px;
        /* Tăng touch target cho mobile nhỏ */
        min-width: 44px;
        min-height: 44px;
        position: fixed !important;
        z-index: 1001;
    }

    /* Ocean scene mobile fixes */
    .mobile-frame {
        height: calc(var(--vh, 1vh) * 100) !important; /* Sử dụng custom property */
        min-height: calc(var(--vh, 1vh) * 100) !important; /* Sử dụng custom property */
    }

    /* Top-bar responsive cho mobile nhỏ */
    .top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        z-index: 2100 !important;
        background: rgba(255, 255, 255, 0.3) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        padding: 0 15px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }

    /* Inbox modal responsive cho mobile nhỏ */
    #inboxModal .modal-content {
        margin-top: 60px !important;
        max-height: calc(100vh - 60px) !important;
        height: calc(100vh - 60px) !important;
        border-radius: 16px 16px 0 0 !important;
    }

    .ocean-scene {
        top: 60px !important;
        bottom: 0 !important;
        height: calc(var(--vh, 1vh) * 100 - 60px) !important; /* Sử dụng height với custom property */
        min-height: calc(var(--vh, 1vh) * 100 - 60px) !important; /* Sử dụng custom property */
        width: 100% !important;
    }

    /* Kích thước chai và cá nhỏ gọn hơn */
    .bottle-floating {
        width: 60px !important;
        height: 90px !important;
    }
    .fish {
        width: 45px !important;
        height: 28px !important;
        bottom: 70px !important;      /* Tăng bottom để cá hiển thị rõ trên mobile */
        animation: swimFish linear infinite !important; /* Đảm bảo animation */
        z-index: 25 !important;        /* Tăng z-index cao nhất để hiển thị trên tất cả elements */
        will-change: transform, left !important;
        backface-visibility: hidden !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Extra small mobile */
@media (max-width: 360px) {
    .mobile-frame {
        height: calc(var(--vh, 1vh) * 100) !important; /* Sử dụng custom property */
        min-height: calc(var(--vh, 1vh) * 100) !important; /* Sử dụng custom property */
    }

    /* Top-bar responsive cho extra small mobile */
    .top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        z-index: 2100 !important;
        background: rgba(255, 255, 255, 0.35) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 0 12px !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
    }

    /* Inbox modal responsive cho extra small mobile */
    #inboxModal .modal-content {
        margin-top: 60px !important;
        max-height: calc(100vh - 60px) !important;
        height: calc(100vh - 60px) !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .ocean-scene {
        top: 60px !important;
        bottom: 0 !important;
        height: calc(var(--vh, 1vh) * 100 - 60px) !important; /* Sử dụng height với custom property */
        min-height: calc(var(--vh, 1vh) * 100 - 60px) !important; /* Sử dụng custom property */
        width: 100% !important;
    }

    .fish {
        bottom: 65px !important;      /* Tăng bottom để cá hiển thị rõ trên mobile */
        animation: swimFish linear infinite !important;
        z-index: 25 !important;        /* Tăng z-index cao nhất để hiển thị trên tất cả elements */
        will-change: transform, left !important;
        backface-visibility: hidden !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Đảm bảo fish cụ thể có animation duration và vị trí */
    .fish-1 {
        animation: swimFish 15s linear infinite !important;
        animation-delay: 0s !important;
        bottom: 75px !important;
        z-index: 25 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .fish-2 {
        animation: swimFish 20s linear infinite !important;
        animation-delay: 5s !important;
        bottom: 90px !important;
        z-index: 25 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .fish-3 {
        animation: swimFish 18s linear infinite !important;
        animation-delay: 8s !important;
        bottom: 60px !important;
        z-index: 25 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .ocean-waves {
        position: absolute !important;
        bottom: 50px !important;      /* Di chuyển waves lên cao hơn */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 80px !important;      /* Giảm height waves cho mobile nhỏ */
        max-height: 20% !important;
        overflow: hidden !important;
        z-index: 4 !important;
    }

    /* Extra small mobile floating buttons */
    .send-button {
        bottom: max(100px, env(safe-area-inset-bottom, 0px) + 80px);
        right: max(12px, env(safe-area-inset-right, 0px) + 8px);
        width: 38px;
        height: 38px;
        font-size: 14px;
        min-width: 44px;
        min-height: 44px;
        position: fixed !important;
        z-index: 1002;
    }

    .day-night-toggle {
        bottom: max(50px, env(safe-area-inset-bottom, 0px) + 30px);
        right: max(12px, env(safe-area-inset-right, 0px) + 8px);
        width: 38px;
        height: 38px;
        font-size: 14px;
        min-width: 44px;
        min-height: 44px;
        position: fixed !important;
        z-index: 1002;
    }
}

/* Responsive cho tablet - removed conflicts */

/* Button Gửi trong modal */
.confirm-send-button {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}
.confirm-send-button:hover {
    background: linear-gradient(135deg, #F57C00, #FF9800);
}

/* UI chọn loại chai trong modal */
.bottle-selector {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}
.bottle-type-option {
    width: 30px;
    height: 50px;
    opacity: 0.6;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: opacity 0.3s, border 0.3s;
    cursor: pointer;
    margin: 0 5px;
}
.bottle-type-option.selected {
    opacity: 1;
    border-color: #FF9800;
}

/* Modal footer button styles with icon */
.modal-footer {
    display: flex;
    justify-content: center;
    gap: 20px; /* tăng khoảng cách giữa các nút */
    margin-top: 15px;
}

.modal-footer .action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px; /* tăng padding để chứa icon và text */
    border-radius: 20px;
    background: #80DEEA !important;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    width: auto; /* override width mặc định */
    height: auto; /* override height mặc định */
}
.modal-footer .action-btn:hover {
    background: #4FC3F7;
}

.btn-icon {
    width: 32px; /* tăng kích thước icon */
    height: 32px;
}

.btn-label {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

/* Hộp thư (thread list) */
.thread-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.thread-item {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}
.thread-item:hover {
  background: #f0f0f0;
}
/* Bubbles trong cuộc trò chuyện */
.message-bubble {
  margin: 5px 0;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 80%;
  word-wrap: break-word;
  display: inline-block;
}
.message-bubble.sender {
  background: #d1e7dd;
  align-self: flex-end;
}
.message-bubble.receiver {
  background: #f8d7da;
  align-self: flex-start;
}
.thread-reply {
  display: flex;
  gap: 10px;
  padding: 10px 0;
}
.thread-reply textarea {
  flex: 1;
  height: 60px;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px;
}
.thread-reply button {
  padding: 8px 12px;
  background: #80DEEA;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.thread-reply button:hover {
  background: #4FC3F7;
}

/* Xử lý văn bản dài trong hộp thư và conversation */
.thread-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-bubble {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Inbox Modal layout adjustments */
#inboxModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    margin-top: 60px !important; /* Ensure margin-top is applied */
}
#inboxModal .modal-header {
    flex: 0 0 auto;
}
#inboxModal .story-container {
    flex: 0 0 auto;
    margin: 0 16px 8px;
}
#inboxModal .thread-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}
.thread-item {
    margin: 8px 16px;
}

/* Inbox modal redesign */
#inboxModal .modal-content {
  max-width: 100%;
  width: 100%;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-top: 60px !important; /* Ensure margin-top is applied */
}
#inboxModal .modal-header {
  background: linear-gradient(135deg, #FFB6C1, #F8BBD0) !important;
  color: white;
  padding: 20px;
  font-size: 20px;
  font-weight: bold;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
}
#inboxModal .thread-list {
  padding: 12px 16px;
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
}
.thread-item {
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-weight: 500;
  color: #333;
  cursor: pointer;
}
.thread-item:nth-child(odd) {
  background: #ffe6f2; /* pastel pink */
}
.thread-item:nth-child(even) {
  background: #f0e6ff; /* pastel lavender */
}
.thread-item:hover {
  opacity: 0.8;
}

/* Timestamp và read/unread styling */
.thread-item.unread {
  font-weight: 600;
}
.bubble-time {
  display: block;
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}
.bubble-text {
  display: block;
}

/* Avatar trong thread-item */
.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  position: relative;
  overflow: visible;
}
/* Badge số unread overlay trên avatar */
.thread-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background-color: #ec4899; /* hồng chủ đạo */
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700; /* tăng độ đậm để dễ đọc */
  text-shadow: 0 1px 0 rgba(0,0,0,0.15); /* tăng độ nổi chữ */
  z-index: 5;
  box-shadow: 0 0 0 2px #fff; /* viền trắng tách khỏi avatar */
  pointer-events: none; /* không chặn click vào thread */
}

/* Bảo đảm KHÔNG còn bất kỳ pseudo-element tạo dấu chấm nào cho thread-item */
.thread-item.unread::before,
.thread-item.unread::after,
.thread-item .thread-avatar::before,
.thread-item .thread-avatar::after,
.thread-item .thread-author::before,
.thread-item .thread-message::before {
  content: none !important;
  display: none !important;
}
.thread-content {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Cập nhật thread-item để căn flex */
.thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Style cho chế độ gửi ẩn danh */
.anonymous-option {
    margin: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
}
.anonymous-option input[type="checkbox"] {
    margin-right: 6px;
}

/* Emoji picker styles */
.emoji-toggle {
  cursor: pointer;
  font-size: 20px;
  margin: 8px 0;
}
.emoji-picker {
  display: none;
  position: absolute;
  bottom: 80px;
  left: 20px;
  right: 20px;
  max-height: 200px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  padding: 8px;
  overflow-y: auto;
  z-index: 2500;
  display: grid;
  grid-template-columns: repeat(8,1fr);
  gap: 6px;
}
.emoji-item {
  font-size: 18px;
  cursor: pointer;
  text-align: center;
}
.emoji-item:hover {
  background: #f0f0f0;
  border-radius: 4px;
}

/* Location display in send modal */
.location-display {
    width: 100%;
    margin-bottom: 10px;
    font-size: 14px;
    color: #455A64;
}
.location-display span {
    font-weight: bold;
}


/* Micro-interactions & animations */
@keyframes shakeBottle {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-2px) rotate(-2deg); }
  50% { transform: translateX(2px) rotate(2deg); }
  75% { transform: translateX(-2px) rotate(-2deg); }
}
.bottle:hover, .bottle-floating:hover {
  animation: none !important;
  box-shadow: 0 0 8px rgba(255, 105, 180, 0.8);
}

.heart-particle {
  position: absolute;
  font-size: 16px;
  pointer-events: none;
  opacity: 1;
  animation: heartFloat 1s ease-out forwards;
}
@keyframes heartFloat {
  0% { transform: translateY(0) scale(0.5); opacity: 1; }
  100% { transform: translateY(-50px) scale(1); opacity: 0; }
}

.modal-petal {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  user-select: none;
  animation: modalPetalFall 1.5s ease-out forwards;
}
@keyframes modalPetalFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(150px) rotate(360deg); opacity: 0; }
}

.pulse-animation {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}


/* Inbox stories carousel */
.story-carousel {
    display: flex;
    gap: 12px;
    padding: 8px 16px;
    overflow-x: auto;
}
.story-item {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
}
.story-avatar-icon, .thread-avatar-icon {
    font-size: 28px;
    color: #888;
}
.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.add-story {
    background: #e0f7fa;
    color: #00796b;
    font-size: 24px;
}

/* Inbox card */
.thread-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
    margin: 0 16px;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.thread-item:last-child {
    border-bottom: none;
}
.thread-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.thread-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.thread-author {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.thread-message {
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.thread-meta {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.thread-time {
    font-size: 12px;
    color: #999;
}


/* Chat view background on modal-content */
#inboxModal .modal-content.chat-view {
    background-image: url('../img/chatbox.jpg?v=2');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
}
/* Chat view background and input styling */
 #inboxModal .modal-content.chat-view {
     background-image: url('../img/chatbox.jpg?v=2');
     background-repeat: no-repeat;
     background-position: center top;
     background-size: cover;
     padding: 80px 0 120px;
 }
 #inboxModal .modal-content.chat-view .thread-list {
     background: transparent;
     padding: 0 16px !important;
     margin: 0 !important;
     max-height: calc(100% - 200px);
 }
 .thread-reply {
     position: absolute;
     bottom: 16px;
     left: 16px;
     right: 16px;
 }
 .thread-reply textarea {
     flex: 1;
     padding: 16px 20px;
     border-radius: 28px;
     border: none;
     font-size: 16px;
     min-height: 60px;
     resize: none;
 }
 .thread-reply button {
     width: 56px;
     height: 56px;
     border-radius: 50%;
     background: #f8bbd0;
     color: #fff;
     border: none;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 22px;
 }


/* Chatbox modal styling - Responsive height */
.chat-modal .modal-content.chat-content {
    width: 360px;
    max-width: 90%;
    /* Responsive height được định nghĩa trong chat-modal.css */
    height: auto;
    max-height: 80vh;
    min-height: 400px;
    border-radius: 16px;
    overflow: hidden;
}
.chat-modal {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}
.chat-content {
    display: flex;
    flex-direction: column;
    background-image: url('../img/chatbox.jpg?v=2');
    background-size: cover;
}
.chat-header {
    height: 80px;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
}
.chat-header .back-button {
    margin-right: 0;
}
.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}
/* Typing indicator text shown when user or other party is typing */
.typing-indicator {
    font-size: 12px;
    color: #555;
    padding: 4px 16px;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-message {
    max-width: 75%;
    padding: 12px;
    border-radius: 12px;
}
/* Sender name label in chat bubbles */
.chat-message .sender-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

/* Message styling for conversation system */
.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 100%;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message .message-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: #FFB6C1 !important;
    color: #333;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message.received .message-bubble {
    background: #E1BEE7 !important;
    color: #333;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

/* Sender name styling */
.message .sender-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #666;
    opacity: 0.8;
}

/* Message time styling */
.message .message-time {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    opacity: 0.7;
}

.message.sent .message-time {
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.message .sender-name {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #666;
    opacity: 0.8;
}

.message .message-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.message .message-time {
    font-size: 10px;
    color: #666;
    opacity: 0.7;
    text-align: right;
}
.chat-message.incoming {
    align-self: flex-start;
    background: #C8E6C9; /* pastel green */
    padding: 12px;
    border-radius: 16px;
    margin: 8px 0;
    color: #333;
}
.chat-message.outgoing {
    align-self: flex-end;
    background: #FFCDD2; /* pastel pink */
    padding: 12px;
    border-radius: 16px;
    margin: 8px 0;
    color: #333;
}
.chat-input {
    flex: 0 0 80px;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.7);
}
.chat-input textarea {
    flex: 1;
    min-height: 48px;
    border-radius: 24px;
    border: none;
    padding: 12px;
    font-size: 14px;
}
.chat-input button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f8bbd0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}


/* Inbox Modal - Modern Redesign - HIGH SPECIFICITY */
#inboxModal .modal-content {
  max-width: 100% !important;
  width: 100% !important;
  max-height: calc(100vh - 60px) !important;
  height: calc(100vh - 60px) !important;
  margin-top: 60px !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  background-color: transparent !important;
  background-image: url("../img/chatbox.jpg") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* FORCE margin-top on mobile devices - HIGHEST SPECIFICITY */
/* Override CSS reset with ultra-high specificity */
div#inboxModal.modal .modal-content,
div#inboxModal .modal-content,
#inboxModal.modal .modal-content,
#inboxModal .modal-content {
  margin-top: 60px !important;
  max-height: calc(100vh - 60px) !important;
  height: calc(100vh - 60px) !important;
}

@media (max-width: 768px) {
  div#inboxModal.modal .modal-content,
  div#inboxModal .modal-content,
  #inboxModal.modal .modal-content,
  #inboxModal .modal-content {
    margin-top: 60px !important;
    max-height: calc(100vh - 60px) !important;
    height: calc(100vh - 60px) !important;
  }
}

@media (max-width: 414px) {
  div#inboxModal.modal .modal-content,
  div#inboxModal .modal-content,
  #inboxModal.modal .modal-content,
  #inboxModal .modal-content {
    margin-top: 60px !important;
    max-height: calc(100vh - 60px) !important;
    height: calc(100vh - 60px) !important;
  }
}

@media (max-width: 360px) {
  div#inboxModal.modal .modal-content,
  div#inboxModal .modal-content,
  #inboxModal.modal .modal-content,
  #inboxModal .modal-content {
    margin-top: 60px !important;
    max-height: calc(100vh - 60px) !important;
    height: calc(100vh - 60px) !important;
  }
}

/* Landscape and low height screens */
@media (max-height: 600px) {
  div#inboxModal.modal .modal-content,
  div#inboxModal .modal-content,
  #inboxModal.modal .modal-content,
  #inboxModal .modal-content {
    margin-top: 50px !important;
    max-height: calc(100vh - 50px) !important;
    height: calc(100vh - 50px) !important;
  }
}

#inboxModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #6a3de8;
  color: white;
  z-index: 10;
}

#inboxModal .modal-title {
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  flex: 1;
  text-align: center;
}

#inboxModal .back-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
}

#inboxModal .header-actions {
  display: flex;
  gap: 16px;
}

#inboxModal .search-icon,
#inboxModal .settings-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
}

/* Header search input */
#inboxModal .search-input {
  display: none;
  flex: 1;
  margin: 0 8px;
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
}
#inboxModal .modal-header.search-active .search-input {
  display: block;
}
#inboxModal .modal-header.search-active .modal-title,
#inboxModal .modal-header.search-active .header-actions {
  display: none;
}

/* Search close icon */
#inboxModal .search-close-icon {
  display: none;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  margin-left: 8px;
}
#inboxModal .modal-header.search-active .search-close-icon {
  display: flex;
}

/* Stories section - Simplified */
.stories-container {
  display: flex;
  padding: 16px;
  gap: 12px;
  overflow-x: auto;
  background: transparent !important;
  margin-bottom: 0;
  border-bottom: none !important;
  scrollbar-width: none; /* Firefox */
  position: relative;
}

.stories-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
  position: relative;
}

.story-avatar,
.story-add-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.story-avatar {
  background: #ffffff;
  position: relative;
  overflow: hidden;
  border: 2px solid #e0e0e0;
}

.story-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.story-add-icon {
  background: #f5f5f5;
  border: 1px dashed #6a3de8;
}

.story-add-icon i {
  font-size: 20px;
  color: #6a3de8;
}

.story-label {
  display: none !important;
}

/* Online status indicator */
.story-online-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #4CAF50;
  border-radius: 50%;
  border: 2px solid white;
}

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

/* Tabs styling - Simplified */
.inbox-tabs {
  display: flex;
  background: transparent !important;
  padding: 0;
  border-bottom: none !important;
}

.tab-item {
  flex: 1;
  text-align: left;
  padding: 12px 16px;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-item i {
  font-size: 14px;
}

.tab-item.active {
  color: #000;
  font-weight: 600;
}

/* Thread list styling */
.thread-list {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  padding: 12px 16px;
}

.thread-item {
  display: flex;
  padding: 16px;
  background: rgba(255,255,255,0.85) !important;
  margin: 0 0 8px;
  cursor: pointer;
  position: relative;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.thread-item:nth-child(odd),
.thread-item:nth-child(even) {
  background: rgba(255,255,255,0.85) !important;
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  position: relative;
  flex-shrink: 0;
}

.thread-avatar-icon {
  font-size: 24px;
  color: #999;
}

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

.thread-header {
  margin-bottom: 4px;
}

.thread-author {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.thread-message-wrapper {
  display: flex;
  align-items: center;
  color: #666;
  font-size: 13px;
}

.thread-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.thread-time {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.status-icon {
  font-size: 12px;
  color: #6a3de8;
  margin-left: 4px;
}

/* Read status checkmark */
.read-check {
  color: #6a3de8;
  font-size: 14px;
  position: absolute;
  bottom: 16px;
  right: 16px;
}


/* Chat view styling */
#inboxModal .modal-content.chat-view {
  background-image: url("../img/chatbox.jpg");
  background-size: cover;
  background-position: center;
}

.thread-list.chat-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background: transparent;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chat-user-name {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}

.message-bubble {
  max-width: 80%;
  margin-bottom: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.message-bubble.sender {
  align-self: flex-end;
}

.message-bubble.receiver {
  align-self: flex-start;
}

.bubble-content {
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
}

.message-bubble.sender .bubble-content {
  background: #FFB6C1;
  color: #333;
  margin-left: auto;
}

.message-bubble.receiver .bubble-content {
  background: #E1BEE7;
  color: #333;
  margin-right: auto;
}

.bubble-text {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.bubble-time {
  font-size: 11px;
  color: #999;
  margin-right: 4px;
}

.read-status {
  font-size: 12px;
  color: #6a3de8;
}

/* Reply input area */
.thread-reply {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.8);
  position: relative;
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.05);
}

#threadReplyInput {
  flex: 1;
  border: none;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 14px;
  background: #ffffff;
  resize: none;
  min-height: 45px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#threadReplyInput:focus {
  outline: none;
}

#threadReplyBtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #6a3de8;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Compose button */
.compose-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FFB6C1 !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 3000;
}
/* Hide stories section only */
.stories-container {
  display: none !important;
}

/* Cute pastel backgrounds for message cards */
.thread-item {
  background: #FFF1F3 !important;
}
.thread-item:nth-child(even) {
  background: #E3F2FD !important;
}

/* Chat view enhancements: date separator & bubble pastel colors */
.date-separator {
  display: inline-block;
  background: rgba(255, 255, 255, 0.7) !important;
  border-radius: 12px;
  padding: 4px 12px;
  margin: 12px auto;
  font-size: 12px;
  color: #555;
}
.message-bubble.sender .bubble-content {
  background: #FFB6C1 !important;
  color: #333;
  margin-left: auto;
}
.message-bubble.receiver .bubble-content {
  background: #E1BEE7 !important;
  color: #333;
  margin-right: auto;
}

/* Send Modal styling */
#sendModal .modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 0;
  max-width: 360px;
}
#sendModal .modal-header {
  background: linear-gradient(135deg, #FFB6C1, #F8BBD0);
  padding: 16px;
  display: flex;
  align-items: center;
  color: #fff;
  position: relative;
}
#sendModal .modal-header .back-button {
  color: #fff;
}
#sendModal .modal-header .modal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 18px;
  font-weight: 600;
}
#sendModal .bottle-preview {
  text-align: center;
  padding: 16px 0 8px;
}
#sendModal .location-display {
  text-align: center;
  font-size: 14px;
  color: #555;
  padding: 0 16px 12px;
}
#sendModal .message-input {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 16px;
  resize: none;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #fafafa;
  min-height: 250px;
  box-sizing: border-box;
}

#sendModal .message-input:focus {
  outline: none;
  border-color: #ff6b9d;
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
  background: white;
}

#sendModal .message-input::placeholder {
  color: #999;
  font-size: 15px;
}

/* Điều chỉnh waves cho thiết bị có chiều cao nhỏ */
@media (max-height: 600px) and (max-width: 768px) {
    .ocean-waves {
        height: 80px !important;
        max-height: 15% !important;
    }

    .fish {
        bottom: 55px !important;      /* Tăng bottom để cá hiển thị rõ trên mobile nhỏ */
        z-index: 25 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Top-bar cho màn hình thấp */
    .top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 50px !important; /* Giảm height cho màn hình thấp */
        z-index: 2100 !important;
        background: rgba(255, 255, 255, 0.4) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 0 15px !important;
        font-size: 14px !important;
    }

    /* Điều chỉnh ocean-scene cho header nhỏ hơn */
    .ocean-scene {
        top: 50px !important;
        height: calc(100vh - 50px) !important;
    }

    /* Inbox modal cho màn hình thấp */
    #inboxModal .modal-content {
        margin-top: 50px !important;
        max-height: calc(100vh - 50px) !important;
        height: calc(100vh - 50px) !important;
    }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 50px !important; /* Giảm height cho landscape */
        z-index: 2100 !important;
        background: rgba(255, 255, 255, 0.4) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 0 15px !important;
        font-size: 14px !important;
    }

    .ocean-scene {
        top: 50px !important;
        height: calc(100vh - 50px) !important;
        min-height: calc(100vh - 50px) !important;
    }

    /* Điều chỉnh avatar và icons cho landscape */
    .avatar {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }

    .top-icon {
        font-size: 16px !important;
    }

    /* Inbox modal cho landscape */
    #inboxModal .modal-content {
        margin-top: 50px !important;
        max-height: calc(100vh - 50px) !important;
        height: calc(100vh - 50px) !important;
    }
}

/* Responsive design for message input */
@media (max-width: 768px) {
  #sendModal .message-input {
    min-height: 220px;
    padding: 18px;
    font-size: 16px; /* Prevent zoom on iOS */
    margin: 0 12px 12px;
    width: calc(100% - 24px);
  }

  #sendModal .message-input::placeholder {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  #sendModal .message-input {
    min-height: 200px;
    padding: 16px;
    margin: 0 8px 12px;
    width: calc(100% - 16px);
    border-radius: 14px;
  }

  #sendModal .message-input::placeholder {
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  #sendModal .message-input {
    min-height: 180px;
    padding: 14px;
    border-radius: 12px;
  }
}

/* Responsive design for conversation messages */
@media (max-width: 768px) {
  .message .message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 14px;
  }

  .message .sender-name {
    font-size: 10px;
  }

  .message .message-time {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .message .message-bubble {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 16px;
  }

  .message .message-text {
    font-size: 13px;
  }
}
#sendModal .anonymous-option {
  padding: 0 16px 12px;
}
#sendModal .anonymous-option label {
  font-size: 14px;
  color: #555;
  cursor: pointer;
}
#sendModal .emoji-toggle {
  position: absolute;
  right: 24px;
  top: 60px;
  color: #FFB6C1;
  font-size: 24px;
  cursor: pointer;
}
#sendModal .emoji-picker {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  background: #fff;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#sendModal .confirm-send-button {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  background: #FFB6C1;
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
#sendModal .confirm-send-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


/* Separator nhóm ngày trong inbox */
.date-separator {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #455A64;
  background: rgba(240, 240, 240, 0.8);
  margin: 8px 16px;
  border-radius: 4px;
}


/* Mark all read button in inbox header */
#inboxModal .mark-all-read {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
}
#inboxModal .mark-all-read:hover {
  text-decoration: underline;
}


/* Highlight active tab in inbox */
#inboxModal .inbox-tabs .tab-item.active {
  background-color: rgba(255, 87, 34, 0.1);
  border-radius: 24px;
  color: #FF5722;
}
#inboxModal .inbox-tabs .tab-item.active i,
#inboxModal .inbox-tabs .tab-item.active span {
  color: #FF5722;
}


/* Empty inbox improved design */
.empty-inbox {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}
.empty-inbox .empty-icon {
  font-size: 60px;
  color: #FF5722;
  margin-bottom: 16px;
}
.empty-inbox .empty-text {
  font-size: 18px;
  color: #666;
  margin-bottom: 20px;
}
.empty-inbox .empty-action-btn {
  background: #FF5722;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  cursor: pointer;
}
.empty-inbox .empty-action-btn i {
  margin-right: 8px;
}
.empty-inbox .empty-action-btn:hover {
  background: #E64A19;
}


/* Spinner overlay khi tải inbox */
.spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #FF5722;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Thread action buttons styling */
.thread-item { position: relative; }
.thread-item .delete-thread,
.thread-item .friend-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
    border-radius: 50%;
}
.thread-item .delete-thread { right: 12px; }
.thread-item .delete-thread:hover {
    background: #ffebee;
    color: #c62828;
}
.thread-item .friend-btn { right: 48px; }
.thread-item .friend-btn:hover {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Dropdown menu for inbox settings */
.inbox-options-dropdown {
  position: absolute;
  top: 56px;
  right: 16px;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: none;
  z-index: 3001;
  min-width: 180px;
}
.inbox-options-dropdown .option-item {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 1px solid #eee;
}
.inbox-options-dropdown .option-item:hover {
  background: #f5f5f5;
}
.inbox-options-dropdown .option-item:last-child {
  border-bottom: none;
}
.inbox-options-dropdown.active {
  display: block;
}

/* Force pastel backgrounds in inbox modal thread list */
#inboxModal .thread-list .thread-item:nth-child(odd) {
  background: #ffe6f2 !important;
}
#inboxModal .thread-list .thread-item:nth-child(even) {
  background: #f0e6ff !important;
}

/* Random gentle pastel backgrounds for threads */
.thread-bg-1 { background: #ffe6f2 !important; }
.thread-bg-2 { background: #f0e6ff !important; }
.thread-bg-3 { background: #e6fff5 !important; }
.thread-bg-4 { background: #fff5e6 !important; }
.thread-bg-5 { background: #f5e6ff !important; }

/* Reset hard-coded nth-child pastel backgrounds to allow random colors */
#inboxModal .thread-list .thread-item:nth-child(odd),
#inboxModal .thread-list .thread-item:nth-child(even) {
  background: none !important;
}

/* Profile Modal styles */
.profile-modal .modal-content {
    max-width: 360px;
    width: 90%;
    background: #fff;
    border-radius: 20px;
    padding: 16px;
}
.profile-modal .profile-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
}
.profile-modal .profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}
.profile-modal .profile-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #333;
}

/* Friends List view styling: card-like thread items */
#inboxModal .modal-content.friends-view .thread-item {
    background: #fff !important;
    border-radius: 12px;
    margin: 8px 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-bottom: none !important;
}
#inboxModal .modal-content.friends-view .thread-item + .thread-item {
    margin-top: 8px;
}

/* Alternate Friends List layout under friends-view */
#inboxModal .modal-content.friends-view .thread-item:not(.friend) {
    display: none !important;
}
#inboxModal .modal-content.friends-view .thread-item {
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 4px 16px !important;
    padding: 8px 12px !important;
    display: flex !important;
    align-items: center !important;
    border-bottom: 1px solid #e0e0e0 !important;
}
#inboxModal .modal-content.friends-view .thread-avatar {
    flex: none;
}
#inboxModal .modal-content.friends-view .thread-avatar-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
#inboxModal .modal-content.friends-view .thread-info {
    flex: 1;
    margin-left: 12px;
}
#inboxModal .modal-content.friends-view .thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#inboxModal .modal-content.friends-view .thread-time,
#inboxModal .modal-content.friends-view .thread-message-wrapper,
#inboxModal .modal-content.friends-view .delete-thread,
#inboxModal .modal-content.friends-view .friend-btn {
    display: none !important;
}

/* Hide date separators in friends view */
#inboxModal .modal-content.friends-view .date-separator {
    display: none !important;
}

/* Pending friend request button state */
.thread-item .friend-btn.pending {
    background: #e8f5e9;
    color: #2e7d32;
}
.thread-item .friend-btn.pending i {
    color: #2e7d32;
}
.thread-item .friend-btn.pending:hover {
    background: #c8e6c9;
}

/* Friend requests badge */
.friend-requests-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Accept/Reject buttons for friend requests */
.thread-item .friend-btn.accept-btn:hover {
    background: #c8e6c9 !important;
}
.thread-item .friend-btn.reject-btn:hover {
    background: #ffcdd2 !important;
}

/* Smooth animations for thread items */
.thread-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Friend request processed state */
.thread-item.friend-accepted {
    background: #e8f5e9 !important;
    border-left: 4px solid #4caf50;
}

/* Animation for removing items */
.thread-item.removing {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

/* Profile modal header back-button styling */
.profile-modal .modal-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}
.profile-modal .modal-header .back-button {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    background: #E0F7FA;
    color: #455A64;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.profile-modal .modal-header .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #455A64;
}

/* Profile modal redesigned styles */
.profile-modal .profile-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 16px;
}
.profile-modal .profile-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
}
.profile-modal .profile-name {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}
.profile-modal .profile-stats {
  font-size: 14px;
  color: #555;
}
.profile-modal .profile-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-modal .detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.profile-modal .detail-icon {
  font-size: 16px;
  color: #6a3de8;
}
.profile-modal .detail-label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}
.profile-modal .detail-value {
  font-size: 14px;
  color: #333;
}

/* Profile modal meta styling */
.profile-modal .profile-meta {
  display: flex;
  justify-content: space-around;
  margin: 8px 0;
}
.profile-modal .profile-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
}
.profile-modal .profile-meta .meta-item i {
  color: #6a3de8;
}

/* Profile modal meta alignment override */
.profile-modal .profile-meta {
    display: block;
    margin: 8px 0;
    text-align: left;
}
.profile-modal .profile-meta .meta-item {
    display: inline-block;
    white-space: nowrap;
    margin: 0 12px;
}

/* Force left-align all profile modal content */
.profile-modal .modal-content {
    text-align: left !important;
}

/* Profile modal meta alignment refined */
.profile-modal .profile-meta {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 8px 0 !important;
}
.profile-modal .profile-meta .meta-item {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
}

/* Profile modal updated styles for new design */
.profile-modal .modal-content {
    max-width: 320px;
    width: 90%;
    background: #fff;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.profile-modal .modal-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.profile-modal .modal-header .back-button {
    width: 32px;
    height: 32px;
    margin-right: 12px;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-modal .modal-header .back-button:hover {
    background: #dee2e6;
}

.profile-modal .modal-header .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

.profile-modal .profile-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    gap: 16px;
}

.profile-modal .profile-avatar {
    margin-bottom: 8px;
}

.profile-modal .profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #f472b6;
    object-fit: cover;
}

.profile-modal .profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.profile-modal .profile-stats {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-modal .profile-stats i {
    color: #f472b6;
}

.profile-modal .profile-info-list {
    width: 100%;
    text-align: left;
    margin: 16px 0;
}

.profile-modal .profile-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #374151;
}

.profile-modal .profile-info-item i {
    color: #f472b6;
    width: 16px;
    text-align: center;
}

.profile-modal .profile-bio,
.profile-modal .profile-hobbies {
    margin: 8px 0 16px 24px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.profile-modal .profile-message-btn {
    width: 100%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-modal .profile-message-btn:hover {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}


/* --- Static fish placement override (2025-08-11) --- */
/* Ensures exactly-placed fish do not animate and use top/left within ocean bounds */
.fish.static {
  animation: none !important;
  bottom: auto !important;
}

/* --- Static clouds and birds (2025-08-14) --- */
/* Pause cloud movement when marked static; keep pseudo-elements consistent */
.cloud.static,
.cloud.static::before,
.cloud.static::after {
  animation: none !important;
  transform: none !important;
}
/* Ensure offscreen defaults become visible when static */
.cloud2.static { left: 180px !important; }
.cloud3.static { left: 280px !important; }

/* Pause seagull flight when marked static and keep them visible */
.seagull.static {
  animation: none !important;
  transform: none !important;
  left: 20px !important; /* bring into view instead of -20px */
}

/* --- Disable ocean waves for performance (2025-08-14) --- */
.ocean-waves { display: none !important; }
.wave { animation: none !important; }



/* --- Performance mode: pause animations to reduce heat on mobile --- */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-play-state: paused !important;
  transition: none !important;
}
