/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 * cf. https://www.jameskerr.blog/posts/fix-for-kamal-deploy-assets-not-updating/
 */

/* ChatCGP Styles */

/* Three-dot loader animation */
.loader-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.loader-dots.hidden {
    display: none;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9CA3AF;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

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

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Markdown content styling */
.markdown-content {
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-weight: 600;
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.markdown-content h1 {
    font-size: 1.5em;
}

.markdown-content h2 {
    font-size: 1.25em;
}

.markdown-content h3 {
    font-size: 1.1em;
}

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.25em;
    list-style-type: disc;
}

.markdown-content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875em;
    line-height: 1.5;
}

.markdown-content blockquote {
    border-left: 4px solid rgba(0, 0, 0, 0.1);
    padding-left: 1em;
    margin-left: 0;
    margin-bottom: 1em;
    color: rgba(0, 0, 0, 0.7);
    font-style: italic;
}

.markdown-content a {
    color: #4f46e5;
    text-decoration: underline;
}

.markdown-content a:hover {
    color: #4338ca;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5em;
    text-align: left;
}

.markdown-content th {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1.5em 0;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dropdown transition */
.dropdown-transition {
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.dropdown-transition.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Question Panel - appears above input area, scoped to chat container */
.question-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid black;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 50%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.question-panel.question-panel-visible {
    transform: translateY(0);
}

.question-panel.hidden {
    display: none;
}

.question-panel-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.question-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.question-panel-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.question-panel-content {
    padding: 1rem 1.25rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.question-panel-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    background: white;
}

/* Question Card */
.question-card {
    background: transparent;
    border: none;
    padding: 0;
}

.question-header {
    margin-bottom: 0.5rem;
}

.question-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: black;
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #000;
    margin-bottom: 0.75rem;
}

/* Question Options */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.question-option {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.question-option:hover {
    border-color: black;
    background: #f9fafb;
}

.question-option:has(input:checked) {
    border-color: black;
    background: #f3f4f6;
}

.question-option input:checked ~ .question-option-content .question-option-label {
    font-weight: 600;
}

.question-option-input {
    margin-right: 0.625rem;
    flex-shrink: 0;
}

.question-option-content {
    flex: 1;
}

.question-option-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #000;
}

.question-option-description {
    font-size: 0.6875rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.question-other-input {
    margin-left: 1.5rem;
    margin-top: 0.375rem;
}

.question-other-input input {
    width: 100%;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
}

.question-panel-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s ease;
}

.question-panel-dismiss:hover {
    color: #000;
}

/* Navigation Dots */
.question-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.question-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.question-dot:hover {
    background: #9ca3af;
    transform: scale(1.2);
}

.question-dot-active {
    background: #000;
    width: 0.5rem;
    height: 0.5rem;
}

.question-dot-answered {
    background: #10b981;
}

.question-dot-answered.question-dot-active {
    background: #000;
}

/* Navigation Row (arrows + dots) */
.question-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.question-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.question-nav-arrow:hover {
    border-color: #000;
    color: #000;
    background: #f9fafb;
}

.question-nav-arrow:active {
    background: #f3f4f6;
}

.question-nav-arrow.invisible {
    visibility: hidden;
}