/* GLOBAL VARIABLES */
:root {
    --bg: #fdf6e3;
    --header: #5d3a1a;
    --gold: #c7a35d;
    --text: #4b3832;
    --bubble-guru: #eee8d5;
    --bubble-user: #c7ad7f;
    --border-grey: rgba(128, 128, 128, 0.3);
}

/* BASE STYLES */
body {
    font-family: 'Spectral', 'Noto Sans Devanagari', serif;
    background-color: var(--bg);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    color: var(--text);
}

/* HEADER & AUTH */
header {
    background: linear-gradient(to bottom, var(--header), #3e2712);
    padding: 8px 15px;
    text-align: center;
    color: var(--gold);
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#auth-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.om {
    font-size: 32px;
    display: block;
    font-weight: bold;
}

h1 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 22px;
}

.login-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    max-width: 160px;
}

.google-btn,
.coming-soon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    width: 34px;
    height: 34px;
    padding: 0;
}

.coming-soon-btn {
    opacity: 0.7;
    cursor: not-allowed;
}

.icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
}

.icon-wrapper img,
.icon-wrapper svg {
    width: 18px;
    height: 18px;
    display: block;
}

.coming-soon-text {
    font-size: 8px;
    color: var(--gold);
    white-space: nowrap;
    margin-left: 2px;
}

.free-credits-text {
    width: 100%;
    font-size: 9px;
    color: var(--gold);
    margin: 2px 0 0 0;
    text-transform: uppercase;
    font-weight: bold;
    animation: pulse 2s infinite;
    text-align: left;
}

.auth-btn {
    background: var(--gold);
    border: none;
    color: white;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

#user-info {
    color: var(--gold);
    font-size: 10px;
    display: none;
    text-align: left;
}

#reset-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 1px 7px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 10px;
}

/* CHAT AREA */
#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.message {
    max-width: 92%;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.4;
    font-size: 16px;
    animation: fadeIn 0.4s ease;
    word-wrap: break-word;
}

.guru {
    align-self: flex-start;
    background: var(--bubble-guru);
    border-left: 5px solid var(--gold);
}

.user {
    align-self: flex-end;
    background: var(--bubble-user);
    color: white;
}

.training-note {
    font-style: italic;
    font-size: 13px;
    color: var(--header);
    margin: 8px 0;
    display: block;
}

.example-list {
    margin-top: 8px;
    padding-left: 12px;
    font-size: 15px;
    list-style: none;
}

.example-list li {
    margin-bottom: 10px;
    cursor: pointer;
    color: var(--header);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.typing span {
    width: 5px;
    height: 5px;
    background-color: var(--gold);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite;
}

/* UI MODES & INPUT */
#mode-container {
    background: #eee8d5;
    padding: 4px;
    display: flex;
    gap: 6px;
    border-top: 1px solid #dcd6c3;
}

.action-btn {
    height: 52px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f4ecd8;
    border: 1px solid var(--gold);
    border-radius: 6px;
    color: var(--header);
    cursor: pointer;
    font-size: 13px;
    text-transform: uppercase;
    line-height: 1.2;
}

.action-btn strong {
    font-weight: 800;
}

.action-btn small {
    display: block;
    font-weight: 400;
    text-transform: none;
    font-size: 9px;
    margin-top: 1px;
    opacity: 0.9;
    line-height: 1;
}

@media (max-width: 480px) {
    .action-btn {
        height: 48px;
        font-size: 11px;
    }

    .action-btn small {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .action-btn {
        height: 44px;
        font-size: 10px;
    }

    .action-btn small {
        font-size: 7px;
    }
}

.action-btn.active {
    background: #f4ecd8;
    border: 2px solid var(--gold);
    box-shadow: 0 0 10px rgba(199, 163, 93, 0.4);
}

.gold-fill {
    background: var(--header);
    color: var(--gold);
    border-color: var(--header);
}

#input-area-container {
    background: white;
    border-top: 1px solid var(--gold);
    padding: 6px 15px 8px 15px;
}

#input-area {
    display: flex;
    gap: 8px;
    align-items: center;
}

input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
}

#send-btn {
    padding: 8px 18px;
    background: var(--header);
    color: var(--gold);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

