/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #000000;
    background: #ffffff;
    min-height: 100vh;
    font-size: 16px;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* App Layout - Full screen, edge to edge */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    position: relative;
}

/* Header Bar - Full Width */
.header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px; /* Match timeline header height */
    background: #000000;
    color: #ffffff;
    border-bottom: 1px solid #cccccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 10;
    box-sizing: border-box;
}

.header-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

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

.feed-toggle-btn {
    background: #ffffff;
    color: #000000;
    border: 1px solid #cccccc;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.1s ease, color 0.1s ease;
}

.feed-toggle-btn:hover {
    background: #f0f0f0;
}

.header-stats {
    display: none;
}

.stat-item {
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Account Info Styles */
.account-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #666666;
    text-transform: uppercase;
    font-weight: 500;
}

.info-value {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #000000;
    font-weight: 500;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-form label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #666666;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.account-input-row {
    display: flex;
    gap: 12px;
}

.account-input-row input {
    flex: 1;
    border: 1px solid #cccccc;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
}

.account-input-row input:focus {
    border-color: #000000;
}

.account-input-row button {
    min-width: 120px;
}

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

.profile-name {
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
}

.profile-name:hover {
    text-decoration: underline;
}

.login-btn {
    padding: 6px 12px;
    border: 1px solid #ffffff;
    background: #ffffff;
    color: #000000;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.1s ease, color 0.1s ease;
    letter-spacing: 0.5px;
}

.login-btn:hover {
    background: #cccccc;
}

/* Global Feed Sidebar */
.global-feed-sidebar {
    width: 320px;
    background: #f8f9fa;
    border-right: 1px solid #cccccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    margin-top: 56px;
    height: calc(100vh - 56px);
    order: 3;
}

.feed-header {
    padding: 16px 20px;
    border-bottom: 1px solid #cccccc;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-header h3 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
}

.global-feed-list {
    flex: 1;
    overflow-y: auto;
}

.feed-item {
    border-bottom: 1px solid #cccccc;
    padding: 16px 20px;
    background: #ffffff;
}

.feed-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-insight {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
    color: #000000;
}

.feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666666;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 8px;
}

.feed-author {
    font-weight: 600;
    color: #000000;
}

.feed-meta div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feed-timestamp {
    font-size: 11px;
    color: #999999;
}

.feed-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666666;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.follow-btn {
    background: none;
    border: 1px solid #000000;
    color: #000000;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 4px 10px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.1s ease;
}

.follow-btn.following {
    background: #000000;
    color: #ffffff;
}

.follow-btn:hover {
    background: #000000;
    color: #ffffff;
}

/* Timeline Sidebar - Clean, minimal */
.timeline-sidebar {
    width: 350px;
    background: #ffffff;
    border-right: 1px solid #cccccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    margin-top: 56px;
    height: calc(100vh - 56px);
    order: 2;
}

.timeline-header {
    padding: 16px 20px;
    border-bottom: 1px solid #cccccc;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid #cccccc;
    background: #f5f5f5;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    gap: 12px;
}

.timeline-filter .filter-text {
    color: #333333;
}

.timeline-filter #filter-tag-label {
    color: #000000;
}

.clear-filter-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #666666;
    padding: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-filter-btn:hover {
    color: #000000;
}

.timeline-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #cccccc;
    background: #f6f6f6;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-filter strong {
    font-size: 12px;
}

.filter-clear-btn {
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    color: #666666;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.filter-clear-btn:hover {
    color: #000000;
}

.timeline-header h2 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
}

.header-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #666666;
    letter-spacing: 1px;
}

.icon-btn {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    transition: background-color 0.1s ease, color 0.1s ease;
}

.icon-btn:hover {
    background: #f0f0f0;
}

/* Main Content - Clean, brutalist */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #ffffff;
    margin-top: 56px;
    height: calc(100vh - 56px);
    padding: 0;
    position: relative;
    border-right: 1px solid #cccccc;
    order: 1;
}

.split-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #cccccc;
}

.input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.input-header {
    padding: 16px 20px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    background: #ffffff;
}

textarea {
    flex: 1;
    width: 100%;
    padding: 20px;
    border: none;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
}

.compress-full {
    margin: 0;
    margin-top: 8px;
    width: 100%;
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-top: 1px solid #cccccc;
}

.compress-full::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-100%);
}

.compress-full.loading::after {
    animation: sweep 0.8s ease-in-out forwards;
}

@keyframes sweep {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(200%);
    }
}

.compress-full:hover {
    background: #111111;
}

.output-section-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f6f6f6;
}

.output-header {
    padding: 16px 20px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f6f6f6;
    min-height: 56px;
}

