/* NÂNG CẤP: Quay trở lại Giao diện Tối (Dark Theme) */
body {
    font-family: 'Open Sans', sans-serif;
    background-color: #131314;
    /* Màu nền chính */
    color: #e5e7eb;
    overflow-x: hidden;
    /* Ngăn cuộn ngang */
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* Liquid Glass Menu */
.nav-container {
    position: relative;
}

.nav-glass-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    /* NÂNG CẤP: Làm sáng màu nền và tăng độ mờ */
    background-color: rgba(229, 231, 235, 0.1); /* gray-200 with 10% opacity */
    border: 1px solid rgba(156, 163, 175, 0.3); /* gray-400 with 30% opacity */
    border-radius: 9999px;
    /* rounded-full */
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: -1;
    backdrop-filter: blur(8px); /* Tăng độ mờ */
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
    padding: 8px 16px;
    /* Thêm padding để có không gian cho background */
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link img {
    height: 20px;
}

.nav-link.active {
    color: #e5e7eb;
    /* Màu chữ khi active */
}

#nav-resources.nav-link,
#nav-contact.nav-link {
    color: #facc15;
}

#nav-resources.nav-link.active,
#nav-resources.nav-link:hover,
#nav-contact.nav-link.active,
#nav-contact.nav-link:hover {
    color: #fde047;
    /* Sáng hơn khi active */
}

.service-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out, opacity 0.6s ease-in-out, margin-top 0.6s ease-in-out;
    opacity: 0;
    margin-top: 0;
}

.service-card:hover .service-card-content {
    max-height: 500px;
    opacity: 1;
    margin-top: 1rem;
}

.service-card-wrapper {
    position: relative;
    border-radius: 0.8rem;
    overflow: hidden;
    padding: 0;
    z-index: 1;
    background-color: transparent;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.service-card-wrapper:hover {
    transform: translateY(-12px) scale(1.02);
}

/* NÂNG CẤP 2: Hiệu ứng viền chạy liên tục */
.service-card-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* NÂNG CẤP 2: Gradient nhiều màu hơn */
    background-image: linear-gradient(120deg, #a855f7, #ec4899, #facc15, #0ea5e9, #a855f7);
    /* NÂNG CẤP 2: Tăng background-size */
    background-size: 500% 500%;
    /* NÂNG CẤP 2: Tăng thời gian animation */
    animation: glow-border 8s linear infinite; /* Đổi tên animation */
    z-index: -1;
    border-radius: inherit;
    /* NÂNG CẤP 2: Luôn hiển thị viền */
    opacity: 1;
    transition: opacity 0.4s ease-out;
    padding: 2px;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
}

/* NÂNG CẤP 2: Xóa hiệu ứng opacity khi hover (vì giờ nó luôn hiện) */
/* .service-card-wrapper:hover::before {
    opacity: 1;
} */

/* NÂNG CẤP 2: Đổi tên keyframes */
@keyframes glow-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Các lớp glow-color chỉ còn dùng cho box-shadow khi hover */
.glow-gray:hover {
    box-shadow: 0 25px 50px -12px rgba(156, 163, 175, 0.2);
}
.glow-yellow:hover {
    box-shadow: 0 25px 50px -12px rgba(234, 179, 8, 0.25);
}
.glow-purple:hover {
    box-shadow: 0 25px 50px -12px rgba(168, 85, 247, 0.15);
}

.service-card-wrapper .service-card {
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 1px solid #374151;
    z-index: 2;
    position: relative;
    width: 100%;
    height: 100%;
    cursor: default;
    transition: border-color 0.3s ease;
}

/* NÂNG CẤP 2: Ẩn viền mặc định vì viền màu luôn hiện */
.service-card-wrapper .service-card {
    border-color: transparent;
}


.software-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    cursor: pointer;
}

.software-card-info {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out, opacity 0.6s ease-in-out, margin-top 0.6s ease-in-out;
    margin-top: 0;
}

