* {
    -webkit-tap-highlight-color: transparent;
}
body {
    margin: 0;
    font-family: "Poppins";
    background: #181921;
    height: 100%;
    padding: 0;
    overflow: auto;
    overflow-x: hidden;
}
h1 {
    margin: 0;
    color: #a73335;
    font-family: 'Orbitron';
}
h2 {
    margin: 0;
    color: #a73335;
    font-family: 'Urbanist';
}
p {
    margin: 0;
    padding: 10px;
    color: #fff;
    line-height: 1.5;
}
span{
    color: #fff;
}
.container {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    height: calc(100vh - 160px);
    justify-content: space-between;
    margin: 0 auto 20px auto;
    overflow: visible;
    background: #181921;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.titles {
    position: relative;
    z-index: 1;
    gap: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    background: #fff;
    justify-content: center;
    gap: 20px;
    width: 100%;
    padding: 20px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
}

.titles img {
    max-width: 70px;
}


.tagline {
    color: #a73335;
    font-family: 'Orbitron';
}

#startup-overlay {
    position: fixed;
    inset: 0;
    background: #181921;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
}

/* APPLY ONLY WHEN PLAYING ANIMATION */
#startup-overlay.play {
    animation: overlayFadeOut 1s ease forwards;
    animation-delay: 1s;
}

/* SKIP CLASS */
#startup-overlay.skip {
    opacity: 0 !important;
    display: none !important;
}

/* Logo animation — apply ONLY if parent has .play */
#startup-overlay.play .startup-logo {
    animation: startupPulse 1s ease-out forwards;
}

@keyframes startupPulse {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    40% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes overlayFadeOut {
    0% {
        opacity: 1;
        pointer-events: all;
    }
    100% {
        opacity: 0;
        pointer-events: none;
    }
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 15px 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.nav-logo {
    height: 50px; 
    width: auto;
    transform: scale(3.5);
    transform-origin: left center;
    cursor: pointer;
}


.nav-title h1 {
    font-family: 'Orbitron';
    font-size: 1.5rem;
    margin: 0;
    color: #a73335;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-icon-btn {
    background: white;
    color: #a73335;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 55px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.nav-icon-btn .nav-icon {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.nav-icon-btn .nav-label {
    opacity: 0;
    max-width: 0;
    height: 0;
    padding-top: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.25s ease, max-width 0.25s ease, height 0.25s ease;
    color: #a73335;
    font-size: 0.9rem;
}

.nav-icon-btn:hover .nav-label {
    opacity: 1;
    max-width: 100px;
    height: auto;
    color: white;
}

.nav-icon-btn:hover {
    background: #c04142;
    color: white;
    transform: translateY(-2px);
}
.nav-icon-btn:hover .nav-icon {
    width: 20px;
    height: 20px;
}


.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-right button {
    background-color: #a73335;
    color: white;
    border-radius: 24px;
    padding: 8px 16px;
}

.nav-icon-btn .nav-icon {
    width: 20px;
    height: 20px;
}


.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    min-height: calc(100% - 160px);
}
.empty-chat {
    text-align: center;
    margin: auto;
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
}

.empty-chat.hidden {
    display: none;
}

.center-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 150px);
    text-align: center;
    gap: 30px;
}

.app-logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
}


.welcome-message {
    background: #232530;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}
.welcome-message h2 {
    margin-bottom: 10px;
}
.welcome-message p {
    color: #ccc;
}
.message {
    margin-bottom: 20px;
    max-width: 85%;
    word-wrap: break-word;
}
.user-message {
    align-self: flex-end;
    background-color: #a73335;
    color: white;
    border-radius: 18px 18px 0 18px;
    padding: 12px 16px;
}

.bot-message {
    align-self: flex-start;
    background-color: #232530;
    color: white;
    border-radius: 18px 18px 18px 0;
    padding: 12px 16px;
}

.message-text {
    margin: 0;
    padding: 0;
}

.message-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    text-align: right;
}

.bot-message a {
    color: #60a5fa;
    text-decoration: none;
}

.bot-message a:hover {
    text-decoration: underline;
}

.sources {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sources h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.sources ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.sources li {
    margin-bottom: 5px;
}


.chat-input-form {
    display: flex;
    padding: 15px;
    bottom: 0;
    flex-shrink: 0;
    background-color: #232530;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;   
    position: relative;
}

#questionInput {
    background: #2f3243;
    color: white;
    border: 0;
    padding: 12px 15px;
    border-radius: 24px;
    flex: 1;
    margin: 0 10px 0 0;
    font-size: 16px;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    overflow-y: auto;
}

#submitButton {
    flex-shrink: 0; 
    height: 48px; 
    align-self: flex-end; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px; 
}

#questionInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#questionInput:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(167, 51, 53, 0.5);
}


button {
    background-color: #a73335;
    color: white;
    border-radius: 24px;
    border: 0;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 16px;
}

.hidden-btn {
    display: none;
}

button:hover {
    background-color: #c04142;
    transform: translateY(-2px);
}


button:active {
    transform: translateY(0);
}

#toggleContainer {
    position: sticky;
    top: 0;
    padding: 10px 15px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-button {
    background-color: #323548;
    color: white;
    font-size: 14px;
}