.disclaimer {
    font-size: 9px;
    color: #888;
    text-align: center;
    font-style: italic;
    margin-top: 4px;
}

/* --- RESPONSIVE TABLES --- */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
    border: 1px solid var(--gold);
    border-radius: 8px;
    background: #fff;
    position: relative;
}

.table-container table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0 !important;
    font-size: 14px;
}

.guru th,
.guru td {
    border: 1px solid #c7a35d !important;
    padding: 8px !important;
    text-align: left;
    min-width: 100px;
}

.table-zoom-hint {
    display: block;
    font-size: 10px;
    color: var(--gold);
    text-align: right;
    padding: 4px 8px;
    font-style: italic;
    background: #fdfaf3;
    border-top: 1px solid #f4ecd8;
}

@media (max-width: 600px) {
    .table-container table {
        font-size: 11px;
    }

    .guru th,
    .guru td {
        padding: 5px !important;
        min-width: 80px;
    }
}

/* Modal for Table Zoom */
#table-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

#table-zoom-modal .modal-content {
    background: white;
    padding: 0;
    max-width: none;
    width: fit-content;
    margin: auto;
    border-radius: 4px;
    border: 2px solid var(--gold);
}

#table-zoom-modal table {
    font-size: 16px;
    border-collapse: collapse;
}

#table-zoom-modal .close-zoom {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--gold);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    z-index: 3100;
}

/* --- SMALLER, CLEAR SVG MAPPING --- */
.svg-container {
    max-width: 350px !important;
    /* Forced 50% smaller display for clarity */
    width: 100% !important;
    background: #fff;
    border-radius: 8px;
    margin: 25px auto;
    padding: 15px;
    border: 1px solid var(--gold);
    display: flex;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

svg {
    max-width: 100%;
    height: auto !important;
    display: block;
}

/* Fix for jumbled SVG text wrapping */
.svg-box-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    color: #4b3832;
    overflow: hidden;
    word-wrap: break-word;
}