.software-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.2);
    border-color: #0ea5e9;
}

.software-card:hover .software-card-info {
    max-height: 250px;
    opacity: 1;
    margin-top: 1rem;
}

.modal-content {
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.open .modal-content {
    transform: scale(1);
    opacity: 1;
}

.video-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 16 / 9;
}

.video-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.video-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 64px;
    height: 64px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

#video-modal-content {
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes wobble {
    0%,
    100% {
        transform: rotate(0deg);
    }

    15% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(6deg);
    }

    45% {
        transform: rotate(-6deg);
    }

    60% {
        transform: rotate(4deg);
    }

    75% {
        transform: rotate(-2deg);
    }
}

#hero-logo:hover {
    animation: wobble 0.8s ease;
}

#assistant-image:hover {
    animation: wobble 0.8s ease;
}

/* NÂNG CẤP: Thêm hiệu ứng wobble cho ảnh nhân vật hero */
#hero-character:hover {
    animation: wobble 0.8s ease;
}

@keyframes sway {
    0%,
    100% {
        transform: translateX(0px);
    }

    50% {
        transform: translateX(15px);
    }
}

.sway-animation {
    animation: sway 5s ease-in-out infinite;
}

#assistant-container {
    transition: transform 0.5s ease-out;
    cursor: pointer;
}

#assistant-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    right: auto;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #0ea5e9;
}

#chat-widget {
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}

#chat-widget.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1f2937;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

.user-message {
    background-color: #0ea5e9;
    align-self: flex-end;
}

.assistant-message {
    background-color: #374151;
    align-self: flex-start;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 1px;
    background-color: #9ca3af;
    display: inline-block;
    border-radius: 50%;
    animation: bob 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bob {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.blob {
    /* NÂNG CẤP: Tăng độ sáng và độ mờ cho blob */
    mix-blend-mode: screen;
    filter: blur(90px);
    animation: blob 7s infinite;
}

@keyframes fly {
    0% {
        transform: translate(var(--start-x), var(--start-y)) rotate(0deg);
        opacity: 0;
    }

    10%,
    90% {
        opacity: 0.4;
        /* Tăng độ sáng icon bay */
    }

    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(360deg);
        opacity: 0;
    }
}

.flying-logo {
    position: absolute;
    display: block;
    z-index: -1;
    opacity: 0;
    animation: fly linear infinite;
    mix-blend-mode: screen;
    filter: blur(2px);
    pointer-events: none;
}

.resource-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.1), 0 4px 6px -2px rgba(14, 165, 233, 0.05);
    border-color: #0ea5e9;
}

#social-container {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#social-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 10px;
    background-color: rgba(23, 31, 42, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px 0 0 12px;
    border: 1px solid #374151;
    border-right: none;
}

#social-bar a {
    transition: transform 0.2s ease;
    color: #9ca3af;
}

#social-bar a:hover {
    transform: scale(1.2);
    color: #e5e7eb;
}

#social-bar svg {
    width: 28px;
    height: 28px;
}

#backToTopBtn {
    position: fixed;
    bottom: 30px; /* Điều chỉnh vị trí nút Back to Top */
    right: 25px;
    z-index: 45;
    background-color: #0ea5e9;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    transform: translateY(20px);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}

#backToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTopBtn:hover {
    background-color: #0284c7;
    transform: scale(1.1);
}

/* NÂNG CẤP A.2: Thanh thông báo mới */
#notification-bar-wrapper {
    position: sticky;
    top: 72px; /* Dính ngay dưới header (chiều cao header là 72px) */
    width: 100%;
    z-index: 40; /* Đảm bảo nằm dưới header (z-50) */
    /* NÂNG CẤP A.2: Thay đổi background động sang xanh/vàng */
    background: linear-gradient(90deg, #45f400, #f6ff03, #45f400);
    background-size: 300% 100%;
    animation: scroll-gradient 10s linear infinite;
}

