
/* Cai dat chung */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background: #02030a;
}

/* Thanh dieu huong */
header {
    width: 100%;
    padding: 12px 5%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 40;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    padding: 2px;
}

/* Ten website */
.logo-text h2 {
    font-size: 12px;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 8px;
}

/* Cac muc dieu huong */
.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
}

/* Noi dung chinh */
main {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* Khu vuc mo hinh He Mat Troi */
#solar-system {
    width: 100%;
    height: 100%;
    position: relative;
    background: #02030a;
    transition: filter 0.4s ease;
}

/* Canvas He Mat Troi */
#solar-system canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Lam mo He Mat Troi khi mo chi tiet */
#solar-system.detail-blurred {
    filter: blur(5px) brightness(0.35);
}

/* Bang dieu khien toc do */
#speed-control {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 20;

    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 7px;

    background: rgba(10, 15, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* Nut toc do */
.speed-btn {
    padding: 6px 10px;
    color: white;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: 0.2s;
}

.speed-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.speed-btn.active {
    background: #2768c9;
    border-color: #5595ff;
}

.stop-btn.active {
    background: #a83242;
    border-color: #ff6478;
}


/* ======================================
   GIAO DIEN CHI TIET HANH TINH
====================================== */

#detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;

    display: flex;
    width: 100%;
    height: 100%;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.4s ease,
        visibility 0.4s ease;

    background: rgba(2, 3, 10, 0.15);
}

/* Khi mo chi tiet */
#detail-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* ======================================
   BANG THONG TIN BEN TRAI - 1/3
====================================== */

#detail-panel {
    width: 33.333%;
    height: 100%;
    flex-shrink: 0;

    box-sizing: border-box;
    padding: 110px 35px 35px;

    background: linear-gradient(
        135deg,
        rgba(8, 15, 35, 0.97),
        rgba(10, 20, 43, 0.90)
    );

    border-right: 1px solid rgba(255, 255, 255, 0.12);

    overflow-y: auto;

    color: white;

    transform: translateX(-35px);
    opacity: 0;

    transition:
        transform 0.45s ease,
        opacity 0.45s ease;
}

#detail-overlay.active #detail-panel {
    transform: translateX(0);
    opacity: 1;
}

.detail-panel-content {
    max-width: 480px;
    margin: 0 auto;
}

/* Nhan */
.detail-label {
    color: #70aaff;
    font-size: 11px;
    letter-spacing: 3px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* Ten hanh tinh */
#detail-name {
    font-size: clamp(25px, 3vw, 42px);
    margin: 0;
    color: white;
    letter-spacing: 1px;
}

/* Vi tri hanh tinh */
.detail-type {
    color: #9aabc9;
    font-size: 13px;
    margin-top: 10px;
}

/* Duong phan cach */
.detail-line {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 25px 0;
}

/* Tieu de thong tin */
#detail-panel h3 {
    font-size: 15px;
    color: #d9e6ff;
    margin-bottom: 13px;
}

/* Mo ta */
.detail-description {
    color: #aebbd3;
    font-size: 13px;
    line-height: 1.8;
    margin: 0;
}

/* Tung dong thong tin */
.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 17px 0;
}

.detail-info-item span {
    color: #8798b8;
    font-size: 12px;
}

.detail-info-item strong {
    color: white;
    font-size: 14px;
    font-weight: 500;
}


/* ======================================
   KHU VUC HANH TINH BEN PHAI - 2/3
====================================== */

#detail-space {
    width: 66.667%;
    height: 100%;
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

/* Canvas hanh tinh phong to */
#detail-planet-view {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

#detail-planet-view canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Nut mui ten */
.planet-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;

    transform: translateY(-50%);

    width: 44px;
    height: 44px;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;

    background: rgba(15, 25, 50, 0.65);
    color: white;

    font-size: 19px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(8px);

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        border-color 0.25s ease;
}

.planet-arrow:hover {
    background: rgba(50, 105, 190, 0.8);
    border-color: #70aaff;
    transform: translateY(-50%) scale(1.1);
}

#prev-planet {
    left: 22px;
}

#next-planet {
    right: 22px;
}

/* Huong dan thoat */
#detail-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);

    color: rgba(210, 220, 240, 0.6);
    font-size: 11px;
    white-space: nowrap;

    pointer-events: none;
}


