/* RSATHAI Webboard Enhanced Styles */

.reference-notice {
    background: linear-gradient(135deg, #e3f2fd, #f0f8ff);
    border: 1px solid #1d7876;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #1d7876;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.reference-notice::before {
    content: "📖";
    margin-right: 8px;
    font-size: 16px;
}

.ai-info {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.ai-info::before {
    content: "✨";
    margin-right: 5px;
}

/* Stats enhancement */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-weight: bold;
    font-size: 16px;
    color: #1d7876;
}

/* Enhanced question cards */
.question-card {
    background: white;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #1d7876;
}

.question-card-header {
    margin-bottom: 15px;
}

.question-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.4;
}

.question-title a {
    color: #1d7876;
    text-decoration: none;
}

.question-title a:hover {
    text-decoration: underline;
}

#question-text{color:#333;}

.question-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.question-preview {
    color: #444;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
}

.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: #f0f8ff;
    color: #1d7876;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #e3f2fd;
}

.answer-status {
    font-size: 13px;
    font-weight: 500;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
}

.answer-status.pending {
    color: #d97706;
}

/* Enhanced form styling */
.ask-question-card {
    background: linear-gradient(135deg, #1d7876, #005177);
    color: white;
    border: none !important;
}

.ask-question-card h3 {
    color: white;
    margin-bottom: 15px;
}

.question-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

.question-form textarea:focus {
    outline: none;
    border-color: #1d7876;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.submit-btn {
    background: white;
    color: #1d7876;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background: #f0f8ff;
    transform: translateY(-1px);
}

/* Search and filter bar */
.search-filter-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e2e4e7;
}

.search-box {
    flex: 1;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #1d7876;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.search-box button,
.filter-dropdown select {
    padding: 10px 20px;
    background: #1d7876;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.search-box button:hover {
    background: #005177;
}

.filter-dropdown select {
    background: white;
    color: #333;
    border: 1px solid #ddd;
}

/* Webboard layout */
.webboard-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .webboard-container {
        grid-template-columns: 1fr;
    }
    
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

.webboard-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-card {
    background: white;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* Category list */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-item:hover {
    background: #f0f8ff;
    color: #1d7876;
}

.category-item.active {
    background: #1d7876;
    color: white;
}

.category-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.category-item.active .category-count {
    background: rgba(255,255,255,0.3);
}

.category-item:not(.active) .category-count {
    background: #f0f8ff;
    color: #1d7876;
}

/* Questions grid */
.questions-grid {
    display: grid;
    gap: 20px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #333;
}

/* Load more button */
.load-more-container {
    text-align: center;
    padding: 30px 0;
}

.load-more-btn {
    background: #1d7876;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #005177;
    transform: translateY(-1px);
}

/* Answer formatting */
.ai-response-content {
    line-height: 1.6;
    color: #333;
}

.ai-response-content p {
    margin: 0 0 15px 0;
}

.ai-response-content ul.answer-list {
    margin: 15px 0;
    padding-left: 20px;
}

.ai-response-content ul.answer-list li {
    margin: 8px 0;
    line-height: 1.5;
}

.answer-tags-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.answer-tags-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-badge {
    background: #e3f2fd;
    color: #1d7876;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #b3e5fc;
}

.answer-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 25px;
}

.answer-disclaimer p {
    margin: 0;
    font-size: 14px;
    color: #856404;
}

.answer-disclaimer a {
    color: #1d7876;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 1024px) {
    .webboard-container {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #rsathai-webboard {
        padding: 10px;
        margin: -10px;
        padding-top: 20px;
    }
    
    .webboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar-card {
        padding: 15px;
    }
    
    .question-card {
        padding: 15px;
    }
    
    .search-filter-bar {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        align-self: stretch;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1d7876;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced visual feedback */
.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Print styles */
@media print {
    .webboard-sidebar,
    .search-filter-bar,
    .load-more-container {
        display: none;
    }
    
    .webboard-container {
        grid-template-columns: 1fr;
    }
    
    .question-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* LINE Login Styles */
.line-login-prompt {
    text-align: center;
    padding: 20px;
}

.line-login-prompt p {
    margin-bottom: 20px;
    color: #666;
}

.line-login-btn {
    background: #00B900;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.line-login-btn:hover {
    background: #009900;
    transform: translateY(-1px);
}

.line-login-btn img {
    width: 24px;
    height: 24px;
}

.privacy-note {
    display: block;
    margin-top: 15px;
    font-size: 12px;
    color: #999;
}

/* User Info Bar */
.user-info-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.logout-btn {
    margin-left: auto;
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #d32f2f;
}

/* Pagination Styles */
.webboard-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: white;
    color: #333;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: #f5f5f5;
    border-color: #0073aa;
    color: #0073aa;
}

.page-link.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    cursor: default;
}

.page-link.prev,
.page-link.next {
    font-weight: 600;
    padding: 0 16px;
}

.page-dots {
    color: #999;
    padding: 0 8px;
    font-weight: 600;
}

/* Remove load more button styles */
.load-more-container {
    display: none !important;
}