/* NÂNG CẤP A.2: Keyframes cho nền động */
@keyframes scroll-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


#notification-bar {
    background-color: transparent; /* Bỏ màu nền cũ */
    padding-top: 0.5rem; /* py-2 */
    padding-bottom: 0.5rem; /* py-2 */
    padding-left: 1.25rem; /* px-5 */
    padding-right: 1.25rem; /* px-5 */
}

#notification-text {
    white-space: normal; /* Cho phép xuống dòng nếu cần */
    color: #1f2937; /* NÂNG CẤP A.2: Đổi màu chữ sang tối để dễ đọc */
    font-weight: 600; /* Tăng độ đậm */
}

/* Tùy chỉnh nút Đăng kí ngay */
#notification-bar a {
     /* Style đã được đặt inline trong HTML */
}

/* Tùy chỉnh nút đóng X */
#notification-bar #close-notification {
    color: #4b5563; /* NÂNG CẤP A.2: Đổi màu nút đóng sang tối */
    transition: color 0.2s;
}
#notification-bar #close-notification:hover {
    color: #1f2937; /* NÂNG CẤP A.2: Đổi màu hover */
}


@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.carousel-track {
    animation: scroll 40s linear infinite;
}

.image-carousel-container:hover .carousel-track {
    animation-play-state: paused;
}

/* FIX: Tối ưu hóa Zalo Helper bằng CSS thuần, không cần JavaScript */
#zalo-helper {
    position: relative;
}

#zalo-helper:hover img {
    animation: wobble 0.8s ease;
}

#zalo-helper:hover #zalo-speech-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
    /* Hiệu ứng trồi lên */
}

#zalo-speech-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* NÂNG CẤP: Giao diện khung text kiểu Google AI */
#ai-textbox {
    background-color: rgba(29, 29, 31, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#ai-textbox::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    /* FIX: Tăng độ dày viền */
    background: linear-gradient(70deg, #4a72e0, #8d4ae0, #d94ab3);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.7;
}

/* NÂNG CẤP: Typing animation styles */
.cursor {
    display: inline-block;
    background-color: #38bdf8;
    /* sky-400 */
    margin-left: 0.1rem;
    width: 4px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: #38bdf8;
    }
}

#typed-text {
    white-space: pre-wrap;
    /* To respect the \n characters */
}

/* =================================================================== */
/* === BẮT ĐẦU NÂNG CẤP GIAO DIỆN O-AI STUDIO === */
/* =================================================================== */

/* Container chính cho toàn bộ trang O-AI Studio */
.oai-studio-container {
    display: flex;
    height: calc(100vh - 72px - 40px); /* NÂNG CẤP: Chiều cao trừ cả header và thanh thông báo */
    width: 100%;
    position: relative;
    overflow: hidden; /* SỬA LỖI: Ngăn cuộn ngoài ý muốn */
}

/* Cột 1: Prompt gợi ý (bên trái) */
#preset-prompts-container {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    z-index: 10;
}

/* Cột 2: Khu vực làm việc chính (ở giữa) */
#page-oai-studio main {
    width: 100%;
    margin-left: 160px; /* NÂNG CẤP: Giảm lề trái để tăng chiều rộng */
    margin-right: 320px; /* NÂNG CẤP: Giảm lề phải để tăng chiều rộng */
    /* padding-bottom: 8rem;  <-- ĐÃ XÓA */
    /* === NÂNG CẤP BỐ CỤC === */
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; /* Cần thiết để định vị thanh prompt */
}

/* Cột 3: Thanh cài đặt (bên phải) */
#page-oai-studio aside {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto; /* Thêm thanh cuộn khi cần */
}


#oai-conversation-area {
    width: 100%;
    max-width: 900px; /* Giới hạn chiều rộng của cuộc hội thoại */
    margin: 0 auto;
    /* === NÂNG CẤP VÙNG CUỘN === */
    flex-grow: 1; /* Cho phép khu vực này lấp đầy không gian trống */
    overflow-y: auto; /* Tự động thêm thanh cuộn khi cần */
    padding: 1.5rem 1.5rem 8rem; /* NÂNG CẤP: Tăng khoảng đệm dưới */
}

