/**
 * Agenda Item Detail Page Styles
 */

/* Font Awesome 6 Fix */
.fa-solid::before,
.fas::before,
.fa::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Map Font Awesome 5 classes to Font Awesome 6 */
.fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Specific icon content mappings */
.fa-lock-open::before { content: "\f3c1" !important; }
.fa-crown::before { content: "\f521" !important; }
.fa-folder-plus::before { content: "\f65e" !important; }
.fa-folder-minus::before { content: "\f65d" !important; }
.fa-check::before { content: "\f00c" !important; }
.fa-info-circle::before { content: "\f05a" !important; }
.fa-calendar::before { content: "\f133" !important; }
.fa-calendar-alt::before { content: "\f073" !important; }
.fa-bug::before { content: "\f188" !important; }
.fa-external-link-alt::before { content: "\f35d" !important; }
.fa-money-check-alt::before { content: "\f53d" !important; }
.fa-twitter::before { content: "\f099" !important; }
.fa-facebook::before { content: "\f09a" !important; }
.fa-envelope::before { content: "\f0e0" !important; }
.fa-link::before { content: "\f0c1" !important; }
.fa-bell::before { content: "\f0f3" !important; }
.fa-video::before { content: "\f03d" !important; }
.fa-filter::before { content: "\f0b0" !important; }
.fa-times::before { content: "\f00d" !important; }
.fa-user-plus::before { content: "\f234" !important; }
.fa-arrow-circle-up::before { content: "\f0aa" !important; }
.fa-arrow-left::before { content: "\f060" !important; }

/* Ensure all FA icons are visible */
[class^="fa-"]:before,
[class*=" fa-"]:before {
    display: inline-block !important;
}

/* Style for the full title details element */
details summary {
    outline: none;
    user-select: none;
    transition: color 0.2s;
    cursor: pointer;
}

details summary:hover {
    color: #0d6efd !important;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
    font-size: 0.75rem;
}

details[open] summary::before {
    transform: rotate(90deg);
}

details .bg-light {
    border-left: 3px solid #0d6efd;
}

/* Video Paywall Overlay */
.video-paywall-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.video-paywall-content {
    text-align: center;
    padding: 2rem;
}

/* Content Preview Styles */
.content-preview {
    position: relative;
    max-height: 600px;
    overflow: hidden;
}

.paywall-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent 0%, white 100%);
    pointer-events: none;
}

.paywall-blur-light {
    filter: blur(1px);
    opacity: 0.8;
}

.paywall-blur-medium {
    filter: blur(2px);
    opacity: 0.6;
}

/* Paywall CTA Overlay */
.paywall-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, white 60%, transparent 100%);
    padding: 3rem 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.paywall-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    text-align: center;
}

/* Sponsors Section - Updated for card layout */
.sponsors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}

/* NovusAgenda Content Styles */
.agenda-detail-content {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    width: 100% !important;
}

