/* Base Styles */
:root {
    --primary-color: #800000;
    --text-primary: #000000;
    --text-secondary: #828282;
    --text-tertiary: white;
    --bg-primary: #f6f6ef;
    --bg-secondary: #ffffff;
    --border-color: #cccccc;
    --link-color: #0000ee;
    --link-visited: #551a8b;
    --success-color: #059862;
    --error-color: #d93025;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    min-width: 320px;
}

/* Header */
.header {
    background-color: var(--primary-color);
    padding: 2px;
    overflow-x: auto;
}

.nav-main {
    display: flex;
    align-items: center;
    padding: 4px 0;
    position: relative; 
    min-height: 30px; 
    font-size: 13px;
}

.nav-right {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-left {
    padding-right: 200px; 
}

.site-title {
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
    padding: 2px 4px;
    background-color: var(--bg-secondary);
    margin-right: 8px;
    flex-shrink: 0; /* Prevent shrinking */
}

.nav-link {
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 2px 4px;
    white-space: nowrap; /* Prevent breaking */
}

.nav-link:hover {
    text-decoration: underline;
}

button.nav-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
    gap: 4px;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-tertiary);
    transition: 0.3s;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        position: static;
        transform: none;
        margin-right: 8px;
    }
    
    .nav-main {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .site-title {
        margin-left: 0;
        flex-shrink: 0;
    }
    
    .nav-left {
        position: fixed;
        top: 34px;
        left: -100%;
        width: 250px;
        background-color: var(--primary-color);
        padding: 15px;
        transition: left 0.3s ease;
        z-index: 99;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        max-height: calc(100vh - 34px);
        overflow-y: auto;
        /* Remove from flex flow */
        position: fixed !important;
        padding-right: 0;
    }
    
    .menu-toggle:checked ~ .nav-left {
        left: 0;
    }
    
    .nav-left .nav-link,
    .nav-left .mod-link {
        display: block;
        padding: 8px 4px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-left .nav-separator {
        display: none;
    }
    
    .nav-right {
        position: static;
        transform: none;
        margin-left: auto;
        padding-right: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    /* Hamburger animation when open */
    .menu-toggle:checked ~ .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle:checked ~ .hamburger span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle:checked ~ .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

.rep-badge {
    color: var(--text-secondary);
    font-size: 11px;
    margin-left: 4px;
}

.inline {
    display: inline;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 20px 0;
    background-color: var(--bg-primary);
}

/* Forms */
.form-container {
    max-width: 420px;     
    margin: 60px auto;       
    padding: 30px 40px;     
    background-color: var(--bg-secondary);
    border: 1px solid #eaeaea; 
    border-radius: 8px;      
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
}

.form-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-primary);
    text-align: center; 
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
}

.form-input, 
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;        
    padding: 10px 12px;      
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fafafa;
    transition: all 0.2s ease;
    box-sizing: border-box; 
}

.form-input:focus,
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.1);
}

.form-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
}

.form-help {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 15px;
    text-align: center;   
}

/* Button Overrides for Forms */
.form-container .btn {
    width: 100%;          
    padding: 10px;
    font-weight: 600;
    font-size: 14px;
}

.form-container .btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    transition: opacity 0.2s;
}

.form-container .btn-primary:hover {
    opacity: 0.9;
}

/* Social Auth Refinements */
.social-auth-section {
    margin-bottom: 25px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.1s;
}

.btn-social:hover {
    background-color: #f8f9fa;
    border-color: #ccc;
    text-decoration: none;
}

.social-icon {
    margin-right: 12px;
}

/* Divider styling */
.divider {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #eee;
}

.divider-text {
    position: relative;
    display: inline-block;
    padding: 0 10px;
    background-color: var(--bg-secondary);
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn:hover:not(.btn-primary) {
    background-color: var(--bg-primary);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-secondary);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color);
    opacity: 0.85;
}

.btn-danger {
    color: var(--error-color);
    border-color: var(--error-color);
}

/* Messages */
.message {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    position: relative;
}

