:root {
    --bg-primary: #000;
    --bg-secondary: #16181c;
    --bg-hover: #080808;
    --border-color: #2f3336;
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --accent-blue: #1d9bf0;
    --accent-red: #f4212e;
    --accent-green: #00ba7c;
}

[data-theme="light"] {
    --bg-primary: #fff;
    --bg-secondary: #f7f9f9;
    --bg-hover: #f7f9f9;
    --border-color: #eff3f4;
    --text-primary: #0f1419;
    --text-secondary: #536471;
    --accent-blue: #1d9bf0;
    --accent-red: #f4212e;
    --accent-green: #00ba7c;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.feed-main {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.theme-btn {
    padding: 12px 24px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s;
    margin: 8px 12px;
}

.theme-btn:hover {
    background: #1a8cd8;
}

.create-post {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.create-post-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.create-post-input textarea {
    width: 100%;
    min-height: 60px;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.25em;
    resize: none;
    outline: none;
}

.create-post-input textarea::placeholder {
    color: var(--text-secondary);
}

.image-preview {
    position: relative;
}

.image-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--accent-blue);
    border: none;
    font-size: 1.25em;
    cursor: pointer;
    transition: background 0.2s;
}

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

.post-btn {
    padding: 8px 24px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s;
}

.post-btn:hover {
    background: #1a8cd8;
}

.post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.empty-feed {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1em;
}

.post {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.post:hover {
    background: var(--bg-hover);
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.post-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.post-header-info {
    flex: 1;
}

.post-header-info h4 {
    font-size: 0.95em;
    font-weight: 700;
}

.post-header-info p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.delete-post-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-post-btn:hover {
    background: rgba(244, 33, 46, 0.1);
    color: var(--accent-red);
}

.post-text {
    margin: 12px 0;
    font-size: 0.95em;
    line-height: 1.5;
    white-space: pre-wrap;
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-top: 12px;
}

.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 4px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 30px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(29, 155, 240, 0.1);
    color: var(--accent-blue);
}

.action-btn.liked {
    color: var(--accent-red);
}

.action-btn.liked:hover {
    background: rgba(244, 33, 46, 0.1);
}

.action-btn.saved {
    color: var(--accent-green);
}

.action-btn.saved:hover {
    background: rgba(0, 186, 124, 0.1);
}

.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.add-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.add-comment input {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9em;
    outline: none;
}

.add-comment input:focus {
    border-color: var(--accent-blue);
}

.add-comment input::placeholder {
    color: var(--text-secondary);
}

.comment-btn {
    padding: 8px 20px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-btn:hover {
    background: #1a8cd8;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-secondary);
    position: relative;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-header h5 {
    font-size: 0.9em;
    font-weight: 700;
}

.comment-header span {
    color: var(--text-secondary);
    font-size: 0.8em;
}

.comment-content p {
    font-size: 0.9em;
    line-height: 1.5;
}

.delete-comment-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.delete-comment-btn:hover {
    background: rgba(244, 33, 46, 0.1);
    color: var(--accent-red);
}

.saved-info {
    padding: 16px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

@media (max-width: 688px) {
    .post {
        padding: 12px;
    }

    .create-post {
        padding: 12px;
    }

    .create-post-input textarea {
        font-size: 1em;
    }

    .post-header img,
    .create-post-avatar {
        width: 40px;
        height: 40px;
    }

    .comment-avatar {
        width: 28px;
        height: 28px;
    }
}