/* === NÂNG CẤP: Thêm style cho thanh cuộn đẹp hơn === */
#oai-conversation-area::-webkit-scrollbar {
    width: 8px;
}
#oai-conversation-area::-webkit-scrollbar-track {
    background: transparent;
}
#oai-conversation-area::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
#oai-conversation-area::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280;
}

#prompt-bar {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 5; /* FIX 2: Giảm z-index để lớp phủ che */
    background-color: rgba(29, 29, 31, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem; /* rounded-3xl */
    padding: 8px;
    display: flex;
    align-items: flex-end; /* Căn nút và textarea theo đáy */
}

#prompt-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(70deg, #4a72e0, #8d4ae0, #d94ab3);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.9;
}

#prompt-input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    flex-grow: 1;
    padding: 12px 16px;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 200px; /* Giới hạn chiều cao tối đa */
    overflow-y: auto;
}

/* Tinh chỉnh thanh cuộn cho textarea */
#prompt-input::-webkit-scrollbar {
    width: 6px;
}
#prompt-input::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

#prompt-send-btn {
    background-color: #6366f1;
    border-radius: 50%;
    padding: 12px;
    transition: background-color 0.2s;
    flex-shrink: 0; /* Ngăn nút bị co lại */
    margin-bottom: 4px; /* Căn chỉnh với textarea */
}

#prompt-send-btn:hover {
    background-color: #4f46e5;
}

.model-card,
.aspect-ratio-btn {
    background-color: #374151;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.model-card:hover,
.aspect-ratio-btn:hover {
    background-color: #4b5563;
}

.model-card.active {
    background-color: #1f2937;
    border-color: #38bdf8;
}

.aspect-ratio-btn svg {
    width: 24px;
    height: 24px;
    margin: 0 auto 4px auto;
}

#preset-prompts-container::-webkit-scrollbar {
    width: 6px;
}
#preset-prompts-container::-webkit-scrollbar-track {
    background: transparent;
}
#preset-prompts-container::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}


.preset-prompt-card {
    position: relative;
    cursor: pointer;
    border-radius: 0.75rem; /* rounded-xl */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 128px;
    height: 128px;
    border: 2px solid #4b5563; /* gray-600 */
}

.preset-prompt-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
    border-color: #38bdf8; /* sky-400 */
}

.preset-prompt-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.preset-prompt-card:hover .preset-prompt-img {
    transform: scale(1.1);
}

.preset-prompt-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    transition: opacity 0.3s ease;
}

.preset-prompt-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem; /* p-3 */
    color: white;
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    text-align: center;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.preset-prompt-card:hover .preset-prompt-text {
    transform: translateY(0);
    opacity: 1;
}

/* Các khối hội thoại */
.conversation-block {
    margin-bottom: 2rem;
}
.user-prompt-block {
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

/* NÂNG CẤP 5: Style khối kết quả AI giống Assistant */
.ai-result-block {
    border: 1px solid #374151; /* Giữ lại viền */
    border-radius: 0.75rem;
    padding: 1rem;
    background-color: #374151; /* Đổi màu nền giống assistant */
    max-width: 768px; /* Giữ lại max-width */
    /* Bỏ căn giữa */
    /* margin-left: auto; */
    /* margin-right: auto; */
    width: max-content; /* Co lại theo nội dung */
    margin-left: 0; /* Căn trái */
    margin-right: auto; /* Căn trái */
}


/* NÂNG CẤP 5: Đảm bảo tương phản cho khung ảnh */
.ai-image-wrapper {
    height: 512px;
    background-color: #1f2937; /* Đổi nền để tương phản với .ai-result-block */
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.ai-image-wrapper img {
    max-height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0;
}


.ai-result-block .loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 512px;
}

/* NÂNG CẤP: Style cho nút tải xuống */
.ai-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #4b5563; /* Đổi màu nền nút cho tương phản */
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
}
.ai-action-btn:hover {
    background-color: #6b7280; /* Đổi màu hover */
    color: #f9fafb;
}


