/**
 * CompuServe Archive Plugin Styles
 */

.cis-search-container,
.cis-single-message,
.cis-thread-view,
.cis-user-profile,
.cis-forum-list {
    font-size: 14px;
}

/* Tab strip - shown at the top of every page the plugin renders, so
   visitors can move between Search / Browse Forums / (when viewing one)
   the current User without needing separate site navigation set up. */
.cis-tab-nav {
    display: flex;
    gap: 2px;
    margin-bottom: 1em;
    border-bottom: 2px solid #ddd;
    overflow-x: auto;
}

.cis-tab {
    font-family: monospace;
    font-size: 0.85em;
    letter-spacing: 0.02em;
    color: #666;
    text-decoration: none;
    padding: 0.5em 1em;
    white-space: nowrap;
    border-radius: 4px 4px 0 0;
    position: relative;
    top: 2px;
}

.cis-tab:hover {
    color: #222;
    background: #f5f5f5;
}

.cis-tab-active,
.cis-tab-active:hover {
    color: #0073aa;
    background: white;
    border: 2px solid #ddd;
    border-bottom: 2px solid white;
}

/* Search Form */
.cis-search-container {
    max-width: 1200px;
    margin: 1.2em auto;
    padding: 0 1em;
}

.cis-search-form {
    background: #f5f5f5;
    padding: 1.2em;
    border-radius: 8px;
    margin-bottom: 1.2em;
}

.cis-search-main {
    display: flex;
    gap: 0.6em;
    margin-bottom: 0.6em;
}

.cis-search-input {
    flex: 1;
    padding: 0.5em 0.75em;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.cis-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.cis-search-button {
    padding: 0.5em 1.5em;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.cis-search-button:hover {
    background: #005a87;
}

.cis-search-filters {
    padding-top: 0.6em;
    border-top: 1px solid #ddd;
}

.cis-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6em;
    margin-bottom: 0.6em;
}

.cis-filter-row label {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    font-weight: 600;
    font-size: 0.9em;
}

.cis-filter-row input,
.cis-filter-row select {
    padding: 0.4em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
}

/* Search Results */
.cis-search-results h3 {
    margin-bottom: 0.6em;
    color: #333;
    font-size: 1.1em;
}

.cis-message-result {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.9em 1.1em;
    margin-bottom: 0.6em;
    transition: box-shadow 0.2s;
}

.cis-message-result:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cis-message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.3em;
}

.cis-message-header strong a {
    color: #0073aa;
    text-decoration: none;
    font-size: 1.05em;
}

.cis-message-header strong a:hover {
    text-decoration: underline;
}

.cis-message-meta {
    color: #555;
    font-size: 0.85em;
}

.cis-message-info {
    display: flex;
    gap: 1em;
    margin-bottom: 0.5em;
    font-size: 0.85em;
    color: #555;
}

.cis-message-info a {
    color: #0073aa;
    text-decoration: none;
}

.cis-message-info a:hover {
    text-decoration: underline;
}

.cis-message-excerpt {
    color: #111;
    line-height: 1.4;
}

.cis-thread-info {
    margin-top: 0.6em;
    padding-top: 0.6em;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: #555;
}

/* Pagination */
.cis-pagination {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-top: 1.2em;
}