.message-success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.message-error {
    border-color: var(--error-color);
    color: var(--error-color);
}

.message-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Profile */
.profile-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.profile-username {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.profile-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

.profile-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

/* Lists */
.item-list {
    list-style: none;
}

.item-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.item-title {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
}

.item-title:hover {
    text-decoration: underline;
}

.item-meta {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 2px;
}

.item-score {
    color: var(--text-secondary);
    font-size: 11px;
}

/* User List */
.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-weight: normal;
    color: var(--text-secondary);
    font-size: 12px;
}

.user-table td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.user-rank {
    color: var(--text-secondary);
    width: 40px;
}

.user-link {
    color: var(--text-primary);
    text-decoration: none;
}

.user-link:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 2px solid var(--primary-color);
    background-color: var(--bg-primary);
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 11px;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Voting Buttons */
.vote-buttons {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    color: var(--text-secondary);
    font-size: 11px;
}

.vote-btn:hover {
    color: var(--primary-color);
}

.vote-btn.voted {
    color: var(--primary-color);
    font-weight: bold;
}

.vote-score {
    color: var(--text-secondary);
    font-size: 11px;
    margin: 0 4px;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 2px 6px;
    background-color: #f0f0f0;
    color: var(--text-primary);
    font-size: 11px;
    text-decoration: none;
    margin-right: 4px;
}

.tag:hover {
    background-color: #e0e0e0;
    text-decoration: none;
}

.tag-field {
    background-color: #e8f4f8;
}

/* Responsive */
@media (max-width: 768px) {
    
    .form-container {
        margin: 20px;
        max-width: none;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Search enhancements */
.search-results-info {
    padding: 10px 15px;
    background: #f6f6ef;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.clear-search {
    color: #666;
    text-decoration: none;
    font-size: 12px;
}

.clear-search:hover {
    text-decoration: underline;
}

.search-highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

.search-tips {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Loading indicator for HTMX */
.htmx-request #claims-results {
    opacity: 0.6;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
    margin-left: 10px;
}

/* Search input focus */
#search-input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* Button group for search */
.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Markdown content styling */
.claim-description strong {
    font-weight: bold;
}

.claim-description em {
    font-style: italic;
}

.claim-description a {
    color: #0066cc;
    text-decoration: underline;  /* ← Always underlined */
}

.claim-description a:hover {
    text-decoration: underline;
    color: #0052a3;  /* ← Optional: darker blue on hover for better UX */
}

/* Static Pages Styles */

/* Page Container */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

/* Content Sections */
.page-content {
    line-height: 1.6;
    color: var(--text-primary);
}

.page-content p {
    margin-bottom: 15px;
}

.page-content h2 {
    font-size: 15px;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.page-content h3 {
    font-size: 13px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.page-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
    list-style-type: disc;
}

.page-content ul li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.page-content a {
    color: var(--link-color);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content a:visited {
    color: var(--link-visited);
}

/* Last Updated Text */
.last-updated {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-style: italic;
}

/* Claim Form Enhancements */

.char-counter {
    font-size: 12px;
    color: #828282;
    margin-top: 4px;
}

.char-counter.char-warning {
    color: #ff6600;
    font-weight: 600;
}

.demonstrative-warning {
    margin-top: 8px;
    padding: 10px;
    background-color: #fff4e6;
    border: 1px solid #ffcc99;
    border-radius: 3px;
    font-size: 13px;
    color: #cc6600;
    line-height: 1.5;
}

.demonstrative-warning strong {
    color: #993d00;
}

.author-indicator {
    font-size: 11px;
    color: #828282;
    font-style: italic;
    text-align: center;
    padding: 4px 8px;
    background: #f6f6ef;
    border-radius: 3px;
    display: block;
}

/* Social Authentication */
.social-auth-section {
    margin-bottom: 25px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-social:hover {
    background-color: var(--bg-primary);
}

.social-icon {
    margin-right: 10px;
    flex-shrink: 0;
}

.divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.divider-text {
    position: relative;
    display: inline-block;
    padding: 0 10px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
}