/* ===================================
   DIRECTGOV - PROPOSAL STYLES
   Proposal cards, views, votes, comments
   =================================== */

/* Proposal Container */
.proposal-container {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.proposal-container .proposal-header {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.proposal-container .proposal-meta {
    color: #888;
    font-size: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Proposal Cards */
.proposal-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e1e8ed;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.proposal-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.proposal-card.own-proposal {
    border-left: 4px solid #1e3c72;
}

.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.proposal-header h1 {
    color: #1e3c72;
    font-size: 36px;
    margin-bottom: 15px;
    line-height: 1.2;
}

.proposal-title {
    color: #1e3c72;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-decoration: none;
    display: inline-block;
}

.proposal-title:hover {
    color: #2a5298;
    text-decoration: underline;
}

.proposal-meta {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
}

.proposal-description {
    color: #444;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.proposal-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    white-space: nowrap;
}

.stat-item.upvotes {
    color: #28a745;
}

.stat-item.downvotes {
    color: #dc3545;
}

.stat-item.comments {
    color: #17a2b8;
}

/* Voted state - highlight when user has voted */
.stat-item.voted {
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.stat-item.upvotes.voted {
    background: #d4edda;
    color: #28a745;
}

.stat-item.downvotes.voted {
    background: #f8d7da;
    color: #dc3545;
}

/* Badges */
.fiscal-impact,
.fiscal-impact-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.fiscal-impact-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 15px;
    margin-top: 15px;
}

.fiscal-impact.positive,
.fiscal-impact-badge.positive {
    background: #f8d7da;
    color: #dc3545;
}

.fiscal-impact.negative,
.fiscal-impact-badge.negative {
    background: #d4edda;
    color: #28a745;
}

.fiscal-impact.neutral,
.fiscal-impact-badge.neutral {
    background: #fff3cd;
    color: #856404;
}

.gini-impact,
.gini-impact-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
}

.gini-impact-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 15px;
    margin-top: 15px;
    margin-left: 10px;
}

.gini-impact.improves,
.gini-impact-badge.improves {
    background: #d4edda;
    color: #28a745;
}

.gini-impact.worsens,
.gini-impact-badge.worsens {
    background: #f8d7da;
    color: #dc3545;
}

.gini-impact.unchanged,
.gini-impact-badge.unchanged {
    background: #fff3cd;
    color: #856404;
}

.own-badge {
    background: #1e3c72;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.own-badge-analyzing {
    background: #ffc107;
    color: #856404;
}

.own-badge-ready {
    background: #28a745;
    color: white;
}

.notification-badge {
    background: #007bff;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    margin-left: 6px;
    display: inline-block;
    min-width: 22px;
    text-align: center;
}

/* Proposal Actions */
.proposal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Status Banners & Badges */
.status-banner {
    padding: 20px;
    border-radius: 10px;
    margin-top: 40px;
    margin-bottom: 30px;
    font-size: 16px;
}

.status-banner.status-analyzing {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.status-banner.status-ready {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.status-badge-container {
    margin-bottom: 12px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.status-analyzing {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.status-badge.status-ready {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.error-banner {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Sections */
.section {
    margin-bottom: 20px;
}

.section h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-content {
    color: #555;
    font-size: 16px;
    line-height: 1.8;
}

.votable-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-top: 15px;
}

/* Markdown rendering in section content */
.section-content ul,
.section-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.section-content li {
    margin: 5px 0;
    line-height: 1.6;
}

.section-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.section-content table th,
.section-content table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #dee2e6;
}

.section-content table th {
    background: #e9ecef;
    font-weight: 600;
}

.section-content table tr:nth-child(even) {
    background: #f8f9fa;
}

.section-content h1,
.section-content h2,
.section-content h3,
.section-content h4,
.section-content h5,
.section-content h6 {
    margin: 15px 0 10px 0;
    color: #333;
}

.section-content p {
    margin: 10px 0;
}

.section-content strong {
    font-weight: 600;
}

.section-content code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Outline Items */
.outline-item {
    margin-bottom: 4px;
    padding-left: 20px;
    position: relative;
}

.outline-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1e3c72;
    font-weight: bold;
}

.outline-item.sub-item {
    margin-left: 20px;
}

.outline-item.sub-item::before {
    content: "◦";
    color: #6c757d;
}

.item-content {
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

.empty-outline {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    color: #888;
}

/* Voting */
.vote-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e1e8ed;
}

.vote-bar.inline {
    padding: 0;
    border: none;
    gap: 8px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.vote-btn.compact {
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 15px;
}

.vote-btn:hover {
    border-color: #1e3c72;
}

.vote-btn.upvote.active {
    background: #d4edda;
    border-color: #28a745;
    color: #28a745;
}

.vote-btn.downvote.active {
    background: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

.vote-btn.upvote:hover {
    background: #d4edda;
    border-color: #28a745;
}

.vote-btn.downvote:hover {
    background: #f8d7da;
    border-color: #dc3545;
}

/* Comments */
.comment-toggle {
    color: #666;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-toggle:hover {
    color: #1e3c72;
}

.comment-toggle.compact {
    font-size: 13px;
    margin-left: 0;
}

.comments-section {
    padding: 15px 0;
    display: none;
}

.comments-section.show {
    display: block;
}

.comment {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e1e8ed;
    position: relative;
    transition: background-color 0.3s, border-color 0.3s;
    scroll-margin-top: 20px;
}

.comment:target {
    background: #fffbea;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comment.nested {
    margin-left: 0;
    margin-top: 10px;
    padding-left: 20px;
    border-left: 2px solid #dee2e6;
    border-radius: 0;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.comment.highlighted {
    background-color: #fff3cd;
    border-color: #ffc107;
    animation: highlight-fade 2s ease-in-out;
}

@keyframes highlight-fade {
    0% {
        background-color: #fff3cd;
        border-color: #ffc107;
    }
    100% {
        background-color: white;
        border-color: #e1e8ed;
    }
}

.comment.deleted {
    opacity: 0.6;
    background: #f8f9fa;
}

.comment.deleted .comment-content {
    font-style: italic;
    color: #999;
}

.comment.reply-to-deleted {
    opacity: 0.7;
}

.comment.reply-to-deleted .comment-content {
    color: #666;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.comment-author {
    font-weight: 600;
    color: #1e3c72;
}

.comment-date {
    color: #888;
}

.comment-content {
    color: #333;
    line-height: 1.5;
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    background: #f0f4f8;
    color: #1e3c72;
}

.comment-action-btn.delete {
    color: #dc3545;
}

.comment-action-btn.delete:hover {
    background: #f8d7da;
    color: #721c24;
}

.comment-form,
.comment-reply-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.comment-reply-form {
    display: none;
    margin-top: 10px;
}

.comment-reply-form.show {
    display: flex;
}

.comment-form textarea {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.comment-replies {
    margin-top: 10px;
}

.comment-replies.collapsed {
    display: none;
}

.collapse-toggle {
    color: #666;
    font-size: 13px;
    cursor: pointer;
}

.collapse-toggle:hover {
    color: #1e3c72;
}

.no-comments {
    color: #888;
    font-size: 14px;
    padding: 10px 0;
}

/* Bill Text */
.bill-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    border: 1px solid #e1e8ed;
    max-height: 600px;
    overflow-y: auto;
}

/* Memes */
.meme-card {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meme-headline {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #1e3c72;
}

.meme-subtext {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.meme-delete-btn:hover {
    background: #c82333 !important;
    transform: scale(1.02);
    transition: all 0.2s;
}

.meme-card.selectable {
    cursor: pointer;
    transition: all 0.3s;
}

.meme-card.selectable:hover {
    border-color: #1e3c72;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.2);
}

.meme-card.selected {
    border-color: #1e3c72;
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.meme-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meme-card-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

/* Share Buttons */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.share-btn svg {
    flex-shrink: 0;
}

.share-btn.share-twitter:hover {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.share-btn.share-bluesky:hover {
    background: #0085ff;
    color: white;
    border-color: #0085ff;
}

.share-btn.share-facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.share-btn.share-copy:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.share-btn.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

/* Share Modal */
.share-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.share-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.share-modal-header {
    padding: 30px;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-header h2 {
    color: #1e3c72;
    font-size: 28px;
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.share-modal-close:hover {
    background: #f0f4f8;
    color: #1e3c72;
}

.share-modal-body {
    padding: 30px;
}

.share-modal-memes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.share-platforms {
    display: none;
    padding-top: 20px;
    border-top: 2px solid #e1e8ed;
}

.share-platforms.show {
    display: block;
}

.share-platforms h3 {
    color: #1e3c72;
    font-size: 20px;
    margin-bottom: 15px;
}

.share-platforms-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .proposal-stats {
        gap: 12px;
    }

    .fiscal-impact,
    .gini-impact {
        flex-basis: 100%;
    }

    .proposal-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        min-height: 44px;
        padding: 12px 20px;
    }
}