/* SHARING TOOLBAR */
.share-toolbar {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.share-icon-btn {
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: 1px solid var(--gold);
    border-radius: 4px;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}

.share-btn-wide {
    width: 60px;
    background-size: 40px 16px;
}

.icon-share-wide {
    width: 60px;
    background-size: 40px 16px;
    /* Clipboard (Left) + Share Nodes (Right) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 24'%3E%3C!-- Clipboard --%3E%3Cpath fill='%235d3a1a' d='M9 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-4V2a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v2zm2-1h2v1h-2V3z'/%3E%3C!-- Share Nodes --%3E%3Cpath fill='%235d3a1a' transform='translate(36, 1) scale(0.045)' d='M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.9-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.9 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z'/%3E%3C/svg%3E");
}

.icon-x {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBmaWxsPSIjNWQzYTFhIiBkPSJNMzg5LjIgNDhoNzAuNkwzMDUuNiAyMjQuMiA0ODcgNDY0SDM0NUwyMzMuNyAzMTguNiAxMDYuNSA0NjRIMzUuOEwyMDAuNyAyNzUuNSAyNi44IDQ4SDE3Mi40TDI3Mi45IDE4MC45IDM4OS4yIDQ4ek0zNjQuNCA0MjEuOGgzOS4xTDE1MS4xIDg4aC00MkwzNjQuNCA0MjEuOHoiLz48L3N2Zz4=");
}

.icon-img {
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTYgMjU2Ij48cGF0aCBmaWxsPSIjNWQzYTFhIiBkPSJNMjA4LDMySDQ4QTE2LDE2LDAsMCwwLDMyLDQ4VjIwOGExNiwxNiwwLDAsMCwxNiwxNkgyMDhhMTYsMTYsMCwwLDAsMTYtMTZWNDhBMTYsMTYsMCwwLDAsMjA4LDMyWk00OCw0OEgyMDhWMTU4LjFsLTQ0LjctNDQuN2E4LDgsMCwwLDAtMTEuMywwTDQ4LDIxNy40Wk0yMDgsMjA4SDYwLjdMMTU3LjQsMTExLjMsMjA4LDE2MS45Wm0tNzItOTZhMTIsMTIsMCwxLDEsMTItMTJBMTIsMTIsMCwwLDEsMTM2LDExMloiLz48L3N2Zz4=");
}

/* Adobe Acrobat Icon - Explicit Text "PDF" */
.icon-pdf {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='none' stroke='%235d3a1a' stroke-width='4' d='M12 4h28l12 12v44H12z'/%3E%3Ctext x='18' y='42' font-family='sans-serif' font-weight='bold' font-size='20' fill='%235d3a1a'%3EPDF%3C/text%3E%3C/svg%3E");
}

/* Explicit TXT Icon */
.icon-txt {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='none' stroke='%235d3a1a' stroke-width='4' d='M12 4h28l12 12v44H12z'/%3E%3Ctext x='18' y='42' font-family='sans-serif' font-weight='bold' font-size='20' fill='%235d3a1a'%3ETXT%3C/text%3E%3C/svg%3E");
}

/* Social Icons (FB, LI, Reddit) - Customized: Wide Button + Clipboard Icon + Brand Logo */
.icon-fb {
    width: 60px;
    background-size: 40px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 24'%3E%3C!-- Clipboard --%3E%3Cpath fill='%235d3a1a' d='M9 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-4V2a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v2zm2-1h2v1h-2V3z'/%3E%3C!-- Facebook F --%3E%3Cpath fill='%235d3a1a' transform='translate(36, 2) scale(0.9, 0.9)' d='M13.2 10.4l.6-4.1h-3.9V4.7c0-1.1.3-1.9 1.9-1.9h2V-.2c-.3 0-1.5-.1-2.9-.1-2.9 0-4.9 1.8-4.9 5v2.7H3v4.1h3v10.4h4.1V10.4h3.1z'/%3E%3C/svg%3E");
}

.icon-li {
    width: 60px;
    background-size: 40px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 24'%3E%3C!-- Clipboard --%3E%3Cpath fill='%235d3a1a' d='M9 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-4V2a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v2zm2-1h2v1h-2V3z'/%3E%3C!-- LinkedIn IN --%3E%3Cpath fill='%235d3a1a' transform='translate(36, 2) scale(0.9, 0.9)' d='M4.5 19h-4V6h4v13zM2.5 4C1.1 4 0 3 0 1.7S1.1-.5 2.5-.5 5 .5 5 1.7 3.9 4 2.5 4zM19 19h-4v-7c0-1.7-.6-2.8-2.1-2.8-1.5 0-2.4 1-2.8 2v7.8H6.1s.1-12 0-13h4v1.8c.6-1 2-2.4 4.5-2.4 3.3 0 5.8 2.2 5.8 6.9V19h-1.4z'/%3E%3C/svg%3E");
}

.icon-rd {
    width: 60px;
    background-size: 40px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 24'%3E%3C!-- Clipboard --%3E%3Cpath fill='%235d3a1a' d='M9 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-4V2a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v2zm2-1h2v1h-2V3z'/%3E%3C!-- Reddit Alien --%3E%3Cpath fill='%235d3a1a' transform='translate(36, 0) scale(0.045, 0.045)' d='M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.6-10-22.9-16.3-37.9-16.3-29.4 0-53.3 23.9-53.3 53.3 0 25.4 17.6 46.5 41 51.9-3 12.8-4.4 25.5-4.4 39.1 0 84 74.3 153.3 165.7 153.3 91.5 0 165.7-69.3 165.7-153.3 0-13.2-1.8-26-4.9-38.6 23.9-5.3 41.7-26.5 41.7-52.3 0-29.4-23.9-53.3-53.3-53.3zM224 336c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40zm128 0c-22.1 0-40-17.9-40-40s17.9-40 40-40 40 17.9 40 40-17.9 40-40 40z'/%3E%3C/svg%3E");
}


/* STATIC PAGE LAYOUTS */
.static-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: auto !important;
}

.static-container h1,
.static-container h2,
.static-container h3 {
    color: var(--header);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
}

/* MODALS & FOOTER */
#pricing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: var(--bg);
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 12px;
    position: relative;
}

footer {
    padding: 10px;
    text-align: center;
    background: #f4ecd8;
    font-size: 10px;
    border-top: 1px solid #dcd6c3;
}

footer a {
    color: var(--header);
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
}

/* ANIMATIONS */
@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}