/* ======================================
   GIAO DIEN DIEN THOAI
====================================== */

@media (max-width: 700px) {

    #speed-control {
        bottom: 15px;
        right: 10px;
        gap: 5px;
        padding: 7px;
    }

    .speed-btn {
        padding: 7px 9px;
        font-size: 10px;
    }

    #detail-panel {
        width: 40%;
        padding: 90px 14px 20px;
    }

    #detail-space {
        width: 60%;
    }

    #detail-name {
        font-size: 22px;
    }

    .detail-description {
        font-size: 11px;
    }

    .detail-info-item span {
        font-size: 10px;
    }

    .detail-info-item strong {
        font-size: 11px;
    }

    .planet-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    #prev-planet {
        left: 5px;
    }

    #next-planet {
        right: 5px;
    }

    #detail-hint {
        font-size: 9px;
        bottom: 15px;
    }
}

/* =========================================
   GIAO DIEN CHAT AI
========================================= */

/* Nut mo Chat AI */
#chat-toggle {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1000;

    padding: 14px 24px;
    border: none;
    border-radius: 30px;

    background: linear-gradient(135deg, #5278ff, #8052ed);
    color: white;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
    box-shadow: 0 5px 20px rgba(82, 120, 255, 0.35);

    transition: 0.3s;
}

#chat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(82, 120, 255, 0.5);
}

/* Khung Chat */
#chat-container {
    position: fixed;
    bottom: 90px;
    left: 25px;
    z-index: 1000;

    width: 370px;
    height: 500px;

    display: none;
    flex-direction: column;

    background: #10152d;
    border: 1px solid rgba(130, 150, 255, 0.3);
    border-radius: 16px;

    overflow: hidden;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Khi mo khung chat */
#chat-container.active {
    display: flex;
}

/* Dau khung chat */
#chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px 18px;

    background: linear-gradient(135deg, #263b80, #51358f);
    color: white;
}

#chat-header h3 {
    margin: 0;
    font-size: 17px;
}

#chat-header p {
    margin: 5px 0 0;
    font-size: 12px;
    color: #cbd4ff;
}

#chat-close {
    width: 30px;
    height: 30px;

    border: none;
    border-radius: 50%;

    background: transparent;
    color: white;

    font-size: 25px;
    cursor: pointer;
}

#chat-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Khu vuc tin nhan */
#chat-messages {
    flex: 1;

    padding: 16px;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 12px;

    background: #0b1023;
}

/* Tin nhan cua AI */
.bot-message {
    align-self: flex-start;

    max-width: 85%;
    padding: 12px 14px;

    border-radius: 12px 12px 12px 2px;

    background: #202b4d;
    color: #e5eaff;

    font-size: 14px;
    line-height: 1.6;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Tin nhan cua nguoi dung */
.user-message {
    align-self: flex-end;

    max-width: 85%;
    padding: 12px 14px;

    border-radius: 12px 12px 2px 12px;

    background: linear-gradient(135deg, #526fff, #7652e9);
    color: white;

    font-size: 14px;
    line-height: 1.6;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Form nhap tin nhan */
#chat-form {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 12px;

    background: #151c36;
    border-top: 1px solid rgba(130, 150, 255, 0.2);
}

#chat-input {
    flex: 1;
    min-width: 0;

    padding: 11px 13px;

    border: 1px solid #35436b;
    border-radius: 22px;
    outline: none;

    background: #0b1023;
    color: white;

    font-size: 13px;
}

#chat-input:focus {
    border-color: #718cff;
}

#chat-input::placeholder {
    color: #929bb8;
}

#chat-send {
    padding: 11px 16px;

    border: none;
    border-radius: 22px;

    background: #586fff;
    color: white;

    font-weight: 600;
    cursor: pointer;

    transition: 0.2s;
}

#chat-send:hover {
    background: #7658ef;
}

#chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Thanh cuon tin nhan */
#chat-messages::-webkit-scrollbar {
    width: 5px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #465582;
    border-radius: 10px;
}

/* Giao dien dien thoai */
@media (max-width: 480px) {
    #chat-container {
        left: 10px;
        right: 10px;
        bottom: 80px;

        width: auto;
        height: min(500px, 70vh);
    }

    #chat-toggle {
        left: 15px;
        bottom: 15px;
    }
}
