/* Typing animation */
.dot-typing {
    position: relative;
    left: -9999px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--primary-bg);
    color: var(--primary-bg);
    animation: dot-typing 1.5s infinite linear;
}

@keyframes dot-typing {
    0% {
        box-shadow: 9984px 0 0 0 var(--primary-bg), 9999px 0 0 0 var(--primary-bg), 10014px 0 0 0 var(--primary-bg);
    }
    16.667% {
        box-shadow: 9984px -10px 0 0 var(--primary-bg), 9999px 0 0 0 var(--primary-bg), 10014px 0 0 0 var(--primary-bg);
    }
    33.333% {
        box-shadow: 9984px 0 0 0 var(--primary-bg), 9999px -10px 0 0 var(--primary-bg), 10014px 0 0 0 var(--primary-bg);
    }
    50% {
        box-shadow: 9984px 0 0 0 var(--primary-bg), 9999px 0 0 0 var(--primary-bg), 10014px -10px 0 0 var(--primary-bg);
    }
    66.667% {
        box-shadow: 9984px -10px 0 0 var(--primary-bg), 9999px 0 0 0 var(--primary-bg), 10014px 0 0 0 var(--primary-bg);
    }
    83.333% {
        box-shadow: 9984px 0 0 0 var(--primary-bg), 9999px -10px 0 0 var(--primary-bg), 10014px 0 0 0 var(--primary-bg);
    }
    100% {
        box-shadow: 9984px 0 0 0 var(--primary-bg), 9999px 0 0 0 var(--primary-bg), 10014px -10px 0 0 var(--primary-bg);
    }
}

/* Spinner for send button */
.spinner {
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}

.table-wrapper {
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-size: small;
    overflow-x: auto;
    max-width: 100%;
}

/* Round corners for first and last cells in header row */
thead tr:first-child th:first-child {
    border-top-left-radius: 0.75rem;
}

thead tr:first-child th:last-child {
    border-top-right-radius: 0.75rem;
}

/* Round corners for first and last cells in last row */
tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.75rem;
}

tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.75rem;
}

thead {
    background-color: var(--primary-bg);
    color: white;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: #f0f9f1; /* Light green for even rows */
}

tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

tbody tr:hover {
    background-color: #e5f5ea; /* Slightly darker green for hover */
}

td {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5f5ea;
}

/* Caption styling if needed */
caption {
    font-weight: bold;
    padding: 0.5rem;
    color: var(--primary-bg)
}

/* Responsive table */
@media (max-width: 640px) {
    table {
        display: block;
        overflow-x: auto;
    }
}

/* Make table container automatically have scrollbars when needed */
.table-responsive {
    overflow-x: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.content h1 {
    font-size: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content h2 {
    font-size: 1.3rem;
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.content h3 {
    font-size: 1.1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

@keyframes popup {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-popup {
  animation: popup 0.3s ease-out forwards;
}

/* List styling */
.content ul, .content ol {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.content ul {
    list-style-type: none;
}

.content ul li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
}

.content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--primary-bg);
    border-radius: 50%;
}

.content ol {
    list-style-type: decimal;
    counter-reset: item;
}

.content ol li {
    position: relative;
    margin-bottom: 0.5rem;
}

/* Nested lists */
.content ul ul, 
.content ol ol,
.content ul ol,
.content ol ul {
    margin: 0.5rem 0 0.5rem 0.5rem;
}

.content ul ul li::before {
    background-color: var(--primary-bg);
    width: 0.4rem;
    height: 0.4rem;
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
    .content ul, .content ol {
        padding-left: 1.2rem;
    }
    
    .content ul li {
        padding-left: 1rem;
    }
}

.reference-tag {
    display: inline-block;
    font-size: 0.75rem;
    background-color: #e9f5f2;
    color: #2d8a6e;
    border: 1px solid #a8d5c8;
    border-radius: 3px;
    padding: 0px 4px;
    margin: 0 2px;
    cursor: help;
    position: relative;
    font-weight: bold;
}

.reference-tag:hover {
    background-color: #d0ebdf;
}

.reference-tag:hover::after {
    content: attr(data-source);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 5px;
}

.reference-tag:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
    margin-bottom: 0px;
}