@font-face {
    font-family: "Poly Sans";
    src: url('fonts/PolySansNeutral.ttf') format('truetype');
}

@font-face {
    font-family: "Poly Sans Bulky";
    src: url('fonts/PolySansBulky.ttf') format('truetype');
}

@font-face {
    font-family: "Poly Sans Slim";
    src: url('fonts/PolySansSlim.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poly Sans", Arial, sans-serif;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 100vh;
    transition: padding-top 0.5s ease;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 135px;
    background-color: white;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, 1) 80%,
            rgba(255, 255, 255, 0) 100%);
}

#logo {
    font-family: "Poly Sans Bulky", Arial, sans-serif;
    font-size: 4rem;
    color: #333;
}

#logo a {
    text-decoration: none;
    color: inherit;
    pointer-events: none;
}

#search-form {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    text-align: center;
    transition: all 0.5s ease;
}

#logo,
#search-form {
    position: relative;
    z-index: 100;
}

.search-container {
    display: flex;
    position: relative;
    align-items: center;
    background-color: #efefef;
    border-radius: 50px;
    padding: 0.5rem;
    margin: 0 auto;
    transition: all 0.5s ease;
}

::placeholder {
    color: #8b8b8b;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#search-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: "Poly Sans", Arial, sans-serif;
    font-size: 1.2rem;
    padding: 0.5rem;
    background: transparent;
}

#suggestions-container {
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
    z-index: 10;
    display: none;
    border-radius: 0 0 30px 30px;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
}

.suggestion-item:last-child {
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

#search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: #333;
}

#search-icon svg {
    width: 24px;
    height: 24px;
}

#search-button {
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#search-button svg {
    width: 32px;
    height: 32px;
    rotate: 90deg;
}

#search-button:hover {
    opacity: 0.8;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.tab-navigation {
    display: none;
    position: fixed;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    top: 70px;
    z-index: 11;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    font-family: "Poly Sans", Arial, sans-serif;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-button.active {
    color: #000;
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background-color: #000;
    transition: all 0.3s ease;
}

.tab-content {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    background-color: #ffffff;
}

.tab-pane.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transition: opacity 0.5s ease 0s, visibility 0.5s ease 0s;
    z-index: 2;
}

.main-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1rem;
}

.answerContent {
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1300px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.5s ease;
    overflow: hidden;
}

.answer-left {
    flex: 1;
    max-width: 65%;
}

.answer-right {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 1.5rem 0;
}

.collapsed {
    position: relative;
}

.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
}

.expand-button {
    display: block;
    position: relative;
    margin: -20px auto 0px auto;
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1;
}

.expand-button:hover {
    background-color: #333;
}

#answer {
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.6;
}

#answer h1,
#answer h2,
#answer h3 {
    font-family: "Poly Sans Bulky", Arial, sans-serif;
    margin-top: 1.5rem;
    margin-bottom: 1.0rem;
}

#answer p {
    margin-bottom: 1rem;
}

#answer ul,
#answer ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

#answer code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: "Poly Sans Slim", monospace;
}

#answer pre {
    background-color: #f5f5f5;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

#answer blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

#answer a {
    color: #007bff;
    text-decoration: none;
}

#answer a:hover {
    text-decoration: underline;
}

#answer sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    top: -0.5em;
}

#answer sup a {
    color: #007bff;
    text-decoration: none;
    margin: 0 2px;
}

#answer sup a:hover {
    text-decoration: underline;
}

.highlight {
    background-color: #c4c4c4;
    padding: 0.2em;
    border-radius: 4px;
}