.agenda-detail-content * {
    font-family: 'Recoleta', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.agenda-detail-content table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.agenda-detail-content {
    overflow-x: auto !important;
}

.agenda-detail-content td,
.agenda-detail-content th {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    padding: 8px !important;
}

/* Desktop-only table column widths - better sizing for memorandum headers */
@media (min-width: 769px) {
    .agenda-detail-content table:first-of-type td:first-child,
    .agenda-detail-content table:nth-of-type(2) td:first-child {
        min-width: 80px;
        width: auto;
        padding-right: 1rem;
        white-space: nowrap;
    }
    
    /* Ensure the content column gets the remaining space */
    .agenda-detail-content table:first-of-type td:last-child,
    .agenda-detail-content table:nth-of-type(2) td:last-child {
        width: 100%;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .agenda-detail-content h1,
    .agenda-detail-content h2,
    .agenda-detail-content h3,
    .agenda-detail-content h4,
    .agenda-detail-content h5,
    .agenda-detail-content h6 {
        font-weight: bold !important;
        margin-top: 1em !important;
        margin-bottom: 0.5em !important;
    }
    
    .agenda-detail-content strong,
    .agenda-detail-content b {
        font-weight: bold !important;
    }
    
    .agenda-detail-content em,
    .agenda-detail-content i {
        font-style: italic !important;
    }
    
    .agenda-detail-content u {
        text-decoration: underline !important;
    }
    
    .agenda-detail-content ul,
    .agenda-detail-content ol {
        margin-left: 20px !important;
        margin-bottom: 1em !important;
    }
    
    .agenda-detail-content li {
        margin-bottom: 0.5em !important;
    }
    
    .agenda-detail-content div[style*="display: flex"] {
        flex-direction: column !important;
    }
    
    .agenda-detail-content div[style*="width: 48%"] {
        width: 100% !important;
    }
    
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .agenda-item-detail {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .agenda-detail-content {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        font-size: 14px !important;
    }
    
    .agenda-detail-content * {
        max-width: 100% !important;
        width: auto !important;
        min-width: unset !important;
    }
    
    .agenda-detail-content table {
        width: 100% !important;
        table-layout: auto !important;
        border-collapse: collapse !important;
    }
    
    .agenda-detail-content td,
    .agenda-detail-content th {
        width: auto !important;
        min-width: unset !important;
        max-width: 100% !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }
}

/* Safari Mobile Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .agenda-detail-content table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .agenda-detail-content .converted-table,
    .agenda-detail-content .memo-header {
        width: 100% !important;
        display: block !important;
    }
    
    .agenda-detail-content .converted-table p,
    .agenda-detail-content .memo-header p {
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
    }
}

/* NovusAgenda Content Sections */
.novus-agenda-content .section {
    margin-bottom: 2rem;
}

.novus-agenda-content .section p {
    line-height: 1.7;
    color: #4a5568;
    margin-bottom: 1rem;
}

.novus-agenda-content .section p:last-child {
    margin-bottom: 0;
}

.novus-agenda-content .section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.novus-agenda-content .section ul li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #4a5568;
}

.novus-agenda-content .attachments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.novus-agenda-content .attachments-section ul {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
}

.novus-agenda-content .attachments-section li {
    margin-bottom: 0.5rem;
}

.novus-agenda-content .attachments-section a {
    color: #0d6efd;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.novus-agenda-content .attachments-section a:hover {
    text-decoration: underline;
}

.novus-agenda-content .attachments-section a::before {
    content: '📎';
    margin-right: 0.5rem;
}

/* PRO Features Modal Styles */
.pro-modal-content {
    border-radius: 20px;
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.pro-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.pro-feature-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.pro-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

#back-to-top:hover {
    background: #0a58ca;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#back-to-top.show {
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Voting Result and Sponsor Cards - Equal sizing */
#voting-result.card,
.card:has(.sponsors-grid) {
    min-height: 250px;
}

/* Ensure proper grid spacing on smaller sponsors display */
@media (min-width: 992px) {
    .row > .col-lg-6 .card {
        height: 100%;
    }
}

/* Detail page card styling - separate from agenda page cards */
.detail-card {
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: .25rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    word-wrap: break-word;
    width: 100% !important;
    max-width: 100% !important;
}

.detail-card .card-header {
    background-color: rgba(0,0,0,.03);
    border-bottom: 1px solid rgba(0,0,0,.125);
    margin-bottom: 0;
    padding: .75rem 1.25rem;
}

.detail-card .card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Vertically center sponsors card content specifically */
.detail-card:has(.sponsors-grid) .card-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure sponsors grid stays centered */
.detail-card .sponsors-grid {
    width: 100%;
}

/* Specific styling for voting result card */
.detail-card#voting-result {
    border-color: #0d6efd;
}

.detail-card#voting-result .card-header {
    background-color: #0d6efd;
    color: white;
    border-bottom: 1px solid #0d6efd;
}
