/* Import Google Font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

:root {
    /* Light mode colors */
    --text-color: #222;
    --subheading-color: #A0A0A0;
    --placeholder-color: #6C6C6C;
    --primary-color: #FFF;
    --secondary-color: #E9EEF6;
    --secondary-hover-color: #DBE1EA;
    --border-radius: 0.75rem;
    --info-color: #0b57d0;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --error-color: #EF5350;
}

.dark_mode {
    /* Dark mode colors */
    --text-color: #E3E3E3;
    --subheading-color: #828282;
    --placeholder-color: #A6A6A6;
    --primary-color: #242424;
    --secondary-color: #383838;
    --secondary-hover-color: #444;
    --info-color: #1976D2;
    --success-color: #43A047;
    --warning-color: #FF9800;
    --error-color: #ea6f6f;
}

body {
    color: var(--text-color);
    background: var(--primary-color);
}
a{
    color: var(--text-color);
    text-decoration: none;
}
a:hover{
    color: var(--info-color);
    text-decoration: underline;
}
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    padding: 0.3rem 0;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
    border-bottom: 1px solid var(--secondary-color);
    z-index: 1000;
}
.top-header .logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #4285f4, #d96570);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.search-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.search-bar .typing-form {
    flex: 1;
    margin: 0;
}
.main{
    margin: 0 auto;
    padding: 1rem;
    max-width: 1200px;
}

.content{
    margin-top: 5rem;
}
.description {
    color: var(--subheading-color);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
.index-content {
    margin-top: 15vh;
    overflow-x: hidden;
}

.index-content :where(.maintitle, .subtitle) {
    color: var(--text-color);
    font-weight: 500;
    line-height: 4rem;
}

.index-content .maintitle {
    width: fit-content;
    font-size: 3rem;
    background-clip: text;
    background: linear-gradient(to right, #4285f4, #d96570);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.index-content .subtitle {
    font-size: 2.6rem;
    color: var(--subheading-color);
}

.chat-list {
    padding: 2rem 1rem 12rem;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-color: #999 transparent;
}

.chat-list .message.incoming {
    margin-top: 1.5rem;
}

.chat-list .message .message-content {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    align-items: center;
}

.chat-list .message .text {
    color: var(--text-color);
    white-space: pre-wrap;
}

.chat-list .message.error .text {
    color: #e55865;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.loading .loading-indicator {
    display: none;
    gap: 0.8rem;
    width: 100%;
    flex-direction: column;
}

.loading .loading-indicator {
    display: flex;
}

.loading .loading-indicator .loading-bar {
    height: 11px;
    width: 100%;
    border-radius: 0.135rem;
    background-position: -800px 0;
    background: linear-gradient(to right, #4285f4, var(--primary-color), #4285f4);
    animation: loading 3s linear infinite;
}
.loading .loading-indicator .loading-bar:first-child {
    width: 100%;
}
.loading .loading-indicator .loading-bar:nth-child(2) {
    width: 80%;
}
.loading .loading-indicator .loading-bar:last-child {
    width: 60%;
}
@keyframes loading {
    0% {
        background-position: -800px 0;
    }

    100% {
        background-position: 800px 0;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--info-color);
    outline: none;
}

.input-area {
    width: 100%;
    margin: 8vh auto 5vh;
    background: var(--primary-color);
}

.input-area :where(.typing-form, .action-buttons) {
    display: flex;
    gap: 0.3rem;
}

.input-wrapper {
    width: 100%;
    height: 45px;
    display: flex;
    position: relative;
}

.typing-input {
    height: 100%;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    color: var(--text-color);
    padding: 1.1rem 4rem 1.1rem 1.5rem;
    border-radius: 100px;
    background: var(--secondary-color);
}

.typing-input:focus {
    background: var(--secondary-hover-color);
}

.typing-input::placeholder {
    color: var(--placeholder-color);
}

.icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
    display: flex !important;
    font-size: 1rem !important;
    color: var(--text-color);
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    transition: 0.2s ease;
    text-decoration: none !important;
}

.icon:hover {
    background: var(--secondary-hover-color);
}

.typing-form #send-message-button {
    position: absolute;
    right: 0;
    outline: none;
    border: none;
    transform: scale(0);
    background: transparent;
    transition: transform 0.2s ease;
}

.typing-form .typing-input:valid ~ #send-message-button {
    transform: scale(1);
}

