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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #14171a;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0 30px;
    border-bottom: 1px solid #e1e8ed;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #14171a;
    margin-bottom: 4px;
}

.header-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.rss-link {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #657786;
    background: none;
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rss-link:hover {
    color: #ff6600;
    border-color: #ff6600;
    background-color: rgba(255, 102, 0, 0.05);
}

.xmr-qr {
    text-align: center;
    margin-top: 16px;
}

.xmr-qr img {
    max-width: 160px;
    border-radius: 8px;
}

/* RSS Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #14171a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #657786;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #14171a;
}

.modal-body {
    padding: 20px;
}

.modal-body > p {
    font-size: 0.9rem;
    color: #657786;
    margin-bottom: 8px;
}

.copy-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.copy-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #14171a;
    background: #f5f5f5;
}

.copy-box button {
    padding: 10px 16px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.copy-box button:hover {
    background: #e55c00;
}

.modal-instructions {
    margin-top: 16px;
}

.rss-apps {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}

.rss-apps li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: #14171a;
}

.rss-apps a {
    color: #ff6600;
    text-decoration: none;
    font-weight: 500;
}

.rss-apps a:hover {
    text-decoration: underline;
}

.modal-divider {
    height: 1px;
    background: #e1e8ed;
    margin: 16px 0;
}

.raw-feed-link {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: #657786;
    text-decoration: none;
}

.raw-feed-link:hover {
    color: #14171a;
    text-decoration: underline;
}

.subtitle {
    font-size: 0.9rem;
    color: #657786;
    font-style: italic;
}

/* Feed */
#feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual thought card - tweet-like */
.thought {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 16px 20px;
    transition: box-shadow 0.2s ease;
}

.thought:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.thought-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #14171a;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.thought-footer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px;
}

.thought-time {
    font-size: 0.8rem;
    color: #657786;
    display: inline !important;
}

.thought-actions {
    display: inline-flex !important;
    flex-direction: row !important;
    gap: 4px;
    opacity: 1 !important;
    visibility: visible !important;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #657786;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: rgba(29, 161, 242, 0.1);
    color: #1da1f2;
}

.thought.highlighted {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(29, 161, 242, 0); }
    50% { box-shadow: 0 0 0 4px rgba(29, 161, 242, 0.3); }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #14171a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Empty state */
.empty {
    text-align: center;
    color: #657786;
    padding: 60px 20px;
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0 20px;
    margin-top: 40px;
    border-top: 1px solid #e1e8ed;
}

footer p {
    font-size: 0.8rem;
    color: #aab8c2;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    header {
        padding: 30px 0 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .thought {
        padding: 14px 16px;
        border-radius: 10px;
    }
    
    .thought-text {
        font-size: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #15202b;
        color: #ffffff;
    }
    
    h1 {
        color: #ffffff;
    }
    
    .subtitle {
        color: #8899a6;
    }
    
    .thought {
        background: #192734;
        border-color: #38444d;
    }
    
    .thought:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .thought-text {
        color: #ffffff;
    }
    
    .thought-time {
        color: #8899a6;
    }
    
    .empty {
        color: #8899a6;
    }
    
    header, footer {
        border-color: #38444d;
    }
    
    footer p {
        color: #5b7083;
    }
    
    .rss-link {
        color: #8899a6;
        border-color: #38444d;
    }

    .rss-link:hover {
        color: #ff6600;
        border-color: #ff6600;
        background-color: rgba(255, 102, 0, 0.1);
    }

    .modal {
        background: #192734;
    }
    
    .modal-header {
        border-color: #38444d;
    }
    
    .modal-header h2 {
        color: #ffffff;
    }
    
    .modal-close {
        color: #8899a6;
    }
    
    .modal-close:hover {
        color: #ffffff;
    }
    
    .copy-box input {
        background: #15202b;
        border-color: #38444d;
        color: #ffffff;
    }
    
    .rss-apps li {
        color: #ffffff;
    }
    
    .modal-divider {
        background: #38444d;
    }
    
    .raw-feed-link {
        color: #8899a6;
    }
    
    .raw-feed-link:hover {
        color: #ffffff;
    }
    
    .action-btn {
        color: #8899a6;
    }
    
    .action-btn:hover {
        background: rgba(29, 161, 242, 0.2);
        color: #1da1f2;
    }
    
    .toast {
        background: #ffffff;
        color: #14171a;
    }
}