.image-grid,
.skeleton-image-grid {
    display: grid;
    max-width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.image-grid-item,
.skeleton-image {
    width: 100%;
    padding-top: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-grid-item:nth-child(1),
.skeleton-image:nth-child(1) {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.image-grid-item:nth-child(2),
.image-grid-item:nth-child(3),
.skeleton-image:nth-child(2),
.skeleton-image:nth-child(3) {
    border-radius: 0;
}

.image-grid-item:nth-child(4),
.skeleton-image:nth-child(4) {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.image-skeleton-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.image-grid-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    z-index: 1;
    opacity: 0;
}

.image-grid-item img:hover {
    transform: scale(1.05);
}

.skeleton-element {
    background: #eee;
    background: linear-gradient(270deg, #f1f1f1, #e1e1e1, #f1f1f1);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: gradientMoves 800ms linear infinite;
}

@keyframes gradientMoves {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.skeleton-loader {
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem;
}

.skeleton-left {
    flex: 1;
    max-width: 65%;
}

.skeleton-right {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-title {
    width: 80%;
    height: 32px;
    margin-top: 1.5rem;
    margin-bottom: 1.0rem;
}

.skeleton-text {
    width: 100%;
    height: 20px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.skeleton-image::after {
    content: '';
    display: block;
    background: inherit;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.source-item {
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 0.75rem;
    transition: background-color 0.3s ease;
}

.source-item:hover {
    background-color: #f1f1f1;
}

.source-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.favicon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.source-url {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-title {
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.source-title:hover {
    text-decoration: underline;
}

.toolbar {
    align-items: center;
    display: flex;
}

.toolbar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    transition: background-color 0.3s ease;
    padding: 0;
    border-radius: 7px;
}

.toolbar-button:hover {
    background-color: #f6f6f6;
}

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

.tts-spinner {
    animation: spin-icon 1s linear infinite;
}

.tts-button {
    display: none;
}

.icon-md-heavy {
    width: 24px;
    height: 24px;
}

.content-seperator {
    display: none;
}

.answerContainer {
    width: 100%;
    margin-bottom: 2rem;
}

.results-container {
    display: flex;
    margin-top: 2rem;
    justify-content: space-between;
}

.general-web-results {
    flex: 0 0 65%;
    width: 60%;
    margin-right: 1rem;
}

.quick-results {
    flex: 0 0 35%;
    width: 40%;
}

.quickResultsContainer {
    width: 300px;
    margin-left: 20px;
    flex-shrink: 0;
}

.quick-pod {
    margin-bottom: 20px;
}

.quick-pod-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.quick-subpod-title {
    font-size: 0.9rem;
    font-weight: normal;
    margin-bottom: 5px;
    color: #555;
}

.quick-pod-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .quickResultsContainer {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .results-container {
        flex-direction: column;
    }

    .general-web-results,
    .quick-results {
        flex: none;
        margin-right: 0;
    }
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 84%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background-color: none;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spinner {
    display: none;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.web-result-item {
    margin-bottom: 1.5rem;
}

.web-result-title {
    font-size: 1.2rem;
    color: #1a0dab;
    text-decoration: none;
}

.web-result-title:hover {
    text-decoration: underline;
}

.web-result-header {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
}

.web-result-favicon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.web-result-url {
    font-size: 0.9rem;
    color: #006621;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.web-result-description {
    font-size: 0.9rem;
    color: #4d5156;
    line-height: 1.58;
}

.images-grid {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.image-row {
    display: flex;
    margin-bottom: 8px;
}

.image-item {
    overflow: hidden;
    border-radius: 4px;
    background-color: #f5f5f5;
    cursor: pointer;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

.create-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.create-container h2 {
    font-family: "Poly Sans Bulky", Arial, sans-serif;
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
}

#create-form {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.create-input-group {
    display: flex;
    width: 100%;
    gap: 10px;
}

#create-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

#create-input:focus {
    border-color: #007bff;
}

#create-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#create-button:hover {
    background-color: #0056b3;
}

.create-result {
    width: 100%;
    max-width: 600px;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-spinner .spinner {
    border: 6px solid rgba(0, 123, 255, 0.3);
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

.feedback-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
    font-size: 1rem;
}

.feedback-message.success {
    background-color: #d4edda;
    color: #155724;
}

.feedback-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

.image-display {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 300px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#image-display img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

#create-placeholder {
    font-size: 1rem;
    color: #666;
}

@media (max-width: 768px) {
    .create-input-group {
        flex-direction: column;
        width: 100%;
    }

    #create-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .create-container h2 {
        font-size: 1.5rem;
    }

    .create-input-group {
        gap: 5px;
    }
}

.spinner-svg {
    animation: rotate 2s linear infinite;
    width: 60px;
    height: 60px;
}

.path {
    stroke: #007bff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

body.search-active {
    padding-top: 75px;
    justify-content: flex-start;
}

body.search-active .navbar {
    opacity: 1;
}

body.search-active #logo {
    font-size: 2rem;
    position: fixed;
    top: 15px;
    left: 20px;
    margin: 0;
}

body.search-active #logo a {
    pointer-events: auto;
}

body.search-active #logo a:hover {
    text-decoration: underline;
    text-decoration-color: black;
}

body.search-active #search-form {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px 0;
}

body.search-active .search-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

body.search-active .content-seperator {
    display: block;
}

body.search-active .tab-navigation {
    display: flex;
}

body.search-active .tab-pane {
    padding: 3rem 1rem;
}

body.search-active .tab-content {
    height: calc(100vh - 80px);
}

body.search-active .answerContainer {
    min-height: 200px;
}

@media (max-width: 768px) {
    .answerContent {
        flex-direction: column;
    }

    .answer-left,
    .answer-right {
        max-width: 100%;
    }

    .sources-grid {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    #logo {
        font-size: 3rem;
    }

    .tts-button {
        margin-top: 15px;
    }

    .search-container {
        width: 100%;
    }

    body.search-active .search-container {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .sources-grid {
        flex-direction: column;
    }
}

.web-result-item.skeleton-web-result-item {
    margin-bottom: 1.5rem;
}

.web-result-item.skeleton-web-result-item .skeleton-title {
    width: 60%;
    height: 20px;
    margin-bottom: 0.5rem;
}

.web-result-item.skeleton-web-result-item .web-result-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.web-result-item.skeleton-web-result-item .skeleton-favicon {
    width: 16px;
    height: 16px;
    border-radius: 25%;
    margin-right: 0.5rem;
}

.web-result-item.skeleton-web-result-item .skeleton-url {
    width: 30%;
    height: 14px;
}

.web-result-item.skeleton-web-result-item .skeleton-description {
    width: 98%;
    height: 14px;
    margin-bottom: 0.5rem;
}

.quick-pod.skeleton-quick-pod {
    margin-bottom: 20px;
}

.quick-pod.skeleton-quick-pod .skeleton-quick-title {
    width: 70%;
    height: 18px;
    margin-bottom: 10px;
}

.quick-pod.skeleton-quick-pod .skeleton-quick-image {
    width: 100%;
    height: 150px;
    border-radius: 4px;
}

@keyframes gradientMoves {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

.web-result-item.skeleton-web-result-item .web-result-title:hover,
.quick-pod.skeleton-quick-pod:hover {
    text-decoration: none;
    background-color: transparent;
}