/* Base site styles loaded after Tailwind. */

/* Safe area insets for notch devices */
html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Hide scrollbar but allow scrolling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile touch improvements */
* {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Alpine.js */
[x-cloak] {
    display: none !important;
}

/* Prevent overscroll bounce */
.no-bounce {
    overscroll-behavior: none;
}

/* Prediction content styles */
.prediction-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #d4a574;
    margin-bottom: 0.75rem;
}

.prediction-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #e8c49a;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #404040;
}

.prediction-content h4:first-child {
    margin-top: 0;
}

.prediction-content p {
    margin-bottom: 0.75rem;
    line-height: 1.75;
    color: #e0e0e0;
}

.prediction-content hr {
    border-color: #404040;
    margin: 1rem 0;
}

.prediction-content ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0.75rem;
}

.prediction-content li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
    padding-left: 1.25rem;
    position: relative;
}

.prediction-content li::before {
    content: '\2022';
    color: #d4a574;
    font-size: 1.1em;
    position: absolute;
    left: 0;
    top: 0;
}

.prediction-content strong {
    color: #d4a574;
    font-weight: 600;
}

.prediction-content em {
    color: #a0a0a0;
}

/* Summary box at end of long responses */
.chat-summary {
    margin-top: 1.5rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(212, 165, 116, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 0.625rem;
}

.chat-summary-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.chat-summary p {
    color: #c0c0c0;
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Header icon buttons */
.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #a0a0a0;
    transition: all 0.2s;
}

.header-icon:hover {
    background: rgba(212, 165, 116, 0.1);
    color: #d4a574;
}

.header-icon svg {
    width: 20px;
    height: 20px;
}

/* Scroll to bottom button */
.scroll-to-bottom {
    position: fixed;
    bottom: 20px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(139, 92, 246, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.scroll-to-bottom.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-bottom:active {
    transform: scale(0.95);
}

/* Form input improvements for mobile */
input,
select,
textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
}

/* Hide desktop footer on mobile */
@media (max-width: 767px) {
    .desktop-footer {
        display: none;
    }
}

/* Long-form guide typography */
.article-body h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
    color: #f5f5f5;
}

@media (min-width: 768px) {
    .article-body h2 {
        font-size: 1.875rem;
    }
}

.article-body h3 {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #f5f5f5;
}

.article-body p {
    color: #a0a0a0;
    line-height: 1.8;
}

.article-body ul,
.article-body ol {
    margin-left: 1.25rem;
    color: #a0a0a0;
    line-height: 1.8;
}

.article-body ul {
    list-style-type: disc;
}

.article-body ol {
    list-style-type: decimal;
}

.article-body li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.article-body strong {
    color: #f5f5f5;
    font-weight: 600;
}

.article-body a {
    color: #d4a574;
    text-decoration: underline;
    text-decoration-color: rgba(212, 165, 116, 0.4);
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: #e8c49a;
}

.article-body .article-table-wrap {
    overflow-x: auto;
    border: 1px solid #404040;
    border-radius: 0.75rem;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: #a0a0a0;
}

.article-body caption {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    color: #8a8a8a;
}

.article-body thead {
    background: #2d2d2d;
    color: #f5f5f5;
}

.article-body th,
.article-body td {
    padding: 0.65rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #404040;
}

.article-body th {
    font-weight: 600;
    white-space: nowrap;
}

.article-body tbody tr:last-child td {
    border-bottom: 0;
}