#image-actions-container {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}

#image-actions-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =================================================================== */
/* === KẾT THÚC NÂNG CẤP GIAO DIỆN O-AI STUDIO === */
/* =================================================================== */


/* === NÂNG CẤP: CSS cho các thành phần xác thực === */

/* Lớp phủ bảo vệ trang tài nguyên & O-AI Studio */
#auth-overlay, #auth-overlay-oai {
    /* Đã chuyển style="display: none;" vào HTML để mặc định ẩn */
    /* FIX 2: Thêm z-index ở đây để đảm bảo nó cao nhất */
    z-index: 30;
}

.auth-button {
    padding: 12px 32px;
    border-radius: 9999px;
    font-weight: 700;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Thẻ chứa form đăng nhập/đăng ký */
.auth-card {
    background-color: rgba(29, 29, 31, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* Các nút đăng nhập mạng xã hội */
.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 10px;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.social-btn img {
    width: 20px;
    height: 20px;
}

.google-btn {
    background-color: #ffffff;
    color: #1f2937;
}
.google-btn:hover {
    background-color: #f3f4f6;
}

.facebook-btn {
    background-color: #1877F2;
    color: #ffffff;
}
.facebook-btn:hover {
    background-color: #166fe5;
}


/* Dải phân cách "hoặc" */
.divider {
    margin: 1.5rem 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}
.divider::before, .divider::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: #4b5563;
}
.divider::before { margin-right: 1rem; }
.divider::after { margin-left: 1rem; }

/* Định dạng chung cho form */
.auth-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
}

.auth-input {
    width: 100%;
    padding: 10px;
    background-color: #374151;
    border: 1px solid #4b5563;
    color: #ffffff;
    border-radius: 0.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.auth-submit-button {
    width: 100%;
    padding: 12px;
    background-color: #0ea5e9;
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
}
.auth-submit-button:hover {
    background-color: #0284c7;
}

.auth-toggle-link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
}
.auth-toggle-link a {
    color: #38bdf8;
    font-weight: 600;
    text-decoration: none;
}
.auth-toggle-link a:hover {
    text-decoration: underline;
}

/* NÂNG CẤP B.1: CSS cho Menu Dropdown Tài khoản */
#auth-button-container {
    position: relative; /* Quan trọng: để định vị dropdown */
}

.account-dropdown {
    display: none; /* Ẩn mặc định */
    position: absolute;
    top: calc(100% + 10px); /* Vị trí: ngay dưới nút cha + 10px đệm */
    right: 0;
    width: 200px;
    background-color: #1f2937; /* Nền xám tối */
    border: 1px solid #374151;
    border-radius: 0.75rem; /* bo góc */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    padding: 0.5rem; /* p-2 */
    z-index: 100;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.account-dropdown.open {
    display: block; /* Hiện khi có class 'open' */
    opacity: 1;
    transform: translateY(0);
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
    padding: 0.75rem 1rem; /* py-3 px-4 */
    font-size: 0.875rem; /* text-sm */
    color: #d1d5db; /* text-gray-300 */
    border-radius: 0.5rem; /* rounded-md */
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.account-dropdown-item:hover {
    background-color: #374151; /* hover:bg-gray-700 */
    color: #ffffff; /* hover:text-white */
}

.account-dropdown-item.logout-btn:hover {
    background-color: #991b1b; /* hover:bg-red-800 */
    color: #ffffff;
}

/* Thêm icon cho nút logout (sử dụng SVG inline trong JS) */
.account-dropdown-item svg {
    width: 1rem; /* w-4 */
    height: 1rem; /* h-4 */
}