.cis-pagination a {
    padding: 0.4em 0.9em;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.cis-pagination a:hover {
    background: #005a87;
}

.cis-page-num {
    padding: 0.4em 0.7em;
    border-radius: 4px;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

a.cis-page-num {
    background: #f0f0f0;
    color: #0073aa;
}

a.cis-page-num:hover {
    background: #e2e2e2;
}

.cis-page-current {
    background: #0073aa;
    color: white;
    font-weight: 600;
}

.cis-page-gap {
    color: #888;
    padding: 0 0.2em;
}

.cis-page-summary {
    text-align: center;
    color: #555;
    font-size: 0.85em;
    margin-top: 0.5em;
}

.cis-no-results {
    text-align: center;
    padding: 1.2em;
    color: #555;
    font-style: italic;
}

/* Single Message View */
.cis-single-message {
    max-width: 900px;
    margin: 1.2em auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.2em 1.5em;
}

.cis-single-message h2 {
    margin-top: 0;
    color: #111;
    font-size: 1.25em;
}

.cis-message-metadata {
    background: #f9f9f9;
    padding: 0.6em 0.8em;
    border-radius: 4px;
    margin: 0.6em 0;
    color: #111;
}

.cis-metadata-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    padding: 0.3em 0;
    border-bottom: 1px solid #e2e2e2;
    font-size: 0.9em;
}

.cis-metadata-row:last-child {
    border-bottom: none;
}

.cis-metadata-label {
    font-weight: 600;
    color: #555;
}

.cis-message-body {
    margin-top: 1.2em;
    padding-top: 1.2em;
    border-top: 2px solid #ddd;
    line-height: 1.5;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.95em;
    color: #111;
}

/* Thread View */
.cis-thread-view {
    max-width: 1000px;
    margin: 1.2em auto;
}

.cis-thread-message {
    margin-left: calc(var(--thread-depth, 0) * 1.5em);
    margin-bottom: 0.6em;
    border-left: 3px solid #0073aa;
    padding: 0.6em 0 0.6em 0.8em;
    background: #f5f5f5;
    border-radius: 0 6px 6px 0;
}

.cis-thread-message.cis-depth-0 {
    border-left-width: 5px;
    background: transparent;
    padding-left: 0.8em;
}

.cis-thread-message-body {
    margin-top: 0.5em;
    padding-top: 0;
    border-top: none;
    font-size: 0.92em;
}

/* User Profile */
.cis-user-profile {
    max-width: 800px;
    margin: 1.2em auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.2em 1.5em;
}

.cis-user-cis-id {
    color: #555;
    font-family: monospace;
    font-size: 0.9em;
    margin-top: -0.6em;
}

.cis-user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6em;
    margin: 1.2em 0;
}

.cis-stat-box {
    background: #f9f9f9;
    padding: 0.9em;
    border-radius: 4px;
    text-align: center;
}

.cis-stat-value {
    font-size: 1.6em;
    font-weight: bold;
    color: #0073aa;
    font-variant-numeric: tabular-nums;
}

.cis-stat-label {
    color: #555;
    margin-top: 0.3em;
    font-size: 0.85em;
}

.cis-user-messages .cis-message-result {
    padding: 0.7em 0.9em;
}

/* Action buttons - "View All Messages by X", "Browse Messages" */
.cis-user-profile .button,
.cis-forum-item .button {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 0.5em 1.1em;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
}

.cis-user-profile .button:hover,
.cis-forum-item .button:hover {
    background: #005a87;
}

/* Forum attribution confidence */
.cis-forum-guess {
    font-style: italic;
    color: #a06b00;
    font-weight: normal;
}

.cis-forum-unknown {
    color: #999;
    font-style: italic;
}

.cis-forum-unknown-note {
    font-size: 0.85em;
    color: #999;
    margin-top: 0.3em;
}

/* Forum List */
.cis-forum-list {
    max-width: 1000px;
    margin: 1.2em auto;
}

.cis-forum-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.9em 1.1em;
    margin-bottom: 0.6em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    flex-wrap: wrap;
}

.cis-forum-item h3 {
    margin: 0 0 0.15em;
    font-size: 1.05em;
}

.cis-forum-item .button {
    flex: 0 0 auto;
}

.cis-forum-stats {
    color: #555;
    font-size: 0.9em;
    font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 768px) {
    .cis-filter-row {
        grid-template-columns: 1fr;
    }
    
    .cis-search-main {
        flex-direction: column;
    }
    
    .cis-message-info {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .cis-thread-message {
        margin-left: calc(var(--thread-depth, 0) * 1em);
    }
}
