* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #15202b;
    color: #ffffff;
    line-height: 1.6;
}

.info-box {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background-color: #192734;
    border: 1px solid #38444d;
    border-radius: 16px;
    padding: 1rem;
    width: 250px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.info-box-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #38444d;
}

.info-box-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: #ffffff;
}

.info-box-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.owner-name {
    font-size: 0.9rem;
    color: #8899a6;
    margin: 0;
}

.owner-name strong {
    color: #ffffff;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #8899a6;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 0.9rem;
}

.social-link:hover {
    background-color: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}

.social-link svg {
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .info-box {
        display: none;
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
}

.header {
    position: sticky;
    top: 0;
    background-color: rgba(21, 32, 43, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #38444d;
    padding: 1rem;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background-color: #253341;
    border: 1px solid #38444d;
    border-radius: 25px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    background-color: #15202b;
    border-color: #1d9bf0;
}

.search-input::placeholder {
    color: #8899a6;
}

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #1d9bf0;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.clear-btn:hover {
    background-color: rgba(29, 155, 240, 0.1);
}

.timeline {
    padding-bottom: 2rem;
}

.return-to-timeline {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #38444d;
}

.return-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #1d9bf0;
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.return-button:hover {
    background-color: #1a8cd8;
}

.post {
    border-bottom: 1px solid #38444d;
    padding: 1rem;
    transition: background-color 0.2s;
    scroll-margin-top: 120px;
}

.post:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

a.origlink {
    font-size: smaller;
}

a.avatar {
    color: #aaaaaa;
    text-decoration: none;
}

img.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid #38444d;
}

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

.post-author {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.author-name {
    font-weight: bold;
    color: #ffffff;
}

.author-handle {
    color: #8899a6;
    font-size: 0.9rem;
}

.post-date-separator {
    color: #8899a6;
    font-size: 0.9rem;
}

.post-date {
    color: #8899a6;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: text-decoration 0.2s;
}

.post-date:hover {
    text-decoration: underline;
}

.retweet-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8899a6;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}

.retweet-icon {
    color: #00ba7c;
}

.reply-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #8899a6;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    padding-left: 3.25rem;
}

.reply-link {
    color: #1d9bf0;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.reply-link:hover {
    text-decoration: underline;
    color: #1a8cd8;
}

.post-content {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.link-preview {
    margin-top: 0.75rem;
    overflow: hidden;
    transition: background-color 0.2s;
    cursor: pointer;
}

.link-preview:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.link-preview-image {
    width: 100%;
    object-fit: cover;
    display: block;
    background-color: #253341;
}

.link-preview-content {
    padding: 0.75rem;
}

.link-preview-domain {
    color: #8899a6;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    text-transform: lowercase;
}

.link-preview-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.link-preview-description {
    color: #8899a6;
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-author a {
    color: #aaaaaa;
    text-decoration: none;
}

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

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

.post-media {
    margin-top: 0.75rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #38444d;
}

.post-media img {
    width: 100%;
    height: auto;
    display: block;
}

.post-media video {
    width: 100%;
    height: auto;
    display: block;
}

.video-container {
    position: relative;
    cursor: pointer;
    width: 100%;
}

.video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.2s;
}

.video-container:hover .video-play-button {
    opacity: 0.8;
}

.video-player {
    width: 100%;
    height: auto;
    display: block;
}

.media-grid {
    display: grid;
    gap: 2px;
}

.media-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.media-grid.grid-3 {
    grid-template-columns: repeat(2, 1fr);
}

.media-grid.grid-3 img:first-child {
    grid-column: 1 / -1;
}

.media-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

.media-grid img {
    width: 100%;
    object-fit: cover;
}

.post-actions {
    display: flex;
    gap: 3rem;
    margin-top: 0.75rem;
    color: #8899a6;
    font-size: 0.9rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn:hover {
    color: #1d9bf0;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #8899a6;
}

.loading[style*="display: none"] {
    display: none !important;
}

.spinner {
    border: 3px solid #38444d;
    border-top: 3px solid #1d9bf0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #8899a6;
}

.highlight {
    background-color: #ffd700;
    color: #15202b;
    padding: 0 2px;
    border-radius: 2px;
}

@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }
    
    .header {
        padding: 0.75rem;
    }
    
    .post {
        padding: 0.75rem;
    }
}
