/**
 * RDL (Resource Directory Listing) Stylesheet
 * NexusFi Resource Directory - Themed to match NexusFi.com
 * Version: 1.0.0
 */

:root {
    /* NexusFi Color Palette */
    --color-primary: #0A2D57;
    --color-primary-light: #264577;
    --color-primary-dark: #061d3a;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-danger: #dc3545;
    --color-text: #264577;
    --color-text-secondary: #5f6368;
    --color-text-light: #ffffff;
    --color-border: #dadce0;
    --color-bg: #ffffff;
    --color-bg-secondary: #F6F6F6;
    --color-link: #264577;
    --radius: 4px;
    --shadow: 0 1px 3px rgba(10, 45, 87, 0.12), 0 1px 2px rgba(10, 45, 87, 0.24);
    --shadow-hover: 0 4px 12px rgba(10, 45, 87, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg-secondary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.rdl-header {
    background: var(--color-primary);
    color: var(--color-text-light);
    padding: 15px 0;
    border-bottom: 3px solid var(--color-primary-dark);
}

.rdl-header a {
    color: var(--color-text-light);
}

.breadcrumb {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb a {
    color: var(--color-text-light);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 8px;
}

/* Listing Detail Page */
.listing-detail {
    padding: 20px;
}

.listing-header {
    background: var(--color-bg);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
    border-left: 4px solid var(--color-primary);
}

.listing-header h1 {
    margin: 0 0 10px;
    font-size: 28px;
    color: var(--color-primary);
}

.listing-header .website {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-text-light);
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.listing-header .website:hover {
    background: var(--color-primary-dark);
    text-decoration: none;
}

.listing-header .description {
    color: var(--color-text-secondary);
    font-size: 15px;
    margin: 15px 0 0;
    line-height: 1.7;
}

/* Sections */
.section {
    background: var(--color-bg);
    padding: 20px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

.section h2 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 8px;
}

.section-intro {
    color: var(--color-text-secondary);
    font-size: 13px;
    margin: -8px 0 12px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.info-grid dt {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.info-grid dd {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.info-grid .full-width {
    grid-column: 1 / -1;
}

/* Reputation Grid */
.reputation-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.reputation-grid .stat {
    text-align: center;
}

.reputation-grid .value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.reputation-grid .label {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Tags */
.tag {
    display: inline-block;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 3px 3px 3px 0;
    color: var(--color-text);
}

.platforms, .markets {
    margin-top: 12px;
}

.platforms strong, .markets strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--color-text);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}

.product-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 15px;
}

.product-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--color-primary);
}

.product-card .price {
    display: inline-block;
    background: var(--color-success);
    color: var(--color-text-light);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.product-card p {
    margin: 8px 0 0;
    color: var(--color-text-secondary);
    font-size: 13px;
}

/* Competitive Section */
.usp {
    font-size: 14px;
    background: var(--color-bg-secondary);
    padding: 12px 15px;
    border-radius: var(--radius);
    border-left: 3px solid var(--color-primary);
    color: var(--color-text);
}

.advantages ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.advantages li {
    margin: 6px 0;
    font-size: 13px;
}

/* Related Threads Section */
.related-threads .threads-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thread-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.thread-item:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow);
}

.thread-item.thread-locked {
    border-left: 3px solid var(--color-success);
}

.thread-info {
    flex: 1;
    min-width: 0;
}

.thread-title {
    display: block;
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.thread-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 3px;
}

.lock-badge {
    color: var(--color-success);
    font-weight: bold;
}

.thread-voting {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.vote-btn {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.2s;
    color: var(--color-text-secondary);
}

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

.vote-btn.vote-up:hover,
.vote-btn.vote-up.voted {
    background: var(--color-success);
    color: var(--color-text-light);
    border-color: var(--color-success);
}

.vote-btn.vote-down:hover,
.vote-btn.vote-down.voted {
    background: var(--color-danger);
    color: var(--color-text-light);
    border-color: var(--color-danger);
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.net-votes {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--color-text);
}

.thread-actions {
    margin-top: 15px;
    text-align: center;
}

.empty-threads {
    text-align: center;
    color: var(--color-text-secondary);
}

/* Edit Suggestion Section */
.edit-suggestion {
    text-align: center;
    padding: 15px 20px;
}

.btn-suggest-edit,
.btn-suggest-thread {
    background: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-suggest-edit:hover,
.btn-suggest-thread:hover {
    background: var(--color-primary-dark);
}

.btn-suggest-edit:disabled,
.btn-suggest-thread:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.elite-note {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* Pending Edits Count */
.pending-edits-badge {
    display: inline-block;
    background: var(--color-warning);
    color: var(--color-primary);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Metadata/Footer */
.metadata {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-align: center;
    background: transparent;
    box-shadow: none;
    padding: 10px;
}

.rdl-footer {
    background: var(--color-primary);
    color: var(--color-text-light);
    padding: 20px 0;
    margin-top: 30px;
    text-align: center;
    font-size: 13px;
}

.rdl-footer a {
    color: var(--color-text-light);
}

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

/* Responsive */
@media (max-width: 768px) {
    .listing-header h1 {
        font-size: 22px;
    }

    .section {
        padding: 15px;
    }

    .reputation-grid {
        gap: 15px;
    }

    .thread-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .thread-voting {
        margin-left: 0;
    }
}

/* Category Index Page */
.category-header {
    background: var(--color-primary);
    color: var(--color-text-light);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.category-header h1 {
    margin: 0 0 8px;
    color: var(--color-text-light);
}

.category-header p {
    margin: 0;
    opacity: 0.9;
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.listing-card {
    background: var(--color-bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 3px solid transparent;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-left-color: var(--color-primary);
}

.listing-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.listing-card h3 a {
    color: var(--color-primary);
    text-decoration: none;
}

.listing-card h3 a:hover {
    text-decoration: underline;
}

.listing-card .pricing {
    color: var(--color-success);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}

.listing-card .description {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Directory Index */
.directory-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-text-light);
    margin-bottom: 25px;
    border-radius: var(--radius);
}

.directory-header h1 {
    margin: 0 0 10px;
    font-size: 32px;
    color: var(--color-text-light);
}

.directory-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 15px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}

.category-card {
    background: var(--color-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 3px solid var(--color-primary);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.category-card h2 {
    margin: 0 0 8px;
    color: var(--color-primary);
    font-size: 18px;
}

.category-card .count {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
}

.category-card .description {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* ========================================
 * Community Sentiment Section
 * ======================================== */

.rdl-sentiment-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.rdl-sentiment-section h2 {
    margin: 0 0 16px;
    font-size: 17px;
    color: #0a2d57;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rdl-sentiment-section h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #1a5b9e;
    border-radius: 2px;
}

/* Sentiment Meter */
.sentiment-overview {
    margin-bottom: 20px;
}

.sentiment-meter {
    background: linear-gradient(90deg, #f8d7da 0%, #f0f0f0 40%, #d4edda 100%);
    border-radius: 20px;
    height: 32px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.sentiment-meter-fill {
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 30%, #28a745 70%, #20c997 100%);
    height: 100%;
    border-radius: 20px;
    position: relative;
    transition: width 0.5s ease;
    min-width: 40px;
}

.sentiment-meter-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.sentiment-counts {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
}

.sentiment-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sentiment-count.positive { color: #28a745; }
.sentiment-count.neutral { color: #6c757d; }
.sentiment-count.negative { color: #dc3545; }

.sentiment-count::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sentiment-count.positive::before { background: #28a745; }
.sentiment-count.neutral::before { background: #6c757d; }
.sentiment-count.negative::before { background: #dc3545; }

/* Two-column layout */
.sentiment-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sentiment-col h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5e9;
}

.sentiment-positive h3 { border-bottom-color: #d4edda; color: #155724; }
.sentiment-negative h3 { border-bottom-color: #f8d7da; color: #721c24; }

/* Excerpt cards */
.sentiment-excerpt {
    margin-bottom: 12px;
    padding: 0;
}

.sentiment-excerpt blockquote {
    margin: 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    border-left: 3px solid #e1e5e9;
}

.sentiment-positive .sentiment-excerpt blockquote {
    border-left-color: #28a745;
    background: #f6fdf7;
}

.sentiment-negative .sentiment-excerpt blockquote {
    border-left-color: #dc3545;
    background: #fef6f6;
}

.excerpt-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 4px;
    font-size: 12px;
}

.excerpt-author {
    color: #1a5b9e;
    text-decoration: none;
    font-weight: 500;
}

.excerpt-author:hover {
    text-decoration: underline;
}

.excerpt-thanks {
    color: #888;
    font-size: 11px;
}

.sentiment-disclaimer {
    margin: 16px 0 0;
    font-size: 11px;
    color: #999;
    text-align: center;
    line-height: 1.5;
}

.sentiment-disclaimer a {
    color: #1a5b9e;
    text-decoration: none;
}

.sentiment-disclaimer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .sentiment-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .rdl-sentiment-section {
        padding: 16px;
    }
    .sentiment-counts {
        flex-direction: column;
        gap: 4px;
    }
}