.toggle-button:hover {
    background-color: #424868;
}

.admin-button-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

#adminPage {
    background-color: #323548;
}

#adminPage:hover {
    background-color: #424868;
}

.thinking {
    align-self: flex-start;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 10px;
}

.logo-pulse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
}

.thinking-logo {
    width: 40px;
    height: 60px;
    animation: pulseOnly 3s ease-in-out infinite;
}

#leftRight-circle,
#topBottom-circle {
    transform-origin: 50% 50%;
    transform-box: fill-box;
    animation: spinPulseRest 3s ease-in-out infinite;
}


@keyframes pulseOnly {
    0%{
        opacity: 1;
        transform: scale(1);
    }
    30% {
        opacity: 0.8;
        transform: scale(1.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    80%, 100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spin + pulse + rest (for circle groups only) */
@keyframes spinPulseRest {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    
    30% {
        transform: rotate(360deg) scale(1.2);
        opacity: 0.8;
    }
    
    50% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
    80%, 100% {
        transform: rotate(360deg) scale(1);
        opacity: 1; /* rest phase */
    }
}


#loginContainer, .loginContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px auto 0 auto; 
    padding: 32px 32px 24px 32px;
    background: #232530;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    max-width: 350px;
    min-width: 260px;
    gap: 14px;
}

.loginContainer input {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: none;
    background: #2f3243;
    color: #fff;
    font-size: 16px;
}

.loginContainer input::placeholder {
    color: #aaa;
}

.loginContainer input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 4px;
    background-color: transparent;
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.loginContainer input[type="checkbox"]:checked {
    background-color: #a73335; /* SOM red */
    border-color: #a73335;
}

.loginContainer input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    color: #fff;
    font-size: 12px;
}

.loginContainer label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;             
    margin-top: 10px;
    cursor: pointer;
}

.loginContainer label p {
    color: #fff;
    font-size: 0.95rem;
    padding: 0;
    margin: 0;
}

.login-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.login-buttons button {
    flex: 1 1 auto;
    min-width: 120px;
}


.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.custom-table th, .custom-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    text-align: center;
}
.custom-table th {
    background-color: #222;
    color: #fff;
}
.custom-table td {
    background-color: #111;
    color: #eee;
}

.user-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #a73335;          /* SOM red */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 1001;
}

.user-avatar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;   
}

.user-avatar:hover {
    background-color: #c04142;
    transform: scale(1.05);
}

/* --- Dropdown panel --- */
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: #232530;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-width: 220px;
    padding: 12px 16px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-dropdown.show-dropdown {
    display: block;
}

.user-avatar:hover .user-dropdown,
.user-avatar .user-dropdown:hover  {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s; 
}

/* --- Dropdown text & link --- */
.user-dropdown p {
    color: #fff;
    font-size: 0.85rem;
    margin: 0 0 10px 0;
    word-break: break-all;
}

.user-dropdown a {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.9rem;
}

.user-dropdown a:hover {
    text-decoration: underline;
}

.dropdown-signout-btn {
    background-color: #a73335;
    color: white;
    border: none;
    width: 100%;
    padding: 8px 14px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}


.dropdown-signout-btn:hover {
    background-color: #c04142;
}


.dropdown-signout-btn:active {
    transform: scale(0.97);
}



/* adjust for mobile */
@media (max-width: 600px) {
    
    .container {
        width: 95%;
        border-radius: 0;
    }
    
    
    .message {
        max-width: 90%;
    }

    .video-responsive {
        position: relative;
        width: 100%;
        padding-bottom: 56.25%; 
        height: 0;
        overflow: hidden;
    }
    
    .video-responsive iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .video-title {
        font-size: 20px;
        font-weight: bold;
        color: #fff;
        margin-bottom: 10px;
    }

    .loginContainer {
        max-width: 95vw;
        min-width: unset;
        padding: 18px 8px;
    }

    .login-buttons {
        flex-direction: column;
        gap: 10px;
    }

    #questionInput {
        font-size: 14px;
        padding: 10px 12px;
    }

    .chat-input-form {
        padding: 10px;
    }

    .signout-wrapper {
        margin-top: 6px;
        padding: 10px 10px 0 10px;
    }


    .code-block {
        background: #1e1e1e;
        color: #f8f8f2;
        padding: 10px;
        border-radius: 8px;
        font-family: monospace;
        overflow-x: auto;
        font-size: 0.9rem;
    }

    .nav-logo {
        height: 40px;
        transform: scale(1.6);
        transform-origin: left center;
        margin-right: 10px;
    }

    .main-nav {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px 15px;
        gap: 8px;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-icon-btn {
        height: auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        overflow: visible !important;
    }

    .nav-icon-btn .nav-label {
        opacity: 1 !important;
        height: auto !important;
        max-width: none !important;
        display: block !important;
        padding-top: 4px !important;
        color: #a73335 !important;
    }

    .nav-icon-btn:active {
        background: #c04142 !important;
        color: white !important;
        transform: translateY(-2px) !important;
    }

    .nav-icon-btn:active .nav-label {
        color: white !important;   /* FIXED */
    }

    .nav-icon-btn:hover {
        transform: none !important;
    }

    .nav-right button {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
}