.small-text {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1rem;
    color: var(--placeholder-color);
}
.fixed-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fixed-button {
    border-radius: 50%;
    color: var(--text-color);
    background: var(--secondary-color);
    border: none;
    cursor: pointer;
}


.global-alert {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    padding: 5px 15px;
    border-radius: var(--border-radius);
    color: white;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.global-alert.info {
    background-color: var(--info-color);
}
.global-alert.info::before {
    content: "✧";
    margin-right: 8px;
}

.global-alert.success {
    background-color: var(--success-color);
}
.global-alert.success::before {
    content: "✓";
    margin-right: 8px;
}

.global-alert.error {
    background-color: var(--error-color);
}
.global-alert.error::before {
    content: "🅧";
    margin-right: 8px;
}

.global-alert.warning {
    background-color: var(--warning-color);
}
.global-alert.warning::before {
    content: "⚠︎";
    margin-right: 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid {
    display: grid;
    grid-gap: 5px;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}
.card{
    padding: 1rem;
    margin-top: 1rem;
    overflow: hidden;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    overflow-wrap: break-word;
    word-break: break-all;
}
.card:hover{
    background: var(--secondary-hover-color);
    transform: translateY(-1px);
}
.card-border{
    padding: 1rem;
    margin-top: 1rem;
    overflow: hidden;
    border: 1px dashed var(--secondary-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    overflow-wrap: break-word;
    word-break: break-all;
}
.card-border:hover{
    border: 1px solid var(--secondary-color);
    transform: translateY(-1px);
}
.hot-search-list{
    width: 100%;
    margin-top: 1.5rem;
}
.tag-list{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag{
    background-color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-block;
}
.tag:hover{
    background-color: var(--secondary-color);
}
.tag-square {
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}
.btn {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 2rem;
    border-radius: 20px;
    background: var(--secondary-color);
    transition: all 0.3s ease;
    border: 0;
    cursor: pointer;
}
.btn:hover,button:disabled {
    opacity: 0.7;
}
.btn-primary{
    background-color: var(--info-color);
    color: white;
}
.title{
    font-size: x-large;
    color: var(--text-color);
    margin: 1rem auto;
}
.grid-right{
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: 3fr minmax(auto, 25%);
}
.pagination{
    margin: 1rem auto;
    text-align: center;
}
.footer{
    border-top: 1px solid var(--secondary-color);
    color: var(--subheading-color);
    font-size: 0.9rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}
p,li{
    line-height: 2.5rem;
}
/* Responsive media query code for small screen */
@media (max-width: 768px) {
    .index-content :is(.maintitle, .subtitle) {
        font-size: 2rem;
        line-height: 2.6rem;
    }

    .index-content .subtitle {
        font-size: 1.7rem;
    }

    .content{
        margin-top: 7rem;
    }

    .input-area :where(.typing-form, .action-buttons),.search-bar {
        gap: 0.4rem;
    }

    .typing-form .input-wrapper {
        height: 40px;
    }
    .icon {
        width: 40px;
        height: 40px;
    }

    .typing-form .typing-input {
        padding: 1.1rem 3.5rem 1.1rem 1.2rem;
    }

    .small-text {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
    .grid-right{
        grid-template-columns: 1fr;
    }
    .card,.card-border{
        max-width: 98%;
    }
    .search-bar {
        flex-wrap: wrap;
    }
    .search-bar .logo {
        flex: 1;
        text-align: left;
    }

    .search-bar .typing-form {
        order: 2;
        width: 100%;
        flex: none;
    }

    .search-bar .action-buttons {
        order: 1;
        width: auto;
        display: flex;
        gap: 1rem;
    }
}
:root {
    scroll-padding-top: 145px;
}
@media screen and (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}


/* Search suggestion style */
.suggestion-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: var(--secondary-color);
}

.dark_mode .suggestion-list {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}