/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.4;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Left Sidebar */
.sidebar {
    background-color: #000000;
    border-right: 1px solid #2f3336;
    padding: 20px;
    width: 280px;
    min-width: 280px;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header h1 {
    color: #1d9bf0;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sidebar-header h1 i {
    margin-right: 10px;
}

.sidebar-header p {
    color: #71767b;
    font-size: 14px;
    margin-bottom: 30px;
}

.sidebar-nav {
    margin-bottom: 40px;
}

.nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    text-align: left;
}

.nav-btn:hover {
    background-color: #1a1a1a;
}

.nav-btn.active {
    background-color: #1d9bf0;
    font-weight: 600;
}

.nav-btn i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.study-info {
    background-color: #16181c;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #2f3336;
}

.study-info h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.info-item {
    margin-bottom: 8px;
    font-size: 14px;
    color: #71767b;
}

.info-item strong {
    color: #ffffff;
}

/* Main Content */
.main-content {
    flex: 1;
    min-height: 100vh;
    width: 100%;
}

.main-header {
    position: sticky;
    top: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #2f3336;
    padding: 16px 24px;
    z-index: 1000;
}

.main-header h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #71767b;
}

#searchInput {
    width: 100%;
    padding: 8px 8px 8px 40px;
    background-color: #16181c;
    border: 1px solid #2f3336;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
}

#searchInput:focus {
    outline: none;
    border-color: #1d9bf0;
}

#sortSelect {
    padding: 8px 12px;
    background-color: #16181c;
    border: 1px solid #2f3336;
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
}

/* Timeline */
.timeline-container {
    padding: 0;
    width: 100%;
}

.timeline {
    display: flex;
    flex-direction: column;
}

.tweet-card {
    background-color: #000000;
    border-bottom: 1px solid #2f3336;
    padding: 16px 24px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.tweet-card:hover {
    background-color: #020202;
}

.tweet-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid #2f3336;
}

.tweet-author {
    flex: 1;
    min-width: 0;
}

.author-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.author-handle {
    color: #71767b;
    font-size: 14px;
    margin-bottom: 4px;
}

.author-bio {
    display: none;
}

.tweet-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #71767b;
    font-size: 14px;
    margin-left: auto;
    flex-shrink: 0;
}

.persona-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-antiimperialist { background-color: #1a4d3a; color: #4ade80; }
.badge-nativistconservative { background-color: #4a1a1a; color: #ef4444; }
.badge-apoliticalobserver { background-color: #1a3a4d; color: #3b82f6; }
.badge-loyalist { background-color: #4d1a4d; color: #a855f7; }
.badge-humanitarian { background-color: #4d2a1a; color: #f97316; }
.badge-justiceseeker { background-color: #4d4a1a; color: #eab308; }
.badge-orderkeeper { background-color: #2a1a4d; color: #8b5cf6; }
.badge-rationalobserver { background-color: #1a4d4d; color: #06b6d4; }

.phase-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    background-color: #1a1a1a;
    color: #71767b;
    margin-left: 8px;
}

.tweet-time {
    color: #71767b;
    cursor: help;
    transition: color 0.2s ease;
}

.tweet-time:hover {
    color: #1d9bf0;
}

.tweet-content {
    margin-left: 0px;
    margin-bottom: 12px;
    margin-top: 8px;
}

.selection-rationale {
    color: #71767b;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 8px;
}

.commentary {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.tweet-timestamp {
    color: #71767b;
    font-size: 13px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #2f3336;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tweet-timestamp i {
    opacity: 0.7;
}

.tweet-actions {
    display: none !important;
}

.action-btn {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #71767b;
    font-size: 16px;
}

.loading i {
    font-size: 24px;
    margin-bottom: 12px;
}

/* Right Sidebar */
.right-sidebar {
    background-color: #000000;
    padding: 20px;
    width: 300px;
    min-width: 300px;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.trending-section, .stats-section {
    background-color: #16181c;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #2f3336;
}

.trending-section h3, .stats-section h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2f3336;
}

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

.hashtag {
    color: #1d9bf0;
    font-weight: 500;
    font-size: 14px;
}

.count {
    color: #71767b;
    font-size: 13px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.stat-label {
    color: #71767b;
}

.stat-value {
    color: #ffffff;
    font-weight: 500;
}

/* Analysis Reports */
.report-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #2f3336;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.report-item:hover {
    color: #1d9bf0;
}

.report-item i {
    opacity: 0.7;
    font-size: 14px;
}

.report-link {
    color: #71767b;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #2f3336;
    transition: color 0.2s ease;
}

.report-link:hover {
    color: #1d9bf0;
}

.report-link:last-child {
    border-bottom: none;
}

.report-meta {
    font-size: 12px;
    color: #71767b;
    margin-left: 22px;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #000000;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #2f3336;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #71767b;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #ffffff;
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 260px;
        min-width: 260px;
    }
    
    .right-sidebar {
        width: 280px;
        min-width: 280px;
    }
}

@media (max-width: 1000px) {
    .sidebar, .right-sidebar {
        display: none;
    }
    
    .main-content {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .main-header {
        padding: 16px 16px;
    }
    
    .tweet-card {
        padding: 12px 16px;
    }
    
    .tweet-content {
        margin-left: 0;
    }
    
    .tweet-actions {
        margin-left: 0;
    }
    
    .tweet-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #2f3336;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #71767b;
}

/* Day Navigation Styles */
.day-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding: 10px;
    background-color: #16181c;
    border-radius: 8px;
    border: 1px solid #2f3336;
}

.nav-day-btn {
    background-color: #1d9bf0;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-day-btn:hover:not(:disabled) {
    background-color: #1a8cd8;
    transform: translateY(-1px);
}

.nav-day-btn:disabled {
    background-color: #2f3336;
    color: #71767b;
    cursor: not-allowed;
    transform: none;
}

#currentDayDisplay {
    font-weight: 600;
    color: #1d9bf0;
    font-size: 14px;
}

/* Retweet Card Styles */
.retweet-card {
    margin: 12px 0;
    border: 1px solid #2f3336;
    border-radius: 12px;
    background-color: #16181c;
}

.retweet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #71767b;
    font-size: 14px;
    border-bottom: 1px solid #2f3336;
}

.retweet-header i {
    color: #1d9bf0;
}

.original-tweet {
    padding: 12px;
}

.original-tweet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.original-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.original-author strong {
    color: #ffffff;
}

.tweet-date {
    color: #71767b;
    font-size: 14px;
}

.engagement-stats {
    color: #71767b;
    font-size: 14px;
}

.retweet-count {
    font-weight: 500;
}

.original-tweet-content {
    color: #ffffff;
    line-height: 1.5;
    margin-top: 8px;
}

/* Agent Commentary Styles */
.agent-commentary {
    margin-top: 16px;
    padding: 16px;
    background-color: #0a0e12;
    border-radius: 12px;
    border: 1px solid #2f3336;
}

.commentary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #1d9bf0;
    font-weight: 600;
    font-size: 14px;
}

.commentary-content {
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.selection-rationale {
    color: #71767b;
    font-size: 14px;
    font-style: italic;
    border-top: 1px solid #2f3336;
    padding-top: 12px;
}

/* Hashtag Styling */
.hashtag {
    color: #1d9bf0;
    font-weight: 500;
}

.original-tweet-content a {
    color: #1d9bf0;
    text-decoration: none;
}

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