.output-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    padding: 40px;
    background: #f6f6f6;
    border: none;
}

.output-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #cccccc;
}

.output-actions button {
    background: #ffffff;
    border: none;
    border-right: 1px solid #cccccc;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.output-actions button:last-child {
    border-right: none;
}

.output-actions button:hover {
    background: #f2f2f2;
}

.output-actions #save-btn {
    background: #000000;
    color: #ffffff;
}

.output-actions #save-btn:hover {
    background: #111111;
}

.input-header h2, .output-header h2 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
}

.input-stats {
    display: flex;
    gap: 16px;
    font-size: 10px;
    color: #666666;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-link-btn {
    background: none;
    border: none;
    color: #666666;
    padding: 0;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.text-link-btn:hover {
    color: #000000;
}

/* Timeline Sidebar - Brutalist, clean */
.timeline-sidebar {
    width: 380px;
    background: #ffffff;
    border-right: 1px solid #cccccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.timeline-header {
    padding: 16px 20px;
    border-bottom: 1px solid #cccccc;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-header h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 1px;
}

.icon-btn {
    background: #ffffff;
    color: #000000;
    border: 1px solid #cccccc;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.1s ease;
}

.icon-btn:hover {
    background: #000000;
    color: #ffffff;
    box-shadow: 3px 3px 0px 0px #000000;
}

.timeline-list {
    flex: 1;
    padding: 1rem;
}



.timeline-date {
    font-size: 0.7rem;
    opacity: 0.6;
    font-family: 'JetBrains Mono', monospace;
}

.timeline-author {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.compressed-text {
    font-size: 1.6rem;
    line-height: 1.4;
    color: #333333;
    font-weight: 700;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    width: 100%;
    transition: font-size 0.2s ease;
    opacity: 0.5;
}

/* Responsive design */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .timeline-sidebar {
        width: 100%;
        height: 30vh;
        border-right: none;
        border-bottom: 1px solid #cccccc;
    }

    .main-content {
        height: 70vh;
        padding: 0;
    }
    
    .compressed-text {
        font-size: 1.4rem;
    }
}

/* Timeline Styles */
.timeline-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.timeline-item {
    border-bottom: 1px solid #cccccc;
    padding: 16px 24px;
}

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

.timeline-item.deleting {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-insight {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
    color: #000000;
}

.privacy-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    transition: opacity 0.2s ease;
}

.privacy-indicator:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.privacy-indicator.private {
    color: #dc2626;
}

.privacy-indicator.public {
    color: #059669;
}

.compression-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background: #000000;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.tag:hover {
    background: #333333;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666666;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 8px;
}

.delete-btn {
    background: none;
    border: none;
    color: #cccccc;
    padding: 0 4px;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-left: 8px;
}

.delete-btn:hover {
    color: #dc2626;
}

.timeline-meta-left {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.timeline-date {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expand-btn {
    background: none;
    border: none;
    color: #666666;
    padding: 0;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.1s ease;
    letter-spacing: 0.5px;
    text-decoration: underline;
}

.expand-btn:hover {
    color: #000000;
}

.original-text {
    margin-top: 16px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #cccccc;
}

.original-header h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    color: #000000;
    letter-spacing: 1px;
}

.original-content pre {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333333;
}

.timeline-empty {
    padding: 40px 24px;
    text-align: center;
    color: #666666;
}

.timeline-empty p {
    margin: 8px 0;
    font-size: 14px;
}

/* Popover Styles */
.popover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popover-content {
    background: #ffffff;
    border: 1px solid #000000;
    max-width: 400px;
    width: 90%;
    border-radius: 4px;
    overflow: hidden;
}

.popover-header {
    padding: 16px 20px;
    border-bottom: 1px solid #cccccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
}

.popover-header h3 {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #000000;
}

.popover-body {
    padding: 20px;
}

.popover-body p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #333333;
}

.tag-input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #000000;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    outline: none;
}

.tag-input-field:focus {
    background: #f9f9f9;
}

.privacy-option {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-container input {
    opacity: 0;
    position: absolute;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: #ffffff;
    border: 1px solid #000000;
    display: inline-block;
    margin-right: 8px;
    position: relative;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #f0f0f0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #000000;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.label-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #000000;
}

.popover-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.popover-actions .secondary-btn,
.popover-actions .primary-btn {
    min-width: 100px;
    padding: 12px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease;
}

.primary-btn {
    background: #000000;
    color: #ffffff;
}

.primary-btn:hover {
    background: #333333;
}

.primary-btn:disabled {
    background: #666666;
    cursor: not-allowed;
}

.secondary-btn {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000 !important;
}

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